From 9e89057b4a370c54ef88af4402938ce59216250e Mon Sep 17 00:00:00 2001 From: Dusty Mabe Date: Fri, 12 Oct 2018 17:21:18 -0400 Subject: [PATCH] fedora-atomic: split out kickstarts to fix vagrant In the vagrant kickstarts we had something like %include fedora-atomic-vagrant.ks %include fedora-atomic-updates.ks but both fedora-atomic-updates.ks and fedora-atomic-vagrant.ks included fedora-atomic.ks which means we got duplicate things in the flattened ks and we get errors. This splits it out a bit farther so we don't get duplicates. --- fedora-atomic-testing-base.ks | 27 +++++++++++++++++++++++++++ fedora-atomic-testing.ks | 29 +++-------------------------- fedora-atomic-updates-base.ks | 27 +++++++++++++++++++++++++++ fedora-atomic-updates.ks | 29 +++-------------------------- fedora-atomic-vagrant-testing.ks | 2 +- fedora-atomic-vagrant-updates.ks | 2 +- 6 files changed, 62 insertions(+), 54 deletions(-) create mode 100644 fedora-atomic-testing-base.ks create mode 100644 fedora-atomic-updates-base.ks diff --git a/fedora-atomic-testing-base.ks b/fedora-atomic-testing-base.ks new file mode 100644 index 0000000..a0a30ca --- /dev/null +++ b/fedora-atomic-testing-base.ks @@ -0,0 +1,27 @@ + +# ./fedora-atomic-testing-base.ks - for building media from the testing +# refs (fedora/29/${basearch}/testing/atomic-host) + +ostreesetup --nogpg --osname=fedora-atomic --remote=fedora-atomic --url=https://kojipkgs.fedoraproject.org/compose/atomic/repo/ --ref=fedora/29/${basearch}/testing/atomic-host + +%post --erroronfail +# Find the architecture we are on +arch=$(uname -m) +# Set the origin to the "main stable ref", distinct from /testing/ which is where bodhi writes. +# We want consumers of this image to track the two week releases. +ostree admin set-origin --index 0 fedora-atomic https://dl.fedoraproject.org/atomic/repo/ "fedora/29/${arch}/atomic-host" + +# Make sure the ref we're supposedly sitting on (according +# to the updated origin) exists. +ostree refs "fedora-atomic:fedora/29/${arch}/testing/atomic-host" --create "fedora-atomic:fedora/29/${arch}/atomic-host" + +# Remove the old ref so that the commit eventually gets +# cleaned up. +ostree refs "fedora-atomic:fedora/29/${arch}/testing/atomic-host" --delete + +# delete/add the remote with new options to enable gpg verification +# and to point them at the cdn url +ostree remote delete fedora-atomic +ostree remote add --set=gpg-verify=true --set=gpgkeypath=/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-29-primary fedora-atomic 'https://dl.fedoraproject.org/atomic/repo/' + +%end diff --git a/fedora-atomic-testing.ks b/fedora-atomic-testing.ks index baea732..73111f1 100644 --- a/fedora-atomic-testing.ks +++ b/fedora-atomic-testing.ks @@ -1,29 +1,6 @@ -# ./fedora-atomic-testing.ks - for building media from the testing -# refs (fedora/29/${basearch}/testing/atomic-host) +# ./fedora-atomic-testing.ks - for building base cloud media +# from the testing refs (fedora/29/${basearch}/testing/atomic-host) %include fedora-atomic.ks - -ostreesetup --nogpg --osname=fedora-atomic --remote=fedora-atomic --url=https://kojipkgs.fedoraproject.org/compose/atomic/repo/ --ref=fedora/29/${basearch}/testing/atomic-host - -%post --erroronfail -# Find the architecture we are on -arch=$(uname -m) -# Set the origin to the "main stable ref", distinct from /testing/ which is where bodhi writes. -# We want consumers of this image to track the two week releases. -ostree admin set-origin --index 0 fedora-atomic https://dl.fedoraproject.org/atomic/repo/ "fedora/29/${arch}/atomic-host" - -# Make sure the ref we're supposedly sitting on (according -# to the updated origin) exists. -ostree refs "fedora-atomic:fedora/29/${arch}/testing/atomic-host" --create "fedora-atomic:fedora/29/${arch}/atomic-host" - -# Remove the old ref so that the commit eventually gets -# cleaned up. -ostree refs "fedora-atomic:fedora/29/${arch}/testing/atomic-host" --delete - -# delete/add the remote with new options to enable gpg verification -# and to point them at the cdn url -ostree remote delete fedora-atomic -ostree remote add --set=gpg-verify=true --set=gpgkeypath=/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-29-primary fedora-atomic 'https://dl.fedoraproject.org/atomic/repo/' - -%end +%include fedora-atomic-testing-base.ks diff --git a/fedora-atomic-updates-base.ks b/fedora-atomic-updates-base.ks new file mode 100644 index 0000000..821e841 --- /dev/null +++ b/fedora-atomic-updates-base.ks @@ -0,0 +1,27 @@ + +# ./fedora-atomic-updates-base.ks - for building media from the updates +# refs (fedora/29/${basearch}/updates/atomic-host) + +ostreesetup --nogpg --osname=fedora-atomic --remote=fedora-atomic --url=https://kojipkgs.fedoraproject.org/compose/atomic/repo/ --ref=fedora/29/${basearch}/updates/atomic-host + +%post --erroronfail +# Find the architecture we are on +arch=$(uname -m) +# Set the origin to the "main stable ref", distinct from /updates/ which is where bodhi writes. +# We want consumers of this image to track the two week releases. +ostree admin set-origin --index 0 fedora-atomic https://dl.fedoraproject.org/atomic/repo/ "fedora/29/${arch}/atomic-host" + +# Make sure the ref we're supposedly sitting on (according +# to the updated origin) exists. +ostree refs "fedora-atomic:fedora/29/${arch}/updates/atomic-host" --create "fedora-atomic:fedora/29/${arch}/atomic-host" + +# Remove the old ref so that the commit eventually gets +# cleaned up. +ostree refs "fedora-atomic:fedora/29/${arch}/updates/atomic-host" --delete + +# delete/add the remote with new options to enable gpg verification +# and to point them at the cdn url +ostree remote delete fedora-atomic +ostree remote add --set=gpg-verify=true --set=gpgkeypath=/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-29-primary fedora-atomic 'https://dl.fedoraproject.org/atomic/repo/' + +%end diff --git a/fedora-atomic-updates.ks b/fedora-atomic-updates.ks index 00c2040..71d409a 100644 --- a/fedora-atomic-updates.ks +++ b/fedora-atomic-updates.ks @@ -1,29 +1,6 @@ -# ./fedora-atomic-updates.ks - for building media from the updates -# refs (fedora/29/${basearch}/updates/atomic-host) +# ./fedora-atomic-updates.ks - for building base cloud media +# from the updates refs (fedora/29/${basearch}/updates/atomic-host) %include fedora-atomic.ks - -ostreesetup --nogpg --osname=fedora-atomic --remote=fedora-atomic --url=https://kojipkgs.fedoraproject.org/compose/atomic/repo/ --ref=fedora/29/${basearch}/updates/atomic-host - -%post --erroronfail -# Find the architecture we are on -arch=$(uname -m) -# Set the origin to the "main stable ref", distinct from /updates/ which is where bodhi writes. -# We want consumers of this image to track the two week releases. -ostree admin set-origin --index 0 fedora-atomic https://dl.fedoraproject.org/atomic/repo/ "fedora/29/${arch}/atomic-host" - -# Make sure the ref we're supposedly sitting on (according -# to the updated origin) exists. -ostree refs "fedora-atomic:fedora/29/${arch}/updates/atomic-host" --create "fedora-atomic:fedora/29/${arch}/atomic-host" - -# Remove the old ref so that the commit eventually gets -# cleaned up. -ostree refs "fedora-atomic:fedora/29/${arch}/updates/atomic-host" --delete - -# delete/add the remote with new options to enable gpg verification -# and to point them at the cdn url -ostree remote delete fedora-atomic -ostree remote add --set=gpg-verify=true --set=gpgkeypath=/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-29-primary fedora-atomic 'https://dl.fedoraproject.org/atomic/repo/' - -%end +%include fedora-atomic-updates-base.ks diff --git a/fedora-atomic-vagrant-testing.ks b/fedora-atomic-vagrant-testing.ks index 424f2d6..4211669 100644 --- a/fedora-atomic-vagrant-testing.ks +++ b/fedora-atomic-vagrant-testing.ks @@ -3,4 +3,4 @@ # refs (fedora/29/${basearch}/testing/atomic-host) for vagrant %include fedora-atomic-vagrant.ks -%include fedora-atomic-testing.ks +%include fedora-atomic-testing-base.ks diff --git a/fedora-atomic-vagrant-updates.ks b/fedora-atomic-vagrant-updates.ks index ec59138..0e821e8 100644 --- a/fedora-atomic-vagrant-updates.ks +++ b/fedora-atomic-vagrant-updates.ks @@ -3,4 +3,4 @@ # refs (fedora/29/${basearch}/updates/atomic-host) for vagrant %include fedora-atomic-vagrant.ks -%include fedora-atomic-updates.ks +%include fedora-atomic-updates-base.ks