Add support to build and deploy postorius containers. (#251)
* Add support to build and deploy postorius containers. - Also, simplify the deployment script. * Use curly braces instead of round.
This commit is contained in:
@@ -1,12 +1,18 @@
|
||||
#! /bin/bash
|
||||
|
||||
deploy() {
|
||||
REG_URL=${REGISTRY}_URL
|
||||
REG_USER=${REGISTRY}_USER
|
||||
REG_PASS=${REGISTRY}_PASS
|
||||
docker login -u ${!REG_USER} -p ${!REG_PASS} ${!REG_URL}
|
||||
docker push ${!REG_URL}/maxking/mailman-web
|
||||
docker push ${!REG_URL}/maxking/mailman-core
|
||||
USER=maxking
|
||||
|
||||
|
||||
deploy(URL, TAG, PASSWORD) {
|
||||
# Tag the containers correctly.
|
||||
docker tag maxking/mailman-core "$URL/maxking/mailman-core:$TAG"
|
||||
docker tag maxking/mailman-web "$URL/maxking/mailman-web:$TAG"
|
||||
docker tag maxking/postorius "$URL/maxking/postorius:$TAG"
|
||||
# Login to the registry and push.
|
||||
docker login -u $USER -p ${!PASSWORD} $URL
|
||||
docker push "$URL/maxking/mailman-web:$TAG"
|
||||
docker push "$URL/maxking/mailman-core:$TAG"
|
||||
docker push "$URL/maxking/postorius:$TAG"
|
||||
}
|
||||
|
||||
if [ ! "$BRANCH" = "master" ] && [ "$PULL_REQUEST" ]; then
|
||||
@@ -14,4 +20,5 @@ if [ ! "$BRANCH" = "master" ] && [ "$PULL_REQUEST" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
deploy
|
||||
deploy "quay.io" "rolling" $DOCKER_PASSWORD
|
||||
deploy "docker.io" "rolling" $QUAY_PASSWORD
|
||||
|
||||
13
build.sh
13
build.sh
@@ -11,7 +11,7 @@ fi
|
||||
|
||||
REG_URL=${REGISTRY}_URL
|
||||
|
||||
if [ "$EVENT_TYPE" = "cron" ] || [ "$DEV" = "true" ] ; then
|
||||
if [ "$EVENT_TYPE" = "cron" ] || [ "$DEV" = "true" ]; then
|
||||
python3 -m venv venv
|
||||
source venv/bin/activate
|
||||
pip install python-gitlab
|
||||
@@ -45,8 +45,19 @@ if [ "$EVENT_TYPE" = "cron" ] || [ "$DEV" = "true" ] ; then
|
||||
--build-arg HYPERKITTY_REF=$HYPERKITTY_REF \
|
||||
--build-arg DJ_MM3_REF=$DJ_MM3_REF \
|
||||
-t ${!REG_URL}/maxking/mailman-web:rolling web/
|
||||
|
||||
$DOCKER build -f postorius/Dockerfile.dev\
|
||||
--label version.git_commit="$COMMIT_ID"\
|
||||
--label version.postorius="$POSTORIUS_REF" \
|
||||
--label version.client="$CLIENT_REF" \
|
||||
--label version.dj-mm3="$DJ_MM3_REF" \
|
||||
--build-arg POSTORIUS_REF=$POSTORIUS_REF \
|
||||
--build-arg CLIENT_REF=$CLIENT_REF \
|
||||
--build-arg DJ_MM3_REF=$DJ_MM3_REF \
|
||||
-t ${!REG_URL}/maxking/postorius:rolling postorius/
|
||||
else
|
||||
# Do the normal building process.
|
||||
$DOCKER build -t ${!REG_URL}/maxking/mailman-core:$TAG core/
|
||||
$DOCKER build -t ${!REG_URL}/maxking/mailman-web:$TAG web/
|
||||
$DOCKER build -t ${!REG_URL}/maxking/postorius:$TAG postorius/
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user