Skip to content

Commit

Permalink
feat: prepare CI
Browse files Browse the repository at this point in the history
  • Loading branch information
f-necas committed Feb 3, 2024
1 parent 4de94e3 commit e4f098b
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tools/print-docker-tag.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash

# Will print a docker tag with a version based on the current git branch and tag
# e.g.: geonetwork/geonetwork-ui-my-app:1.0.0-RC2
# or: geonetwork/geonetwork-ui-my-app:feature-branch

appName=$1
gitTag=$(git describe --exact-match --tags 2>/dev/null | sed "s/^v//") # remove "v" in front of version if any
gitBranch=$(git symbolic-ref --short HEAD)
gitRef=$(git rev-parse --short HEAD)
dockerTag=${gitTag:-${gitBranch}}
if [ ${dockerTag} == "main" ]; then
dockerTag=${dockerTag}-${gitRef}
fi

echo "ghcr.io/camptocamp/mel-dataplatform/${appName}:${dockerTag}"

0 comments on commit e4f098b

Please sign in to comment.