-
Notifications
You must be signed in to change notification settings - Fork 198
/
Copy pathcosa-build.sh
executable file
·33 lines (30 loc) · 1.06 KB
/
cosa-build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/bash
# SPDX-License-Identifier: Apache-2.0 OR MIT
# Build rpm-ostree, using cosa as a buildroot and then
# override the version inside cosa, then build FCOS
set -xeuo pipefail
cosaimg=registry.ci.openshift.org/coreos/coreos-assembler:latest
podman pull "${cosaimg}"
# Build rpm-ostree using cosa as a buildroot, and extract the result
podman run --security-opt label=disable --rm \
-v $(pwd):/srv/code -w /srv/code \
--entrypoint bash --user root \
"${cosaimg}" \
-c 'yum -y swap fedora-release-container fedora-release && ./ci/build.sh && make install DESTDIR=$(pwd)/installroot'
codedir=$(pwd)
mkdir fcos
cd fcos
cat >script.sh <<'EOF'
#!/usr/bin/bash
set -xeuo pipefail
# Overlay the built binaries
rsync -rlv /code/installroot/usr/ /usr/
coreos-assembler init --force https://github.com/coreos/fedora-coreos-config
coreos-assembler build ostree
EOF
chmod a+x script.sh
podman run --privileged --rm -ti \
-v ${codedir}:/code -v $(pwd):/srv -w /srv \
--entrypoint bash \
--privileged ${cosaimg} \
./script.sh