mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-12 23:35:58 +00:00
Push all docker images at VERSION to dockerhub
Inspired by the tagging of e.g. `node` on dockerhub: https://hub.docker.com/_/node/?tab=description I would like to push the current version of all our images to dockerhub. This is a first step to push to production later on. If sb. increments the VERSION file, this is considered a release.
This commit is contained in:
parent
23d17d7b44
commit
7f2cd575cb
@ -6,6 +6,8 @@ services:
|
|||||||
build:
|
build:
|
||||||
context: webapp
|
context: webapp
|
||||||
target: production
|
target: production
|
||||||
|
args:
|
||||||
|
- "BUILD_COMMIT=${TRAVIS_COMMIT}"
|
||||||
ports:
|
ports:
|
||||||
- 3000:3000
|
- 3000:3000
|
||||||
networks:
|
networks:
|
||||||
@ -23,6 +25,8 @@ services:
|
|||||||
build:
|
build:
|
||||||
context: backend
|
context: backend
|
||||||
target: production
|
target: production
|
||||||
|
args:
|
||||||
|
- "BUILD_COMMIT=${TRAVIS_COMMIT}"
|
||||||
networks:
|
networks:
|
||||||
- hc-network
|
- hc-network
|
||||||
depends_on:
|
depends_on:
|
||||||
@ -45,6 +49,8 @@ services:
|
|||||||
image: humanconnection/neo4j:latest
|
image: humanconnection/neo4j:latest
|
||||||
build:
|
build:
|
||||||
context: neo4j
|
context: neo4j
|
||||||
|
args:
|
||||||
|
- "BUILD_COMMIT=${TRAVIS_COMMIT}"
|
||||||
networks:
|
networks:
|
||||||
- hc-network
|
- hc-network
|
||||||
environment:
|
environment:
|
||||||
|
|||||||
@ -1,12 +1,32 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
ROOT_DIR=$(dirname "$0")
|
||||||
|
DOCKER_CLI_EXPERIMENTAL=enabled
|
||||||
|
# BUILD_COMMIT=${TRAVIS_COMMIT:-$(git rev-parse HEAD)}
|
||||||
|
|
||||||
|
IFS='.' read -r major minor patch < $ROOT_DIR/../VERSION
|
||||||
|
apps=(nitro-web nitro-backend neo4j maintenance-worker maintenance)
|
||||||
|
tags=(latest $major $major.$minor $major.$minor.$patch)
|
||||||
|
|
||||||
|
# These three docker images have already been built by now:
|
||||||
|
# docker build --build-arg BUILD_COMMIT=$BUILD_COMMIT --target production -t humanconnection/nitro-backend:latest $ROOT_DIR/backend
|
||||||
|
# docker build --build-arg BUILD_COMMIT=$BUILD_COMMIT --target production -t humanconnection/nitro-web:latest $ROOT_DIR/webapp
|
||||||
|
# docker build --build-arg BUILD_COMMIT=$BUILD_COMMIT -t humanconnection/neo4j:latest $ROOT_DIR/neo4j
|
||||||
|
docker build -t humanconnection/maintenance-worker:latest $ROOT_DIR/deployment/legacy-migration/maintenance-worker
|
||||||
|
docker build -t humanconnection/maintenance:latest $ROOT_DIR/webapp/ -f $ROOT_DIR/webapp/Dockerfile.maintenance
|
||||||
|
|
||||||
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
|
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
|
||||||
docker build --build-arg BUILD_COMMIT=$TRAVIS_COMMIT --target production -t humanconnection/nitro-backend:latest $TRAVIS_BUILD_DIR/backend
|
|
||||||
docker build --build-arg BUILD_COMMIT=$TRAVIS_COMMIT --target production -t humanconnection/nitro-web:latest $TRAVIS_BUILD_DIR/webapp
|
for app in "${apps[@]}"
|
||||||
docker build --build-arg BUILD_COMMIT=$TRAVIS_COMMIT -t humanconnection/neo4j:latest $TRAVIS_BUILD_DIR/neo4j
|
do
|
||||||
docker build -t humanconnection/maintenance-worker:latest $TRAVIS_BUILD_DIR/deployment/legacy-migration/maintenance-worker
|
for tag in "${tags[@]}"
|
||||||
docker build -t humanconnection/maintenance:latest $TRAVIS_BUILD_DIR/webapp/ -f $TRAVIS_BUILD_DIR/webapp/Dockerfile.maintenance
|
do
|
||||||
docker push humanconnection/nitro-backend:latest
|
SOURCE="humanconnection/${app}:latest"
|
||||||
docker push humanconnection/nitro-web:latest
|
TARGET="humanconnection/${app}:${tag}"
|
||||||
docker push humanconnection/neo4j:latest
|
if docker manifest inspect $TARGET &> /dev/null; then
|
||||||
docker push humanconnection/maintenance-worker:latest
|
echo "Docker image ${TARGET} already present, skipping ..."
|
||||||
docker push humanconnection/maintenance:latest
|
else
|
||||||
|
docker tag $SOURCE $TARGET
|
||||||
|
docker push tag
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
done
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user