2016-05-06 17:12:09 +00:00
|
|
|
#!/bin/bash
|
2017-04-11 04:25:46 +00:00
|
|
|
#set -e
|
2015-02-09 04:38:37 +00:00
|
|
|
|
2016-11-24 01:35:27 +00:00
|
|
|
cd $(dirname $0)/..
|
|
|
|
|
2017-04-11 04:25:46 +00:00
|
|
|
echo BUILD
|
2016-11-24 01:35:27 +00:00
|
|
|
./scripts/build
|
2017-04-11 04:25:46 +00:00
|
|
|
echo TEST
|
2016-11-24 01:35:27 +00:00
|
|
|
./scripts/test
|
2017-04-11 04:25:46 +00:00
|
|
|
echo VALIDATE
|
2016-11-24 01:35:27 +00:00
|
|
|
./scripts/validate
|
2017-04-11 04:25:46 +00:00
|
|
|
echo PREPARE
|
2016-11-24 01:35:27 +00:00
|
|
|
./scripts/prepare
|
2017-04-11 04:25:46 +00:00
|
|
|
echo PACKAGE
|
2016-11-24 01:35:27 +00:00
|
|
|
./scripts/package
|
2017-04-11 04:25:46 +00:00
|
|
|
echo INTEGRATION-TEST
|
2016-11-24 01:35:27 +00:00
|
|
|
./scripts/integration-test
|
|
|
|
|
2017-04-12 05:53:06 +00:00
|
|
|
CHECKSUM="dist/checksums.txt"
|
|
|
|
rm -f $CHECKSUM
|
|
|
|
|
2017-04-12 02:00:06 +00:00
|
|
|
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
|
|
|
|
|
2016-11-24 01:35:27 +00:00
|
|
|
for file in $(ls dist/artifacts/); do
|
2017-04-12 05:53:06 +00:00
|
|
|
if [[ "$file" == *"installer.tar" ]]; then
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
if [[ "$file" == "Dockerfile"* ]]; then
|
|
|
|
continue
|
2017-04-12 02:00:06 +00:00
|
|
|
fi
|
2017-04-12 05:53:06 +00:00
|
|
|
|
|
|
|
echo "github-release upload --user rancher --repo os --tag ${VERSION} --file ./dist/artifacts/${file} --name ${file}" >> dist/publish.sh
|
2017-04-12 02:00:06 +00:00
|
|
|
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
|
2016-11-24 01:35:27 +00:00
|
|
|
fi
|
2017-04-12 05:53:06 +00:00
|
|
|
|
|
|
|
#checksums
|
|
|
|
pushd .
|
|
|
|
cd dist/artifacts
|
|
|
|
for algo in sha256 md5; do
|
|
|
|
echo "$algo: $(${algo}sum $file)" >> ../../$CHECKSUM
|
|
|
|
done
|
|
|
|
popd
|
2016-11-24 01:35:27 +00:00
|
|
|
done
|
2017-04-12 05:53:06 +00:00
|
|
|
echo "github-release upload --user rancher --repo os --tag ${VERSION} --file ${CHECKSUM} --name checksums.txt" >> dist/publish.sh
|
2016-11-24 01:35:27 +00:00
|
|
|
|
2017-04-12 02:00:06 +00:00
|
|
|
echo >> dist/publish.sh
|
|
|
|
|
|
|
|
cat dist/images | sed 's/^/docker push /' >> dist/publish.sh
|
|
|
|
|
|
|
|
echo "--- Run dist/publish.sh"
|
|
|
|
cat dist/publish.sh
|