Commit 079e3962 authored by Stefan Wolfsheimer's avatar Stefan Wolfsheimer Committed by Stefan Wolfsheimer
Browse files

fixed build for tagged version

parent d24359dc
......@@ -40,13 +40,19 @@ RPM_PACKAGE=`rpm_package $BUILD `
IRODS_VERSION=`irods_version $VERSION`
PACKAGE_DIR=`package_dir $VERSION $GIT_BRANCH`
DOCKERFILE=ci/${VERSION}/Dockerfile
IMAGE_NAME_VERSION=`image_name $VERSION`
if [ -z "${GIT_BRANCH}" ]
if [ -z "$CI_COMMIT_TAG" ]
then
GIT_BRANCH=${CI_COMMIT_REF_NAME}
if [ -z "${GIT_BRANCH}" ]
then
GIT_BRANCH=${CI_COMMIT_REF_NAME}
fi
else
GIT_BRANCH=release
fi
IMAGE_NAME=${REGISTRY}/b2safe_${GIT_BRANCH}_${VERSION}:latest
IMAGE_NAME=${REGISTRY}/${IMAGE_NAME_VERSION}
is_logged_in() {
cat ~/.docker/config.json | jq -r --arg url "${REGISTRY}" '.auths | has($url)'
......@@ -71,7 +77,7 @@ then
# unauthorized: Pushing Docker images with manifest v2 schema 1 to this repository is blocked. For more information visit https://www.jfrog.com/confluence/display/RTF/Advanced+Topics#AdvancedTopics-DockerManifestV2Schema1Deprecation
# ---> remove image manually
# curl -ueudat-artie:XXXXXXXXXX -X DELETE https://artie.ia.surfsara.nl:443/artifactory/eudat-docker-public/b2safe_${GIT_BRANCH}_${VERSION}
/home/gitlab-runner/rm_image.sh b2safe_${GIT_BRANCH}_${VERSION}
# /home/gitlab-runner/rm_image.sh ${IMAGE_NAME_VERSION}
docker push ${IMAGE_NAME}
rm -rf RPM
else
......
......@@ -82,6 +82,19 @@ function repo_name()
echo $REPO_NAME
}
function image_name()
{
local VERSION=$1
if [ -z "$CI_COMMIT_TAG" ]
then
# this is a normal branch
BRANCH=${CI_COMMIT_REF_NAME}
echo b2safe_${BRANCH}_${VERSION}:latest
else
echo b2safe_release_${VERSION}:$( echo $CI_COMMIT_TAG | sed 's/b2safe-v//' )
fi
}
function package_dir()
{
local REPO_NAME=`repo_name $1 $2`
......
......@@ -139,7 +139,7 @@ getConfParameters(*authzEnabled) {
getB2SAFEVersion(*version) {
*major_version = "4";
*minor_version = "3";
*sub_version = "0";
*sub_version = "2";
*version = *major_version ++ "." ++ *minor_version ++ "-" ++ *sub_version;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment