diff --git a/scripts/checksums b/scripts/checksums new file mode 100755 index 00000000..6f7565d9 --- /dev/null +++ b/scripts/checksums @@ -0,0 +1,43 @@ +#!/bin/bash +set -ex + +cd $(dirname $0)/.. + +source ./scripts/version + +CHECKSUM="dist/checksums.txt" +rm -f $CHECKSUM + +FILELIST=" +initrd +rancheros.ipxe +rancheros.iso +rootfs.tar.gz +vmlinuz +rancheros-aliyun.vhd +rancheros-cloudstack.img +rancheros-digitalocean.img +rancheros-openstack.img +rancheros-gce.tar.gz +rancheros-raspberry-pi64.zip +rancheros-4glte.iso +rancheros-hyperv.iso +rancheros-proxmoxve.iso +rancheros-proxmoxve-autoformat.iso +rancheros-vmware.iso +rancheros-vmware-autoformat.iso +" + +rm -rf dist/checksums && mkdir -p dist/checksums +pushd dist/checksums +for file in $FILELIST; do + curl -sSL -o $file https://github.com/rancher/os/releases/download/$VERSION/$file + for algo in sha256 md5; do + echo "$algo: $(${algo}sum $file)" >> ../../$CHECKSUM + done +done +popd + +echo "github-release upload --user rancher --repo os --tag ${VERSION} --file $CHECKSUM --name checksums.txt" +echo "gsutil cp $CHECKSUM gs://releases.rancher.com/os/latest/checksums.txt" +echo "gsutil cp $CHECKSUM gs://releases.rancher.com/os/$VERSION/checksums.txt" diff --git a/scripts/package-iso b/scripts/package-iso index ecfc28ea..7856f08a 100755 --- a/scripts/package-iso +++ b/scripts/package-iso @@ -9,7 +9,6 @@ ARTIFACTS=$(pwd)/dist/artifacts CD=${BUILD}/cd rm -rf ${CD}/ ISO=${ARTIFACTS}/$(echo ${DISTRIB_ID} | tr '[:upper:]' '[:lower:]').iso -CHECKSUM=iso-checksums.txt mkdir -p ${CD}/boot/isolinux mkdir -p ${CD}/rancheros @@ -42,7 +41,3 @@ cd ${CD} && xorriso \ -o $ISO ${CD} cd $(dirname $ISO) -rm -f $CHECKSUM -for algo in sha256 md5; do - echo "$algo: $(${algo}sum $(basename $ISO))" >> $CHECKSUM -done diff --git a/scripts/release-4glte b/scripts/release-4glte index a88bd0f1..780fe853 100755 --- a/scripts/release-4glte +++ b/scripts/release-4glte @@ -8,8 +8,8 @@ touch .make-4glte source ./scripts/version ./scripts/release-build -touch dist/publish_gss_${VERSION}.sh dist/publish_gss_latest.sh -chmod 755 dist/publish_gss_${VERSION}.sh dist/publish_gss_latest.sh +touch dist/publish.sh dist/publish_gss_${VERSION}.sh dist/publish_gss_latest.sh +chmod 755 dist/publish.sh dist/publish_gss_${VERSION}.sh dist/publish_gss_latest.sh for file in $(ls dist/artifacts/); do case $file in @@ -22,4 +22,6 @@ for file in $(ls dist/artifacts/); do echo "gsutil cp dist/artifacts/${file} gs://releases.rancher.com/os/${VERSION}/4glte/${file}" >> ./dist/publish_gss_${VERSION}.sh ;; esac -done \ No newline at end of file +done + +echo "github-release upload --user rancher --repo os --tag ${VERSION} --file dist/artifacts/rancheros.iso --name rancheros-4glte.iso" > dist/publish.sh diff --git a/scripts/release-amd64 b/scripts/release-amd64 index 7622f3a4..364942b8 100755 --- a/scripts/release-amd64 +++ b/scripts/release-amd64 @@ -6,9 +6,6 @@ cd $(dirname $0)/.. source ./scripts/version ./scripts/release-build -CHECKSUM="dist/checksums.txt" -rm -f $CHECKSUM - cat scripts/hosting/rancheros.ipxe | sed "s/latest/${VERSION}/g" > dist/artifacts/rancheros.ipxe echo "github-release release --user rancher --repo os --tag ${VERSION} --pre-release --draft" > dist/publish.sh @@ -38,17 +35,7 @@ for file in $(ls dist/artifacts/); do ;; esac - #checksums - pushd . - cd dist/artifacts - for algo in sha256 md5; do - echo "$algo: $(${algo}sum $file)" >> ../../$CHECKSUM - done - popd done -echo "github-release upload --user rancher --repo os --tag ${VERSION} --file dist/release.log --name release.log" >> dist/publish.sh - -echo "github-release upload --user rancher --repo os --tag ${VERSION} --file ${CHECKSUM} --name checksums.txt" >> dist/publish.sh echo >> dist/publish.sh diff --git a/scripts/release-hyperv b/scripts/release-hyperv index 4ced62e7..acc36340 100755 --- a/scripts/release-hyperv +++ b/scripts/release-hyperv @@ -8,8 +8,8 @@ touch .make-hyperv source ./scripts/version ./scripts/release-build -touch dist/publish_gss_${VERSION}.sh dist/publish_gss_latest.sh -chmod 755 dist/publish_gss_${VERSION}.sh dist/publish_gss_latest.sh +touch dist/publish.sh dist/publish_gss_${VERSION}.sh dist/publish_gss_latest.sh +chmod 755 dist/publish.sh dist/publish_gss_${VERSION}.sh dist/publish_gss_latest.sh for file in $(ls dist/artifacts/); do case $file in @@ -23,3 +23,5 @@ for file in $(ls dist/artifacts/); do ;; esac done + +echo "github-release upload --user rancher --repo os --tag ${VERSION} --file dist/artifacts/rancheros.iso --name rancheros-hyperv.iso" > dist/publish.sh diff --git a/scripts/release-proxmoxve b/scripts/release-proxmoxve index b566230e..3238feb2 100755 --- a/scripts/release-proxmoxve +++ b/scripts/release-proxmoxve @@ -8,12 +8,13 @@ touch .make-proxmoxve source ./scripts/version ./scripts/release-build -touch dist/publish_gss_${VERSION}.sh dist/publish_gss_latest.sh -chmod 755 dist/publish_gss_${VERSION}.sh dist/publish_gss_latest.sh +touch dist/publish.sh dist/publish_gss_${VERSION}.sh dist/publish_gss_latest.sh +chmod 755 dist/publish.sh dist/publish_gss_${VERSION}.sh dist/publish_gss_latest.sh if [ "$OS_AUTOFORMAT" = "true" ]; then echo "gsutil cp dist/artifacts/rancheros.iso gs://releases.rancher.com/os/latest/proxmoxve/rancheros-autoformat.iso" >> ./dist/publish_gss_latest.sh echo "gsutil cp dist/artifacts/rancheros.iso gs://releases.rancher.com/os/${VERSION}/proxmoxve/rancheros-autoformat.iso" >> ./dist/publish_gss_${VERSION}.sh + echo "github-release upload --user rancher --repo os --tag ${VERSION} --file dist/artifacts/rancheros.iso --name rancheros-proxmoxve-autoformat.iso" > dist/publish.sh exit 0 fi @@ -29,3 +30,5 @@ for file in $(ls dist/artifacts/); do ;; esac done + +echo "github-release upload --user rancher --repo os --tag ${VERSION} --file dist/artifacts/rancheros.iso --name rancheros-proxmoxve.iso" > dist/publish.sh diff --git a/scripts/release-rpi64 b/scripts/release-rpi64 index 0d6a72f9..38bafb21 100755 --- a/scripts/release-rpi64 +++ b/scripts/release-rpi64 @@ -17,8 +17,9 @@ popd cp ./scripts/images/raspberry-pi-hypriot64/dist/rancheros-raspberry-pi64.zip ./dist/artifacts/ -touch dist/publish_gss_${VERSION}.sh dist/publish_gss_latest.sh -chmod 755 dist/publish_gss_${VERSION}.sh dist/publish_gss_latest.sh +touch dist/publish.sh dist/publish_gss_${VERSION}.sh dist/publish_gss_latest.sh +chmod 755 dist/publish.sh dist/publish_gss_${VERSION}.sh dist/publish_gss_latest.sh echo "gsutil cp dist/artifacts/rancheros-raspberry-pi64.zip gs://releases.rancher.com/os/latest/arm64/rancheros-raspberry-pi64.zip" >> ./dist/publish_gss_latest.sh echo "gsutil cp dist/artifacts/rancheros-raspberry-pi64.zip gs://releases.rancher.com/os/${VERSION}/arm64/rancheros-raspberry-pi64.zip" >> ./dist/publish_gss_${VERSION}.sh +echo "github-release upload --user rancher --repo os --tag ${VERSION} --file dist/artifacts/rancheros-raspberry-pi64.zip --name rancheros-raspberry-pi64.zip" > dist/publish.sh diff --git a/scripts/release-vmware b/scripts/release-vmware index c90815fe..78e9fb8d 100755 --- a/scripts/release-vmware +++ b/scripts/release-vmware @@ -8,14 +8,16 @@ touch .make-vmware source ./scripts/version ./scripts/release-build -touch dist/publish_gss_${VERSION}.sh dist/publish_gss_latest.sh -chmod 755 dist/publish_gss_${VERSION}.sh dist/publish_gss_latest.sh +touch dist/publish.sh dist/publish_gss_${VERSION}.sh dist/publish_gss_latest.sh +chmod 755 dist/publish.sh dist/publish_gss_${VERSION}.sh dist/publish_gss_latest.sh if [ "$OS_AUTOFORMAT" = "true" ]; then echo "gsutil cp dist/artifacts/rancheros.iso gs://releases.rancher.com/os/latest/vmware/rancheros-autoformat.iso" >> ./dist/publish_gss_latest.sh echo "gsutil cp dist/artifacts/rancheros.iso gs://releases.rancher.com/os/${VERSION}/vmware/rancheros-autoformat.iso" >> ./dist/publish_gss_${VERSION}.sh + # In order to be compatible with early links, like /latest/rancheros-vmware.iso, I have to do this. echo "gsutil cp dist/artifacts/rancheros.iso gs://releases.rancher.com/os/latest/rancheros-vmware.iso" >> ./dist/publish_gss_latest.sh echo "gsutil cp dist/artifacts/rancheros.iso gs://releases.rancher.com/os/${VERSION}/rancheros-vmware.iso" >> ./dist/publish_gss_${VERSION}.sh + echo "github-release upload --user rancher --repo os --tag ${VERSION} --file dist/artifacts/rancheros.iso --name rancheros-vmware-autoformat.iso" > dist/publish.sh exit 0 fi @@ -68,3 +70,5 @@ for file in $(ls dist/artifacts/); do ;; esac done + +echo "github-release upload --user rancher --repo os --tag ${VERSION} --file dist/artifacts/rancheros.iso --name rancheros-vmware.iso" > dist/publish.sh