2016-05-06 17:12:09 +00:00
|
|
|
#!/bin/bash
|
2017-07-17 12:46:42 +00:00
|
|
|
set -ex
|
2016-05-06 17:12:09 +00:00
|
|
|
|
2017-04-13 12:36:20 +00:00
|
|
|
cd $(dirname $0)/..
|
|
|
|
source ./scripts/version
|
2016-05-23 06:51:46 +00:00
|
|
|
export REPO_VERSION=$VERSION
|
2016-08-19 01:14:24 +00:00
|
|
|
export COMPRESS="xz --format=lzma -9 --memlimit-compress=80% -e"
|
2016-05-23 06:51:46 +00:00
|
|
|
|
2017-04-13 12:36:20 +00:00
|
|
|
./scripts/ci
|
2016-12-13 07:09:49 +00:00
|
|
|
|
2017-07-10 05:45:31 +00:00
|
|
|
# from scripts/ci
|
|
|
|
echo PREPARE
|
|
|
|
./scripts/prepare
|
|
|
|
echo PACKAGE
|
|
|
|
./scripts/package
|
2017-08-29 04:13:57 +00:00
|
|
|
|
|
|
|
if [[ "$INTEGRATION_TESTS" != "" ]]; then
|
|
|
|
if [[ "$ARCH" == "" || "$ARCH" == "amd64" ]]; then
|
|
|
|
export INTEGRATION_TESTS=1
|
|
|
|
else
|
|
|
|
export INTEGRATION_TESTS=0
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if [[ "$INTEGRATION_TESTS" != "1" ]]; then
|
2017-07-21 01:15:14 +00:00
|
|
|
echo INTEGRATION-TEST
|
|
|
|
./scripts/integration-test
|
|
|
|
else
|
|
|
|
echo "Skipping integration tests"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ "$ARCH" == "" || "$ARCH" == "amd64" ]]; then
|
|
|
|
# make generated changelog
|
|
|
|
lastrelease=$(hub release | grep -v rc | head -n1 | tr -d ' \r\n')
|
|
|
|
git log --format="%s: %b" ${lastrelease}..${VERSION} | grep "Merge pull" | sed 's/.*\(#.*\) from .*:\(.*\)/* \1: \2/g' > dist/artifacts/changelog.txt
|
|
|
|
fi
|
2017-04-13 12:22:39 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
chmod 755 dist/publish.sh
|
|
|
|
|
|
|
|
for file in $(ls dist/artifacts/); do
|
|
|
|
if [[ "$file" == *"installer.tar" ]]; then
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
if [[ "$file" == "Dockerfile"* ]]; then
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "github-release upload --user rancher --repo os --tag ${VERSION} --file ./dist/artifacts/${file} --name ${file}" >> dist/publish.sh
|
|
|
|
if [[ "$file" == "initrd-"* ]]; then
|
|
|
|
echo "github-release upload --user rancher --repo os --tag ${VERSION} --file ./dist/artifacts/${file} --name initrd" >> dist/publish.sh
|
|
|
|
fi
|
|
|
|
if [[ "$file" == "vmlinuz-"* ]]; then
|
|
|
|
echo "github-release upload --user rancher --repo os --tag ${VERSION} --file ./dist/artifacts/${file} --name vmlinuz" >> dist/publish.sh
|
|
|
|
fi
|
|
|
|
|
|
|
|
#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
|
|
|
|
|
|
|
|
# openstack image is made later atm
|
|
|
|
#echo "github-release upload --user rancher --repo os --tag ${VERSION} --file dist/rancheros-openstack.img --name rancheros-openstack.img" >> dist/publish.sh
|
|
|
|
#pushd .
|
|
|
|
#cd dist
|
|
|
|
#for algo in sha256 md5; do
|
|
|
|
# echo "$algo: $(${algo}sum rancheros-openstack.img)" >> ../../$CHECKSUM
|
|
|
|
#done
|
|
|
|
#popd
|
|
|
|
|
|
|
|
echo "github-release upload --user rancher --repo os --tag ${VERSION} --file ${CHECKSUM} --name checksums.txt" >> dist/publish.sh
|
|
|
|
echo "github-release upload --user rancher --repo os --tag ${VERSION} --file dist/artifacts/changelog.txt --name changelog.txt" >> dist/publish.sh
|
|
|
|
|
|
|
|
echo >> dist/publish.sh
|
|
|
|
|
|
|
|
cat dist/images | sed 's/^/docker push /' >> dist/publish.sh
|
|
|
|
|
|
|
|
echo "--- Run dist/publish.sh"
|
|
|
|
cat dist/publish.sh
|
2017-12-12 07:03:02 +00:00
|
|
|
|
|
|
|
# create scripts about uploading to google storage
|
|
|
|
cp dist/artifacts/initrd-${VERSION} dist/artifacts/initrd
|
|
|
|
cp dist/artifacts/vmlinuz-${KERNEL_VERSION} dist/artifacts/vmlinuz
|
|
|
|
echo "gsutil cp dist/artifacts/* gs://releases.rancher.com/os/latest" > ./dist/publish_gs.sh
|
|
|
|
echo "gsutil cp dist/artifacts/* gs://releases.rancher.com/os/${VERSION}" >> ./dist/publish_gs.sh
|
|
|
|
chmod 755 ./dist/publish_gs.sh
|
|
|
|
echo "--- Run dist/publish_gs.sh"
|
|
|
|
cat dist/publish_gs.sh
|