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
|
#! /bin/bash
|
||||||
|
|
||||||
deploy() {
|
USER=maxking
|
||||||
REG_URL=${REGISTRY}_URL
|
|
||||||
REG_USER=${REGISTRY}_USER
|
|
||||||
REG_PASS=${REGISTRY}_PASS
|
deploy(URL, TAG, PASSWORD) {
|
||||||
docker login -u ${!REG_USER} -p ${!REG_PASS} ${!REG_URL}
|
# Tag the containers correctly.
|
||||||
docker push ${!REG_URL}/maxking/mailman-web
|
docker tag maxking/mailman-core "$URL/maxking/mailman-core:$TAG"
|
||||||
docker push ${!REG_URL}/maxking/mailman-core
|
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
|
if [ ! "$BRANCH" = "master" ] && [ "$PULL_REQUEST" ]; then
|
||||||
@@ -14,4 +20,5 @@ if [ ! "$BRANCH" = "master" ] && [ "$PULL_REQUEST" ]; then
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
deploy
|
deploy "quay.io" "rolling" $DOCKER_PASSWORD
|
||||||
|
deploy "docker.io" "rolling" $QUAY_PASSWORD
|
||||||
|
|||||||
83
build.sh
83
build.sh
@@ -6,47 +6,58 @@ DOCKER=docker
|
|||||||
|
|
||||||
# Set the env variable to later test this release before it is deployed.
|
# Set the env variable to later test this release before it is deployed.
|
||||||
if [ "$1" = "dev" ]; then
|
if [ "$1" = "dev" ]; then
|
||||||
export DEV=true
|
export DEV=true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
REG_URL=${REGISTRY}_URL
|
REG_URL=${REGISTRY}_URL
|
||||||
|
|
||||||
if [ "$EVENT_TYPE" = "cron" ] || [ "$DEV" = "true" ] ; then
|
if [ "$EVENT_TYPE" = "cron" ] || [ "$DEV" = "true" ]; then
|
||||||
python3 -m venv venv
|
python3 -m venv venv
|
||||||
source venv/bin/activate
|
source venv/bin/activate
|
||||||
pip install python-gitlab
|
pip install python-gitlab
|
||||||
# Get the latest commit for repositories and set their reference values to be
|
# Get the latest commit for repositories and set their reference values to be
|
||||||
# used in the development builds.
|
# used in the development builds.
|
||||||
CORE_REF=$(python get_latest_ref.py mailman/mailman)
|
CORE_REF=$(python get_latest_ref.py mailman/mailman)
|
||||||
CLIENT_REF=$(python get_latest_ref.py mailman/mailmanclient)
|
CLIENT_REF=$(python get_latest_ref.py mailman/mailmanclient)
|
||||||
POSTORIUS_REF=$(python get_latest_ref.py mailman/postorius)
|
POSTORIUS_REF=$(python get_latest_ref.py mailman/postorius)
|
||||||
HYPERKITTY_REF=$(python get_latest_ref.py mailman/hyperkitty)
|
HYPERKITTY_REF=$(python get_latest_ref.py mailman/hyperkitty)
|
||||||
DJ_MM3_REF=$(python get_latest_ref.py mailman/django-mailman3)
|
DJ_MM3_REF=$(python get_latest_ref.py mailman/django-mailman3)
|
||||||
MM3_HK_REF=$(python get_latest_ref.py mailman/mailman-hyperkitty)
|
MM3_HK_REF=$(python get_latest_ref.py mailman/mailman-hyperkitty)
|
||||||
|
|
||||||
# Build the mailman-core image.
|
# Build the mailman-core image.
|
||||||
$DOCKER build -f core/Dockerfile.dev \
|
$DOCKER build -f core/Dockerfile.dev \
|
||||||
--build-arg CORE_REF=$CORE_REF \
|
--build-arg CORE_REF=$CORE_REF \
|
||||||
--build-arg MM3_HK_REF=$MM3_HK_REF \
|
--build-arg MM3_HK_REF=$MM3_HK_REF \
|
||||||
--label version.core="$CORE_REF" \
|
--label version.core="$CORE_REF" \
|
||||||
--label version.mm3-hk="$MM3_HK_REF" \
|
--label version.mm3-hk="$MM3_HK_REF" \
|
||||||
--label version.git_commit="$COMMIT_ID" \
|
--label version.git_commit="$COMMIT_ID" \
|
||||||
-t ${!REG_URL}/maxking/mailman-core:rolling core/
|
-t ${!REG_URL}/maxking/mailman-core:rolling core/
|
||||||
|
|
||||||
# Build the mailman-web image.
|
# Build the mailman-web image.
|
||||||
$DOCKER build -f web/Dockerfile.dev \
|
$DOCKER build -f web/Dockerfile.dev \
|
||||||
--label version.git_commit="$COMMIT_ID" \
|
--label version.git_commit="$COMMIT_ID" \
|
||||||
--label version.postorius="$POSTORIUS_REF" \
|
--label version.postorius="$POSTORIUS_REF" \
|
||||||
--label version.hyperkitty="$HYPERKITTY_REF" \
|
--label version.hyperkitty="$HYPERKITTY_REF" \
|
||||||
--label version.client="$CLIENT_REF" \
|
--label version.client="$CLIENT_REF" \
|
||||||
--label version.dj-mm3="$DJ_MM3_REF" \
|
--label version.dj-mm3="$DJ_MM3_REF" \
|
||||||
--build-arg POSTORIUS_REF=$POSTORIUS_REF \
|
--build-arg POSTORIUS_REF=$POSTORIUS_REF \
|
||||||
--build-arg CLIENT_REF=$CLIENT_REF \
|
--build-arg CLIENT_REF=$CLIENT_REF \
|
||||||
--build-arg HYPERKITTY_REF=$HYPERKITTY_REF \
|
--build-arg HYPERKITTY_REF=$HYPERKITTY_REF \
|
||||||
--build-arg DJ_MM3_REF=$DJ_MM3_REF \
|
--build-arg DJ_MM3_REF=$DJ_MM3_REF \
|
||||||
-t ${!REG_URL}/maxking/mailman-web:rolling web/
|
-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
|
else
|
||||||
# Do the normal building process.
|
# Do the normal building process.
|
||||||
$DOCKER build -t ${!REG_URL}/maxking/mailman-core:$TAG core/
|
$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/mailman-web:$TAG web/
|
||||||
|
$DOCKER build -t ${!REG_URL}/maxking/postorius:$TAG postorius/
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user