From f430b0e07ff0bb6485d3b8cde25ab40e9f3c00ed Mon Sep 17 00:00:00 2001 From: Adam Miller Date: May 19 2015 20:20:27 +0000 Subject: [PATCH 1/7] - Move build-atomic to it's own script/function to be sourced - Add build-atomic for ISO build to make-updates --- diff --git a/scripts/build-atomic b/scripts/build-atomic new file mode 100755 index 0000000..995a6aa --- /dev/null +++ b/scripts/build-atomic @@ -0,0 +1,75 @@ +#!/bin/bash + +# script to build Fedora Atomic ISO and pxe-to-live content +# +# +# NOTE: This should not be run at face value, it is meant to be source'd +# into other code. The required defined variables are: +# DESTDIR - Base directory for resulting build artifacts +# or +# FINALDEST - Base directory for resulting build artifacts in make-updates +# +# ATOMIC - Location of the Atomic tdl, host json and rpm repo configs +# ATOMICDEST - Destination directory for the ostree tree builds +# VERSION - Fedora compose version (Example: 22_Beta_RC3) +# SHORTCOMPOSE: a short reference to the compmose it is 1 for RC1 and TC1 for TC1 +# SHORTVERSION: is a shortened version of the Version passed in to the +# control script (example: drops off _TCX) + +function build-atomic(){ + pushd $ATOMIC + git reset --hard + git pull --rebase + +echo '[fedora-bleed] +name=fedora-bleed +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-22-$basearch +enabled=1 +baseurl=http://kojipkgs.fedoraproject.org/mash/bleed/$basearch/' > fedora-bleed.repo + + sed -i -e 's|mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=fedora-22&arch=$basearch|baseurl=http://kojipkgs.fedoraproject.org/mash/branched/$basearch/os/|g' fedora*repo + # make sure we add the bleed repo to the json file + sed -i -e 's|\["fedora-22"\]|\["fedora-22", "fedora-bleed"\]|g' *json + mock -r fedora-branched-compose-x86_64 --init || exit 1 + mock -r fedora-branched-compose-x86_64 --install rpm-ostree lorax || exit 1 + mock -r fedora-branched-compose-x86_64 --shell "if [ ! -d $ATOMICDEST ]; then ostree init --repo=$ATOMICDEST --mode=archive-z2;fi" + mock -r fedora-branched-compose-x86_64 --shell "rpm-ostree compose tree --repo=$ATOMICDEST $ATOMIC/fedora-atomic-docker-host.json" || exit 1 + mock -r fedora-branched-compose-x86_64 --shell "mkdir -p $BUILDATOMIC_DIR/Cloud_Atomic/x86_64/iso" + mock -r fedora-branched-compose-x86_64 --shell "lorax --nomacboot -p Fedora -v $SHORTVERSION -r $SHORTCOMPOSE \ + -s http://kojipkgs.fedoraproject.org/mash/branched/x86_64/os/ \ + -s http://kojipkgs.fedoraproject.org/mash/bleed/x86_64/ \ + -i fedora-productimg-atomic \ + -t Cloud_Atomic \ + --tmp /tmp/ \ + --logfile=$BUILDATOMIC_LOG/logs/atomic \ + --add-template /srv/pungi/spin-kickstarts/atomic-installer/lorax-configure-repo.tmpl \ + --add-template-var=ostree_osname=Fedora-Cloud_Atomic \ + --add-arch-template-var=ostree_repo=http://compose-x86-01.phx2.fedoraproject.org/compose/atomic/ \ + --add-template-var=ostree_ref=fedora-atomic/f22/x86_64/docker-host \ + --add-arch-template /srv/pungi/spin-kickstarts/atomic-installer/lorax-embed-repo.tmpl \ + --add-arch-template-var=ostree_osname=Fedora-Cloud_Atomic \ + --add-arch-template-var=ostree_ref=fedora-atomic/f22/x86_64/docker-host \ + $BUILDATOMIC_DIR/Cloud_Atomic/x86_64/os/ " || exit 1 + mock -r fedora-branched-compose-x86_64 --shell "cp -l $BUILDATOMIC_DIR/Cloud_Atomic/x86_64/os/images/boot.iso $BUILDATOMIC_DIR/Cloud_Atomic/x86_64/iso/Fedora-Cloud_Atomic-x86_64-$VERSION.iso" || exit 1 + mock -r fedora-branched-compose-x86_64 --shell "pushd $BUILDATOMIC_DIR/Cloud_Atomic/x86_64/iso/ ;sha256sum -b --tag *iso >Fedora-Cloud_Atomic-$VERSION-x86_64-CHECKSUM; popd" || exit 1 + + #mock -r fedora-branched-compose-x86_64 --shell "livemedia-creator " || exit 1 + + popd +} + +# This is kind of a dirty hack but because the directory structures stored +# in vars for make-updates vs run-pungi are pretty different, this is the +# least bad choice. +if [[ -n "$MAKEUPDATES" ]]; then + BUILDATOMIC_DIR="$FINALDEST" + BUILDATOMIC_LOG="$FINALDEST/Cloud_Atomic/" +else + BUILDATOMIC_DIR="$DESTDIR/$VERSION" + BUILDATOMIC_LOG="$DESTDIR" +fi + +build-atomic + + diff --git a/scripts/make-updates b/scripts/make-updates index 258b3b0..867b803 100755 --- a/scripts/make-updates +++ b/scripts/make-updates @@ -44,9 +44,19 @@ done sg releng "mkdir -p $FINALDEST" pushd $FINALDEST/ -sg releng "mkdir -p Cloud-Images/i386/Images Cloud-Images/x86_64/Images Docker/x86_64" +sg releng "mkdir -p Cloud-Images/i386/Images Cloud-Images/x86_64/Images Docker/x86_64 Cloud_Atomic/x86_64 Cloud_Atomic/logs" popd +### +# BEGIN build-atomic +# build-atomic with current variable settings +## +MAKEUPDATES="true" #just needs to be non-zero length string +. $FULLPATH/build-atomic + +## +# END build-atomic +## USER=$(whoami) # stage images diff --git a/scripts/run-pungi b/scripts/run-pungi index 690ade1..d189eee 100755 --- a/scripts/run-pungi +++ b/scripts/run-pungi @@ -47,44 +47,9 @@ $FULLPATH/build-livecds "$SHORTVERSION" "$SHORTCOMPOSE" "$BRANCH" $FULLPATH/build-arm-images "$SHORTVERSION" "$SHORTCOMPOSE" "$BRANCH" pushd -pushd $ATOMIC - git reset --hard - git pull --rebase - echo '[fedora-bleed] -name=fedora-bleed -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-22-$basearch -enabled=1 -baseurl=http://kojipkgs.fedoraproject.org/mash/bleed/$basearch/' > fedora-bleed.repo - sed -i -e 's|mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=fedora-22&arch=$basearch|baseurl=http://kojipkgs.fedoraproject.org/mash/branched/$basearch/os/|g' fedora*repo - # make sure we add the bleed repo to the json file - sed -i -e 's|\["fedora-22"\]|\["fedora-22", "fedora-bleed"\]|g' *json - mock -r fedora-branched-compose-x86_64 --init || exit 1 - mock -r fedora-branched-compose-x86_64 --install rpm-ostree lorax || exit 1 - mock -r fedora-branched-compose-x86_64 --shell "if [ ! -d $ATOMICDEST ]; then ostree init --repo=$ATOMICDEST --mode=archive-z2;fi" - mock -r fedora-branched-compose-x86_64 --shell "rpm-ostree compose tree --repo=$ATOMICDEST $ATOMIC/fedora-atomic-docker-host.json" || exit 1 - mock -r fedora-branched-compose-x86_64 --shell "mkdir -p $DESTDIR/$VERSION/Cloud_Atomic/x86_64/iso" - mock -r fedora-branched-compose-x86_64 --shell "lorax --nomacboot -p Fedora -v $SHORTVERSION -r $SHORTCOMPOSE \ - -s http://kojipkgs.fedoraproject.org/mash/branched/x86_64/os/ \ - -s http://kojipkgs.fedoraproject.org/mash/bleed/x86_64/ \ - -i fedora-productimg-atomic \ - -t Cloud_Atomic \ - --tmp /tmp/ \ - --logfile=$DESTDIR/logs/atomic \ - --add-template /srv/pungi/spin-kickstarts/atomic-installer/lorax-configure-repo.tmpl \ - --add-template-var=ostree_osname=fedora-atomic \ - --add-arch-template-var=ostree_repo=http://compose-x86-01.phx2.fedoraproject.org/compose/atomic/ \ - --add-template-var=ostree_ref=fedora-atomic/f22/x86_64/docker-host \ - --add-arch-template /srv/pungi/spin-kickstarts/atomic-installer/lorax-embed-repo.tmpl \ - --add-arch-template-var=ostree_osname=fedora-atomic \ - --add-arch-template-var=ostree_ref=fedora-atomic/f22/x86_64/docker-host \ - $DESTDIR/$VERSION/Cloud_Atomic/x86_64/os/ " || exit 1 - mock -r fedora-branched-compose-x86_64 --shell "cp -l $DESTDIR/$VERSION/Cloud_Atomic/x86_64/os/images/boot.iso $DESTDIR/$VERSION/Cloud_Atomic/x86_64/iso/Fedora-Cloud_Atomic-x86_64-$VERSION.iso" || exit 1 - mock -r fedora-branched-compose-x86_64 --shell "pushd $DESTDIR/$VERSION/Cloud_Atomic/x86_64/iso/ ;sha256sum -b --tag *iso >Fedora-Cloud_Atomic-$VERSION-x86_64-CHECKSUM; popd" || exit 1 - - #mock -r fedora-branched-compose-x86_64 --shell "livemedia-creator " || exit 1 - -popd +### +# build-atomic with current variable settings +. $FULLPATH/build-atomic for arch in armhfp i386 x86_64 do From ca476547df6f1c34c785285f0f79c6f2c7f379cf Mon Sep 17 00:00:00 2001 From: Adam Miller Date: May 19 2015 20:20:27 +0000 Subject: [PATCH 2/7] handle build-atomic log files in the correct location --- diff --git a/scripts/build-atomic b/scripts/build-atomic index 995a6aa..2debe01 100755 --- a/scripts/build-atomic +++ b/scripts/build-atomic @@ -5,9 +5,9 @@ # # NOTE: This should not be run at face value, it is meant to be source'd # into other code. The required defined variables are: -# DESTDIR - Base directory for resulting build artifacts -# or -# FINALDEST - Base directory for resulting build artifacts in make-updates +# DESTDIR - Base directory for resulting build artifacts (for run-pungi) +# - Also required for logs dir +# FINALDEST - Base directory for resulting build artifacts (for make-updates) # # ATOMIC - Location of the Atomic tdl, host json and rpm repo configs # ATOMICDEST - Destination directory for the ostree tree builds @@ -36,13 +36,14 @@ baseurl=http://kojipkgs.fedoraproject.org/mash/bleed/$basearch/' > fedora-bleed. mock -r fedora-branched-compose-x86_64 --shell "if [ ! -d $ATOMICDEST ]; then ostree init --repo=$ATOMICDEST --mode=archive-z2;fi" mock -r fedora-branched-compose-x86_64 --shell "rpm-ostree compose tree --repo=$ATOMICDEST $ATOMIC/fedora-atomic-docker-host.json" || exit 1 mock -r fedora-branched-compose-x86_64 --shell "mkdir -p $BUILDATOMIC_DIR/Cloud_Atomic/x86_64/iso" + mock -r fedora-branched-compose-x86_64 --shell "mkdir -p $DESTDIR/logs/" mock -r fedora-branched-compose-x86_64 --shell "lorax --nomacboot -p Fedora -v $SHORTVERSION -r $SHORTCOMPOSE \ -s http://kojipkgs.fedoraproject.org/mash/branched/x86_64/os/ \ -s http://kojipkgs.fedoraproject.org/mash/bleed/x86_64/ \ -i fedora-productimg-atomic \ -t Cloud_Atomic \ --tmp /tmp/ \ - --logfile=$BUILDATOMIC_LOG/logs/atomic \ + --logfile=$DESTDIR/logs/atomic \ --add-template /srv/pungi/spin-kickstarts/atomic-installer/lorax-configure-repo.tmpl \ --add-template-var=ostree_osname=Fedora-Cloud_Atomic \ --add-arch-template-var=ostree_repo=http://compose-x86-01.phx2.fedoraproject.org/compose/atomic/ \ @@ -64,12 +65,11 @@ baseurl=http://kojipkgs.fedoraproject.org/mash/bleed/$basearch/' > fedora-bleed. # least bad choice. if [[ -n "$MAKEUPDATES" ]]; then BUILDATOMIC_DIR="$FINALDEST" - BUILDATOMIC_LOG="$FINALDEST/Cloud_Atomic/" else BUILDATOMIC_DIR="$DESTDIR/$VERSION" - BUILDATOMIC_LOG="$DESTDIR" fi +sg releng "mkdir -p $DESTDIR/logs" build-atomic From a9764b5d770f8dad89cf0c0cfd1a129583420a76 Mon Sep 17 00:00:00 2001 From: Adam Miller Date: May 19 2015 20:20:27 +0000 Subject: [PATCH 3/7] comments about the logs dir bindmounting into mock chroots for posterity --- diff --git a/scripts/build-atomic b/scripts/build-atomic index 2debe01..de9c17f 100755 --- a/scripts/build-atomic +++ b/scripts/build-atomic @@ -69,7 +69,10 @@ else BUILDATOMIC_DIR="$DESTDIR/$VERSION" fi +# $DESTDIR gets bindmounted from the mock config for the compose actions. +# This allows log files to persist outside of individual builds/chroots sg releng "mkdir -p $DESTDIR/logs" + build-atomic diff --git a/scripts/run-pungi b/scripts/run-pungi index d189eee..1bc7400 100755 --- a/scripts/run-pungi +++ b/scripts/run-pungi @@ -34,6 +34,8 @@ SHORTVERSION=$VERSION MILESTONE=Final } +# $DESTDIR gets bindmounted from the mock config for the compose actions. +# This allows log files to persist outside of individual builds/chroots sg releng "mkdir -p $DESTDIR/logs" FULLPATH=$(pwd) From d0776253c96c3e476e8626c687d7888c73fd5048 Mon Sep 17 00:00:00 2001 From: Adam Miller Date: May 19 2015 20:20:27 +0000 Subject: [PATCH 4/7] don't create un-needed log dir under Cloud_Atomic --- diff --git a/scripts/make-updates b/scripts/make-updates index 867b803..2d40ace 100755 --- a/scripts/make-updates +++ b/scripts/make-updates @@ -44,7 +44,7 @@ done sg releng "mkdir -p $FINALDEST" pushd $FINALDEST/ -sg releng "mkdir -p Cloud-Images/i386/Images Cloud-Images/x86_64/Images Docker/x86_64 Cloud_Atomic/x86_64 Cloud_Atomic/logs" +sg releng "mkdir -p Cloud-Images/i386/Images Cloud-Images/x86_64/Images Docker/x86_64 Cloud_Atomic/x86_64" popd ### From 4e6dcbcacd0ce327adc6781fea3d3d5ce9436a30 Mon Sep 17 00:00:00 2001 From: Adam Miller Date: May 19 2015 20:20:27 +0000 Subject: [PATCH 5/7] - Create lib-atomic to be a library of atomic related functions - refactor build-atomic to be a function within lib-atomic - update run-pungi and make-updates to use build-atomic function --- diff --git a/scripts/build-atomic b/scripts/build-atomic deleted file mode 100755 index de9c17f..0000000 --- a/scripts/build-atomic +++ /dev/null @@ -1,78 +0,0 @@ -#!/bin/bash - -# script to build Fedora Atomic ISO and pxe-to-live content -# -# -# NOTE: This should not be run at face value, it is meant to be source'd -# into other code. The required defined variables are: -# DESTDIR - Base directory for resulting build artifacts (for run-pungi) -# - Also required for logs dir -# FINALDEST - Base directory for resulting build artifacts (for make-updates) -# -# ATOMIC - Location of the Atomic tdl, host json and rpm repo configs -# ATOMICDEST - Destination directory for the ostree tree builds -# VERSION - Fedora compose version (Example: 22_Beta_RC3) -# SHORTCOMPOSE: a short reference to the compmose it is 1 for RC1 and TC1 for TC1 -# SHORTVERSION: is a shortened version of the Version passed in to the -# control script (example: drops off _TCX) - -function build-atomic(){ - pushd $ATOMIC - git reset --hard - git pull --rebase - -echo '[fedora-bleed] -name=fedora-bleed -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-22-$basearch -enabled=1 -baseurl=http://kojipkgs.fedoraproject.org/mash/bleed/$basearch/' > fedora-bleed.repo - - sed -i -e 's|mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=fedora-22&arch=$basearch|baseurl=http://kojipkgs.fedoraproject.org/mash/branched/$basearch/os/|g' fedora*repo - # make sure we add the bleed repo to the json file - sed -i -e 's|\["fedora-22"\]|\["fedora-22", "fedora-bleed"\]|g' *json - mock -r fedora-branched-compose-x86_64 --init || exit 1 - mock -r fedora-branched-compose-x86_64 --install rpm-ostree lorax || exit 1 - mock -r fedora-branched-compose-x86_64 --shell "if [ ! -d $ATOMICDEST ]; then ostree init --repo=$ATOMICDEST --mode=archive-z2;fi" - mock -r fedora-branched-compose-x86_64 --shell "rpm-ostree compose tree --repo=$ATOMICDEST $ATOMIC/fedora-atomic-docker-host.json" || exit 1 - mock -r fedora-branched-compose-x86_64 --shell "mkdir -p $BUILDATOMIC_DIR/Cloud_Atomic/x86_64/iso" - mock -r fedora-branched-compose-x86_64 --shell "mkdir -p $DESTDIR/logs/" - mock -r fedora-branched-compose-x86_64 --shell "lorax --nomacboot -p Fedora -v $SHORTVERSION -r $SHORTCOMPOSE \ - -s http://kojipkgs.fedoraproject.org/mash/branched/x86_64/os/ \ - -s http://kojipkgs.fedoraproject.org/mash/bleed/x86_64/ \ - -i fedora-productimg-atomic \ - -t Cloud_Atomic \ - --tmp /tmp/ \ - --logfile=$DESTDIR/logs/atomic \ - --add-template /srv/pungi/spin-kickstarts/atomic-installer/lorax-configure-repo.tmpl \ - --add-template-var=ostree_osname=Fedora-Cloud_Atomic \ - --add-arch-template-var=ostree_repo=http://compose-x86-01.phx2.fedoraproject.org/compose/atomic/ \ - --add-template-var=ostree_ref=fedora-atomic/f22/x86_64/docker-host \ - --add-arch-template /srv/pungi/spin-kickstarts/atomic-installer/lorax-embed-repo.tmpl \ - --add-arch-template-var=ostree_osname=Fedora-Cloud_Atomic \ - --add-arch-template-var=ostree_ref=fedora-atomic/f22/x86_64/docker-host \ - $BUILDATOMIC_DIR/Cloud_Atomic/x86_64/os/ " || exit 1 - mock -r fedora-branched-compose-x86_64 --shell "cp -l $BUILDATOMIC_DIR/Cloud_Atomic/x86_64/os/images/boot.iso $BUILDATOMIC_DIR/Cloud_Atomic/x86_64/iso/Fedora-Cloud_Atomic-x86_64-$VERSION.iso" || exit 1 - mock -r fedora-branched-compose-x86_64 --shell "pushd $BUILDATOMIC_DIR/Cloud_Atomic/x86_64/iso/ ;sha256sum -b --tag *iso >Fedora-Cloud_Atomic-$VERSION-x86_64-CHECKSUM; popd" || exit 1 - - #mock -r fedora-branched-compose-x86_64 --shell "livemedia-creator " || exit 1 - - popd -} - -# This is kind of a dirty hack but because the directory structures stored -# in vars for make-updates vs run-pungi are pretty different, this is the -# least bad choice. -if [[ -n "$MAKEUPDATES" ]]; then - BUILDATOMIC_DIR="$FINALDEST" -else - BUILDATOMIC_DIR="$DESTDIR/$VERSION" -fi - -# $DESTDIR gets bindmounted from the mock config for the compose actions. -# This allows log files to persist outside of individual builds/chroots -sg releng "mkdir -p $DESTDIR/logs" - -build-atomic - - diff --git a/scripts/lib-atomic b/scripts/lib-atomic new file mode 100755 index 0000000..8a255cb --- /dev/null +++ b/scripts/lib-atomic @@ -0,0 +1,96 @@ +#!/bin/bash + +# Fedora Atomic related functions +# +# NOTE: This should not be run at face value, it is meant to be source'd +# into other code and functions called accordingly. +# +##### +# Functions that "return" a value will do so in the __RETURN__ variable +##### + + +############################################################################## +# function build-atomic +# - build Fedora Atomic ISO and pxe-to-live content +# +# The required globally defined variables are: +# DESTDIR - Base directory for resulting build artifacts (for run-pungi) +# - Also required for logs dir +# FINALDEST - Base directory for resulting build artifacts (for make-updates) +# +# ATOMIC - Location of the Atomic tdl, host json and rpm repo configs +# ATOMICDEST - Destination directory for the ostree tree builds +# VERSION - Fedora compose version (Example: 22_Beta_RC3) +# SHORTCOMPOSE: a short reference to the compmose it is 1 for RC1 and TC1 for TC1 +# SHORTVERSION: is a shortened version of the Version passed in to the +# control script (example: drops off _TCX) + +function build-atomic(){ + # This is kind of a dirty hack but because the directory structures stored + # in vars for make-updates vs run-pungi are pretty different, this is the + # least bad choice. + if [[ -n "$MAKEUPDATES" ]]; then + BUILDATOMIC_DIR="$FINALDEST" + else + BUILDATOMIC_DIR="$DESTDIR/$VERSION" + fi + + # $DESTDIR gets bindmounted from the mock config for the compose actions. + # This allows log files to persist outside of individual builds/chroots + sg releng "mkdir -p $DESTDIR/logs" + + pushd $ATOMIC + git reset --hard + git pull --rebase + + sed -i -e 's|mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=fedora-22&arch=$basearch|baseurl=http://kojipkgs.fedoraproject.org/mash/branched/$basearch/os/|g' fedora*repo + # make sure we add the bleed repo to the json file + sed -i -e 's|\["fedora-22"\]|\["fedora-22", "fedora-bleed"\]|g' *json + mock -r fedora-branched-compose-x86_64 --init || exit 1 + mock -r fedora-branched-compose-x86_64 --install rpm-ostree lorax || exit 1 + mock -r fedora-branched-compose-x86_64 --shell "mkdir -p $BUILDATOMIC_DIR/Cloud_Atomic/x86_64/iso" + mock -r fedora-branched-compose-x86_64 --shell "mkdir -p $DESTDIR/logs/" + + if [[ -n "$MAKEUPDATES" ]]; then + mock -r fedora-branched-compose-x86_64 --shell "lorax --nomacboot -p Fedora -v $SHORTVERSION -r $SHORTCOMPOSE \ + -s http://kojipkgs.fedoraproject.org/mash/branched/x86_64/os/ \ + -i fedora-productimg-atomic \ + -t Cloud_Atomic \ + --tmp /tmp/ \ + --logfile=$DESTDIR/logs/atomic \ + --add-template /srv/pungi/spin-kickstarts/atomic-installer/lorax-configure-repo.tmpl \ + --add-template-var=ostree_osname=Fedora-Cloud_Atomic \ + --add-arch-template-var=ostree_repo=http://compose-x86-01.phx2.fedoraproject.org/compose/atomic/ \ + --add-template-var=ostree_ref=fedora-atomic/f22/x86_64/docker-host \ + --add-arch-template /srv/pungi/spin-kickstarts/atomic-installer/lorax-embed-repo.tmpl \ + --add-arch-template-var=ostree_osname=Fedora-Cloud_Atomic \ + --add-arch-template-var=ostree_ref=fedora-atomic/f22/x86_64/docker-host \ + $BUILDATOMIC_DIR/Cloud_Atomic/x86_64/os/ " || exit 1 + else + mock -r fedora-branched-compose-x86_64 --shell "if [ ! -d $ATOMICDEST ]; then ostree init --repo=$ATOMICDEST --mode=archive-z2;fi" + mock -r fedora-branched-compose-x86_64 --shell "rpm-ostree compose tree --repo=$ATOMICDEST $ATOMIC/fedora-atomic-docker-host.json" || exit 1 + mock -r fedora-branched-compose-x86_64 --shell "lorax --nomacboot -p Fedora -v $SHORTVERSION -r $SHORTCOMPOSE \ + -s http://kojipkgs.fedoraproject.org/mash/branched/x86_64/os/ \ + -s http://kojipkgs.fedoraproject.org/mash/bleed/x86_64/ \ + -i fedora-productimg-atomic \ + -t Cloud_Atomic \ + --tmp /tmp/ \ + --logfile=$DESTDIR/logs/atomic \ + --add-template /srv/pungi/spin-kickstarts/atomic-installer/lorax-configure-repo.tmpl \ + --add-template-var=ostree_osname=Fedora-Cloud_Atomic \ + --add-arch-template-var=ostree_repo=http://compose-x86-01.phx2.fedoraproject.org/compose/atomic/ \ + --add-template-var=ostree_ref=fedora-atomic/f22/x86_64/docker-host \ + --add-arch-template /srv/pungi/spin-kickstarts/atomic-installer/lorax-embed-repo.tmpl \ + --add-arch-template-var=ostree_osname=Fedora-Cloud_Atomic \ + --add-arch-template-var=ostree_ref=fedora-atomic/f22/x86_64/docker-host \ + $BUILDATOMIC_DIR/Cloud_Atomic/x86_64/os/ " || exit 1 + fi + + mock -r fedora-branched-compose-x86_64 --shell "cp -l $BUILDATOMIC_DIR/Cloud_Atomic/x86_64/os/images/boot.iso $BUILDATOMIC_DIR/Cloud_Atomic/x86_64/iso/Fedora-Cloud_Atomic-x86_64-$VERSION.iso" || exit 1 + mock -r fedora-branched-compose-x86_64 --shell "pushd $BUILDATOMIC_DIR/Cloud_Atomic/x86_64/iso/ ;sha256sum -b --tag *iso >Fedora-Cloud_Atomic-$VERSION-x86_64-CHECKSUM; popd" || exit 1 + + #mock -r fedora-branched-compose-x86_64 --shell "livemedia-creator " || exit 1 + + popd +} # end build-atomic diff --git a/scripts/make-updates b/scripts/make-updates index 2d40ace..6207d27 100755 --- a/scripts/make-updates +++ b/scripts/make-updates @@ -52,7 +52,8 @@ popd # build-atomic with current variable settings ## MAKEUPDATES="true" #just needs to be non-zero length string -. $FULLPATH/build-atomic +. $FULLPATH/lib-atomic +build-atomic ## # END build-atomic diff --git a/scripts/run-pungi b/scripts/run-pungi index 1bc7400..51fb561 100755 --- a/scripts/run-pungi +++ b/scripts/run-pungi @@ -51,7 +51,8 @@ pushd ### # build-atomic with current variable settings -. $FULLPATH/build-atomic +. $FULLPATH/lib-atomic +build-atomic for arch in armhfp i386 x86_64 do From 0879bd6becf218b782800a3ed0b4664f4879142b Mon Sep 17 00:00:00 2001 From: Adam Miller Date: May 19 2015 20:20:28 +0000 Subject: [PATCH 6/7] use correct repos for make-updates logic in atomic-build in lib-atomic, bleed repo isn't needed there --- diff --git a/scripts/lib-atomic b/scripts/lib-atomic index 8a255cb..f204bf8 100755 --- a/scripts/lib-atomic +++ b/scripts/lib-atomic @@ -45,8 +45,6 @@ function build-atomic(){ git pull --rebase sed -i -e 's|mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=fedora-22&arch=$basearch|baseurl=http://kojipkgs.fedoraproject.org/mash/branched/$basearch/os/|g' fedora*repo - # make sure we add the bleed repo to the json file - sed -i -e 's|\["fedora-22"\]|\["fedora-22", "fedora-bleed"\]|g' *json mock -r fedora-branched-compose-x86_64 --init || exit 1 mock -r fedora-branched-compose-x86_64 --install rpm-ostree lorax || exit 1 mock -r fedora-branched-compose-x86_64 --shell "mkdir -p $BUILDATOMIC_DIR/Cloud_Atomic/x86_64/iso" @@ -61,13 +59,15 @@ function build-atomic(){ --logfile=$DESTDIR/logs/atomic \ --add-template /srv/pungi/spin-kickstarts/atomic-installer/lorax-configure-repo.tmpl \ --add-template-var=ostree_osname=Fedora-Cloud_Atomic \ - --add-arch-template-var=ostree_repo=http://compose-x86-01.phx2.fedoraproject.org/compose/atomic/ \ - --add-template-var=ostree_ref=fedora-atomic/f22/x86_64/docker-host \ + --add-arch-template-var=ostree_repo=http://kojipkgs.fedoraproject.org/mash/atomic/$SHORTVERSION/ \ + --add-template-var=ostree_ref=fedora-atomic/f$SHORTVERSION/x86_64/docker-host \ --add-arch-template /srv/pungi/spin-kickstarts/atomic-installer/lorax-embed-repo.tmpl \ --add-arch-template-var=ostree_osname=Fedora-Cloud_Atomic \ - --add-arch-template-var=ostree_ref=fedora-atomic/f22/x86_64/docker-host \ + --add-arch-template-var=ostree_ref=fedora-atomic/f$SHORTVERSION/x86_64/docker-host \ $BUILDATOMIC_DIR/Cloud_Atomic/x86_64/os/ " || exit 1 else + # make sure we add the bleed repo to the json file + sed -i -e 's|\["fedora-22"\]|\["fedora-22", "fedora-bleed"\]|g' *json mock -r fedora-branched-compose-x86_64 --shell "if [ ! -d $ATOMICDEST ]; then ostree init --repo=$ATOMICDEST --mode=archive-z2;fi" mock -r fedora-branched-compose-x86_64 --shell "rpm-ostree compose tree --repo=$ATOMICDEST $ATOMIC/fedora-atomic-docker-host.json" || exit 1 mock -r fedora-branched-compose-x86_64 --shell "lorax --nomacboot -p Fedora -v $SHORTVERSION -r $SHORTCOMPOSE \ From bc7ab8d26ea9e87a96eec374656d6706aa21454f Mon Sep 17 00:00:00 2001 From: Adam Miller Date: May 19 2015 20:27:45 +0000 Subject: [PATCH 7/7] - Fix comments on build-atomic function to align with build output - Update lib-atomic add-arch-template-var to reflect change in commit id 6c58e3ce4ab85c46ca9c4a828017c6538fcb94fb - Update naming of image in lib-atomic as per https://pagure.io/releng/pull-request/3 --- diff --git a/scripts/lib-atomic b/scripts/lib-atomic index f204bf8..868658c 100755 --- a/scripts/lib-atomic +++ b/scripts/lib-atomic @@ -12,7 +12,8 @@ ############################################################################## # function build-atomic -# - build Fedora Atomic ISO and pxe-to-live content +# - build Fedora Atomic OSTree Commit, ISO and virt/cloud images +# - In the future: pxe-to-live content # # The required globally defined variables are: # DESTDIR - Base directory for resulting build artifacts (for run-pungi) @@ -58,18 +59,23 @@ function build-atomic(){ --tmp /tmp/ \ --logfile=$DESTDIR/logs/atomic \ --add-template /srv/pungi/spin-kickstarts/atomic-installer/lorax-configure-repo.tmpl \ - --add-template-var=ostree_osname=Fedora-Cloud_Atomic \ + --add-template-var=ostree_osname=fedora-atomic \ --add-arch-template-var=ostree_repo=http://kojipkgs.fedoraproject.org/mash/atomic/$SHORTVERSION/ \ --add-template-var=ostree_ref=fedora-atomic/f$SHORTVERSION/x86_64/docker-host \ --add-arch-template /srv/pungi/spin-kickstarts/atomic-installer/lorax-embed-repo.tmpl \ - --add-arch-template-var=ostree_osname=Fedora-Cloud_Atomic \ + --add-arch-template-var=ostree_osname=fedora-atomic \ --add-arch-template-var=ostree_ref=fedora-atomic/f$SHORTVERSION/x86_64/docker-host \ $BUILDATOMIC_DIR/Cloud_Atomic/x86_64/os/ " || exit 1 else # make sure we add the bleed repo to the json file sed -i -e 's|\["fedora-22"\]|\["fedora-22", "fedora-bleed"\]|g' *json mock -r fedora-branched-compose-x86_64 --shell "if [ ! -d $ATOMICDEST ]; then ostree init --repo=$ATOMICDEST --mode=archive-z2;fi" + + #FIXME + # In the future, this is where we should invoke ostree static-delta + # generate or the like; track what rawhide is doing. mock -r fedora-branched-compose-x86_64 --shell "rpm-ostree compose tree --repo=$ATOMICDEST $ATOMIC/fedora-atomic-docker-host.json" || exit 1 + mock -r fedora-branched-compose-x86_64 --shell "lorax --nomacboot -p Fedora -v $SHORTVERSION -r $SHORTCOMPOSE \ -s http://kojipkgs.fedoraproject.org/mash/branched/x86_64/os/ \ -s http://kojipkgs.fedoraproject.org/mash/bleed/x86_64/ \ @@ -78,17 +84,17 @@ function build-atomic(){ --tmp /tmp/ \ --logfile=$DESTDIR/logs/atomic \ --add-template /srv/pungi/spin-kickstarts/atomic-installer/lorax-configure-repo.tmpl \ - --add-template-var=ostree_osname=Fedora-Cloud_Atomic \ - --add-arch-template-var=ostree_repo=http://compose-x86-01.phx2.fedoraproject.org/compose/atomic/ \ + --add-template-var=ostree_osname=fedora-atomic \ + --add-arch-template-var=ostree_repo=http://kojipkgs.fedoraproject.org/mash/atomic/22/ \ --add-template-var=ostree_ref=fedora-atomic/f22/x86_64/docker-host \ --add-arch-template /srv/pungi/spin-kickstarts/atomic-installer/lorax-embed-repo.tmpl \ - --add-arch-template-var=ostree_osname=Fedora-Cloud_Atomic \ + --add-arch-template-var=ostree_osname=fedora-atomic \ --add-arch-template-var=ostree_ref=fedora-atomic/f22/x86_64/docker-host \ $BUILDATOMIC_DIR/Cloud_Atomic/x86_64/os/ " || exit 1 fi - mock -r fedora-branched-compose-x86_64 --shell "cp -l $BUILDATOMIC_DIR/Cloud_Atomic/x86_64/os/images/boot.iso $BUILDATOMIC_DIR/Cloud_Atomic/x86_64/iso/Fedora-Cloud_Atomic-x86_64-$VERSION.iso" || exit 1 - mock -r fedora-branched-compose-x86_64 --shell "pushd $BUILDATOMIC_DIR/Cloud_Atomic/x86_64/iso/ ;sha256sum -b --tag *iso >Fedora-Cloud_Atomic-$VERSION-x86_64-CHECKSUM; popd" || exit 1 + mock -r fedora-branched-compose-x86_64 --shell "cp -l $BUILDATOMIC_DIR/Cloud_Atomic/x86_64/os/images/boot.iso $BUILDATOMIC_DIR/Cloud_Atomic/x86_64/iso/fedora-atomic-x86_64-$VERSION.iso" || exit 1 + mock -r fedora-branched-compose-x86_64 --shell "pushd $BUILDATOMIC_DIR/Cloud_Atomic/x86_64/iso/ ;sha256sum -b --tag *iso >fedora-atomic-$VERSION-x86_64-CHECKSUM; popd" || exit 1 #mock -r fedora-branched-compose-x86_64 --shell "livemedia-creator " || exit 1