updated docker files - removed todo

remove `docker_push.sh` script
This commit is contained in:
Ulf Gebhardt 2021-02-08 20:54:26 +01:00
parent 1d282646e7
commit 737c5fc53a
No known key found for this signature in database
GPG Key ID: 81308EFE29ABFEBD
3 changed files with 4 additions and 41 deletions

View File

@ -6,9 +6,8 @@ FROM neo4j:3.5.14 as community
# ENVs (available in production aswell, can be overwritten by commandline or env file) # ENVs (available in production aswell, can be overwritten by commandline or env file)
## We Cannot do `$(date -u +'%Y-%m-%dT%H:%M:%SZ')` here so we use unix timestamp=0 ## We Cannot do `$(date -u +'%Y-%m-%dT%H:%M:%SZ')` here so we use unix timestamp=0
ENV BUILD_DATE="1970-01-01T00:00:00.00Z" ENV BUILD_DATE="1970-01-01T00:00:00.00Z"
## We cannot do $(yarn run version) here so we default to 0.0.0 ## We cannot do $(yarn run version).${BUILD_NUMBER} here so we default to 0.0.0.0
## TODO: Missing Build number - do that once we have a CI which actually generates it ENV BUILD_VERSION="0.0.0.0"
ENV BUILD_VERSION="0.0.0"
## We cannot do `$(git rev-parse --short HEAD)` here so we default to 0000000 ## We cannot do `$(git rev-parse --short HEAD)` here so we default to 0000000
ENV BUILD_COMMIT="0000000" ENV BUILD_COMMIT="0000000"

View File

@ -1,35 +0,0 @@
#!/usr/bin/env bash
ROOT_DIR=$(dirname "$0")/..
# BUILD_COMMIT=${TRAVIS_COMMIT:-$(git rev-parse HEAD)}
VERSION=$(jq -r '.version' $ROOT_DIR/package.json)
IFS='.' read -r major minor patch <<< $VERSION
apps=(webapp backend neo4j maintenance)
tags=($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 ocelotsocialnetwork/backend:latest $ROOT_DIR/backend
# docker build --build-arg BUILD_COMMIT=$BUILD_COMMIT --target production -t ocelotsocialnetwork/webapp:latest $ROOT_DIR/webapp
# docker build --build-arg BUILD_COMMIT=$BUILD_COMMIT -t ocelotsocialnetwork/neo4j:latest $ROOT_DIR/neo4j
# docker build -t ocelotsocialnetwork/maintenance:latest $ROOT_DIR/webapp/ -f $ROOT_DIR/webapp/Dockerfile.maintenance
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
for app in "${apps[@]}"
do
SOURCE="ocelotsocialnetwork/${app}:latest"
echo "docker push $SOURCE"
docker push $SOURCE
for tag in "${tags[@]}"
do
TARGET="ocelotsocialnetwork/${app}:${tag}"
if DOCKER_CLI_EXPERIMENTAL=enabled docker manifest inspect $TARGET >/dev/null; then
echo "docker image ${TARGET} already present, skipping ..."
else
echo -e "docker tag $SOURCE $TARGET\ndocker push $TARGET"
docker tag $SOURCE $TARGET
docker push $TARGET
fi
done
done

View File

@ -8,9 +8,8 @@ FROM node:12.19.0-alpine3.10 as base
ENV DOCKER_WORKDIR="/app" ENV DOCKER_WORKDIR="/app"
## We Cannot do `$(date -u +'%Y-%m-%dT%H:%M:%SZ')` here so we use unix timestamp=0 ## We Cannot do `$(date -u +'%Y-%m-%dT%H:%M:%SZ')` here so we use unix timestamp=0
ENV BUILD_DATE="1970-01-01T00:00:00.00Z" ENV BUILD_DATE="1970-01-01T00:00:00.00Z"
## We cannot do $(yarn run version) here so we default to 0.0.0 ## We cannot do $(yarn run version).${BUILD_NUMBER} here so we default to 0.0.0.0
## TODO: Missing Build number - do that once we have a CI which actually generates it ENV BUILD_VERSION="0.0.0.0"
ENV BUILD_VERSION="0.0.0"
## We cannot do `$(git rev-parse --short HEAD)` here so we default to 0000000 ## We cannot do `$(git rev-parse --short HEAD)` here so we default to 0000000
ENV BUILD_COMMIT="0000000" ENV BUILD_COMMIT="0000000"
## SET NODE_ENV ## SET NODE_ENV