Skip to content
Snippets Groups Projects
Commit 93a2e104 authored by Martin Weise's avatar Martin Weise
Browse files

manually release instead of ci/cd

Former-commit-id: 99faae22
parent 03cc8e06
No related branches found
No related tags found
Loading
#!/bin/bash
USER="fairdataaustria"
VERSION=$1
# usage
if [ $# -ne 1 ]; then
echo "USAGE: ./release VERSION"
echo " (e.g. 1.0.0-alpha)"
exit 1
fi
# check tag exists
TAG=$(git tag -n | awk '{print $1}' | grep -o "^v${VERSION}\$")
if [ -z $TAG ]; then
echo "FAIL: could not find version 'v${VERSION}' in git tags"
exit 2
fi
# build
git checkout ${VERSION}
docker-compose build fda-metadata-db
docker-compose build --parallel
# login
echo "Authentication required for user ${USER} at docker.io (docker hub)"
docker login docker.io -u $USER
# tag
IMAGE=$(ls -d fda-*)
for DIR in $IMAGE
do
# CHECK=$(docker images "${USER}/${IMAGE}:${VERSION}" -q)
# if [ ! -z $CHECK ]; then
# echo "CHECK ${DIR}: tag ${USER}/${IMAGE}:${VERSION} already exists locally"
# exit 3
# fi
echo "TAG ${DIR}"
docker tag ${IMAGE}:latest ${USER}/${IMAGE}:${VERSION}
docker push ${USER}/${IMAGE}:${VERSION}
done
...@@ -18,7 +18,6 @@ stages: ...@@ -18,7 +18,6 @@ stages:
- build - build
- test-frontend - test-frontend
- test-backend - test-backend
- deploy
build-docker: build-docker:
stage: build stage: build
...@@ -160,36 +159,4 @@ test-backend-citation: ...@@ -160,36 +159,4 @@ test-backend-citation:
- fda-citation-service/rest-service/target/site/jacoco/index.html - fda-citation-service/rest-service/target/site/jacoco/index.html
reports: reports:
junit: junit:
- fda-citation-service/rest-service/target/surefire-reports/TEST-*.xml - fda-citation-service/rest-service/target/surefire-reports/TEST-*.xml
\ No newline at end of file
deploy-images:
stage: deploy
only:
- tags
rules:
- if: '$CI_COMMIT_REF_NAME == "master"'
script:
- "VERSION=$(echo $CI_COMMIT_TAG | grep -o '[0-9].[0-9].[0-9]')"
- "echo $VERSION"
- "docker login -u fairdataaustria -p ${DOCKER_REGISTRY_PASSWORD}"
- "docker tag fda-metadata-db fairdataaustria/fda-metadata-db:$VERSION"
- "docker tag fda-analyse-service fairdataaustria/fda-analyse-service:$VERSION"
- "docker tag fda-broker-service fairdataaustria/fda-broker-service:$VERSION"
- "docker tag fda-citation-service fairdataaustria/fda-citation-service:$VERSION"
- "docker tag fda-container-service fairdataaustria/fda-container-service:$VERSION"
- "docker tag fda-database-service fairdataaustria/fda-database-service:$VERSION"
- "docker tag fda-discovery-service fairdataaustria/fda-discovery-service:$VERSION"
- "docker tag fda-gateway-service fairdataaustria/fda-gateway-service:$VERSION"
- "docker tag fda-query-service fairdataaustria/fda-query-service:$VERSION"
- "docker tag fda-table-service fairdataaustria/fda-table-service:$VERSION"
- "docker tag fda-ui fairdataaustria/fda-ui:$VERSION"
- "docker push fairdataaustria/fda-metadata-db:$VERSION"
- "docker push fairdataaustria/fda-analyse-service:$VERSION"
- "docker push fairdataaustria/fda-broker-service:$VERSION"
- "docker push fairdataaustria/fda-citation-service:$VERSION"
- "docker push fairdataaustria/fda-container-service:$VERSION"
- "docker push fairdataaustria/fda-discovery-service:$VERSION"
- "docker push fairdataaustria/fda-database-service:$VERSION"
- "docker push fairdataaustria/fda-gateway-service:$VERSION"
- "docker push fairdataaustria/fda-query-service:$VERSION"
- "docker push fairdataaustria/fda-table-service:$VERSION"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment