Merge pull request #1141 from mozilla/fix_rabbit_pw

simplify deploy script and reduce code dup!
This commit is contained in:
Andrew J Krug 2019-03-20 15:46:52 -07:00 коммит произвёл GitHub
Родитель 7a828d685a 10dcd163b3
Коммит 90436ad45a
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 18 добавлений и 44 удалений

Просмотреть файл

@ -17,46 +17,20 @@ echo "Begin build / test of the MozDef codebase."
echo "Tests complete. Now reasoning about the webhook event."
if [[ "branch/master" == "$CODEBUILD_WEBHOOK_TRIGGER" ]]
then
echo "Building a release from the edge of master branch."
if [[ "branch/master" == "$CODEBUILD_WEBHOOK_TRIGGER" \
|| "$CODEBUILD_WEBHOOK_TRIGGER" =~ ^tag\/[0-9]\.[0-9]\.[0-9](\-(pre|testing))?$ \
|| "$CODEBUILD_WEBHOOK_TRIGGER" =~ ^tag\/[0-9]\.[0-9]\.[0-9](\-(prod))?$ \
|| "branch/march_swarm" == "$CODEBUILD_WEBHOOK_TRIGGER" ]]; then
echo "Building a release"
echo "C|_| This may take a bit. Might as well grab a coffee."
make build-from-cwd
make hub-login
cd cloudy_mozdef
make BRANCH=`echo $CODEBUILD_WEBHOOK_TRIGGER | cut -d '/' -f2` packer-build-github
cd ../ && make BRANCH=`echo $CODEBUILD_WEBHOOK_TRIGGER | cut -d '/' -f2` hub-tagged
elif [[ "$CODEBUILD_WEBHOOK_TRIGGER" =~ ^tag\/[0-9]\.[0-9]\.[0-9](\-(pre|testing))?$ ]]
then
echo "Building a release from a pre-release tag."
echo "C|_| This may take a bit. Might as well grab a coffee."
make build-from-cwd
make hub-login
cd cloudy_mozdef
make BRANCH=`echo $CODEBUILD_WEBHOOK_TRIGGER | cut -d '/' -f2` packer-build-github
cd ../ && make BRANCH=`echo $CODEBUILD_WEBHOOK_TRIGGER | cut -d '/' -f2` hub-tagged
elif [[ "$CODEBUILD_WEBHOOK_TRIGGER" =~ ^tag\/[0-9]\.[0-9]\.[0-9](\-(prod))?$ ]]
then
echo "echo Building a production release from a tag."
echo "C|_| This may take a bit. Might as well grab a coffee."
echo "Congrats on the release! --~~~=:>[XXXXXXXXX]>"
make build-from-cwd
make hub-login
cd cloudy_mozdef
make BRANCH=`echo $CODEBUILD_WEBHOOK_TRIGGER | cut -d '/' -f2` packer-build-github
cd ../ && make BRANCH=`echo $CODEBUILD_WEBHOOK_TRIGGER | cut -d '/' -f2` hub-tagged
# Temporary inclusion for march swarm. Remove after march 23 2019
elif [[ "branch/march_swarm" == "$CODEBUILD_WEBHOOK_TRIGGER" ]]
then
echo "Building a release from the march_swarm branch."
echo "C|_| This may take a bit. Might as well grab a coffee."
make build-from-cwd
make hub-login
cd cloudy_mozdef
make BRANCH=`echo $CODEBUILD_WEBHOOK_TRIGGER | cut -d '/' -f2` packer-build-github
cd ../ && make BRANCH=`echo $CODEBUILD_WEBHOOK_TRIGGER | cut -d '/' -f2` hub-tagged
BRANCH="`echo $CODEBUILD_WEBHOOK_TRIGGER | cut -d '/' -f2`"
make BRANCH=${BRANCH} packer-build-github
make publish-versioned-templates
cd ../ && make BRANCH={{ user `github_branch`}} set-version-and-fetch-docker-container
cd ../ && make BRANCH=${BRANCH} hub-tagged
fi
echo "End build / test of the MozDef codebase."