Merge remote-tracking branch 'development-repo/development' into development

This commit is contained in:
Antony Messerli 2019-12-08 10:48:30 -06:00
commit 7c0dda0cb3
94 changed files with 4643 additions and 97 deletions

56
script/build_release Executable file
View file

@ -0,0 +1,56 @@
#!/bin/bash
set -e
TYPE=$1
# Set boot domain
if [[ "${TYPE}" == "dev" ]]; then
BOOT_DOMAIN="s3.amazonaws.com/${BUCKET_DEV}/${TRAVIS_COMMIT}"
elif [[ "${TYPE}" == "pr" ]]; then
BOOT_DOMAIN="test.com"
elif [[ "${TYPE}" == "rc" ]]; then
BOOT_DOMAIN="staging.boot.netboot.xyz/$(cat version.txt)-RC"
elif [[ "${TYPE}" == "release" ]]; then
BOOT_DOMAIN="staging.boot.netboot.xyz/$(cat version.txt)"
fi
sed -i \
"/^#boot_domain/c\boot_domain: ${BOOT_DOMAIN}" \
user_overrides.yml
# Build release
docker build -t localbuild -f Dockerfile-build .
docker run --rm -it -v $(pwd):/buildout localbuild
# Generate folder outputs
mkdir -p s3out
cp -r buildout/* s3out/
mkdir -p githubout
mv buildout/ipxe/* githubout/
cd buildout
rm -Rf ipxe
tar -czf menus.tar.gz *
mv menus.tar.gz ../githubout
cd ..
# Latest style endpoints for RC and Live
if [[ "${TYPE}" == "release" ]] || [[ "${TYPE}" == "rc" ]]; then
rm -Rf buildout/
if [[ "${TYPE}" == "release" ]]; then
sed -i \
"/^boot_domain/c\boot_domain: staging.boot.netboot.xyz" \
user_overrides.yml
docker build -t localbuild -f Dockerfile-build .
docker run --rm -it -v $(pwd):/buildout localbuild
fi
if [[ "${TYPE}" == "rc" ]]; then
sed -i \
"/^boot_domain/c\boot_domain: staging.boot.netboot.xyz/rc" \
user_overrides.yml
docker build -t localbuild -f Dockerfile-build .
docker run --rm -it -v $(pwd):/buildout localbuild
fi
mkdir -p s3out-latest
cp -r buildout/* s3out-latest/
fi

41
script/message Executable file
View file

@ -0,0 +1,41 @@
#!/bin/bash
TYPE=$1
if [ "${TYPE}" == "dev-push" ]; then
BOOT_URL="https://s3.amazonaws.com/${BUCKET_DEV}/${TRAVIS_COMMIT}/index.html"
elif [ "${TYPE}" == "rc-push" ]; then
BOOT_URL="https://staging.boot.netboot.xyz/$(cat version.txt)-RC/index.html"
elif [ "${TYPE}" == "live-push" ]; then
BOOT_URL="https://staging.boot.netboot.xyz/$(cat version.txt)/index.html"
fi
# send status to discord
if [ "${TYPE}" == "failure" ]; then
curl -X POST -H "Content-Type: application/json" --data \
'{
"avatar_url": "https://avatars.io/twitter/travisci",
"embeds": [
{
"color": 16711680,
"description": "__**Failed to Build**__ \n**Build:** '${TRAVIS_BUILD_WEB_URL}'\n**Status:** Failure\n**Change:** https://github.com/netbootxyz/netboot.xyz/commit/'${TRAVIS_COMMIT}'\n"
}
],
"username": "Travis CI"
}' \
${DISCORD_HOOK_URL}
else
curl -X POST -H "Content-Type: application/json" --data \
'{
"avatar_url": "https://avatars.io/twitter/travisci",
"embeds": [
{
"color": 1681177,
"description": "__**Boot Menu Published**__ \n**Files:** '${BOOT_URL}' \n**Build:** '${TRAVIS_BUILD_WEB_URL}'\n**Change:** https://github.com/netbootxyz/netboot.xyz/commit/'${TRAVIS_COMMIT}'\n"
}
],
"username": "Travis CI"
}' \
${DISCORD_HOOK_URL}
fi

4
script/pre_install Executable file
View file

@ -0,0 +1,4 @@
#!/bin/bash
# Install aws cli
sudo pip install awscli tornado