Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
V
VIPSCommon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VIPS
VIPSCommon
Commits
4023a17f
Commit
4023a17f
authored
1 month ago
by
Lene Wasskog
Browse files
Options
Downloads
Plain Diff
Merge branch 'main' into release
parents
fe096027
0cc4d1d6
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+104
-6
104 additions, 6 deletions
.gitlab-ci.yml
pom.xml
+2
-2
2 additions, 2 deletions
pom.xml
with
106 additions
and
8 deletions
.gitlab-ci.yml
+
104
−
6
View file @
4023a17f
include
:
-
project
:
'
VIPS/vips-common-config'
file
:
'
/gitlab-ci-vips-libraries.yml'
ref
:
main
image
:
eclipse-temurin:17.0.9_9-jdk-jammy
stages
:
-
build
...
...
@@ -17,6 +14,13 @@ stages:
-
models-8
variables
:
COMMON_CONFIG_REMOTE
:
https://oauth2:$CICD_ACCESS_TOKEN@$CI_SERVER_HOST/VIPS/vips-common-config.git
COMMON_CONFIG_LOCAL
:
"
vips-common-config"
SETTINGS_XML
:
"
ci_settings.xml"
MAVEN_CLI_OPTS
:
"
-s
$SETTINGS_XML
--batch-mode"
MAVEN_OPTS
:
"
-Dmaven.repo.local=.m2/repository
-Dmaven.artifact.threads=10"
MAIN_BRANCH
:
"
main"
RELEASE_BRANCH
:
"
release"
ALTERNARIA_PROJECT_ID
:
"
173"
APPLESCABM_PROJECT_ID
:
"
20"
BARLEYNETB_PROJECT_ID
:
"
21"
...
...
@@ -40,8 +44,102 @@ variables:
SEPAPIICOL_PROJECT_ID
:
"
39"
SEPTORIAHU_PROJECT_ID
:
"
65"
SEPTREFHUM_PROJECT_ID
:
"
135"
cache
:
paths
:
-
.m2/repository/
# Runs after new SNAPSHOT is deployed to package registry. Triggers job on main branch in model repo,
before_script
:
-
apt-get update && apt-get install -y git
-
git config --global user.name "${GITLAB_USER_NAME}"
-
git config --global user.email "${GITLAB_USER_EMAIL}"
-
echo "Get common settings"
-
git clone --depth=1 "$COMMON_CONFIG_REMOTE" "$COMMON_CONFIG_LOCAL"
-
cp $COMMON_CONFIG_LOCAL/$SETTINGS_XML ./$SETTINGS_XML
-
rm -rf $COMMON_CONFIG_LOCAL
build
:
stage
:
build
script
:
-
./mvnw $MAVEN_CLI_OPTS $MAVEN_OPTS package
tags
:
-
java
test
:
stage
:
test
script
:
-
./mvnw $MAVEN_CLI_OPTS $MAVEN_OPTS test
tags
:
-
java
deploy-snapshot
:
stage
:
deploy
script
:
-
export VERSION=$(./mvnw $MAVEN_CLI_OPTS $MAVEN_OPTS --batch-mode --no-transfer-progress --non-recursive help:evaluate -Dexpression=project.version | grep -v "\[.*")
-
if ! [[ $VERSION =~ .*SNAPSHOT ]]; then
echo "Version '$VERSION' is not SNAPSHOT"; exit 1;
fi
-
./mvnw $MAVEN_CLI_OPTS $MAVEN_OPTS deploy -DskipTests
-
echo "VERSION=$VERSION" >> build.env
artifacts
:
reports
:
dotenv
:
build.env
tags
:
-
java
rules
:
-
if
:
'
$CI_COMMIT_REF_NAME
==
$MAIN_BRANCH'
deploy-release
:
stage
:
deploy
script
:
# Use access token given by CI/CD variable CICD_ACCESS_TOKEN to authenticate
-
export NEW_REPO_URL=https://oauth2:$CICD_ACCESS_TOKEN@$CI_SERVER_HOST/$CI_PROJECT_PATH.git
-
git remote set-url --push origin $NEW_REPO_URL
-
git fetch origin --prune --prune-tags
# Checkout release branch
-
git stash -a
-
git checkout $RELEASE_BRANCH
-
git reset --hard origin/$RELEASE_BRANCH
-
git stash pop
# Set release version and deploy. Commit, tag and push.
-
./mvnw $MAVEN_CLI_OPTS $MAVEN_OPTS validate -DremoveSnapshot
-
export RELEASE_VERSION=$(./mvnw $MAVEN_CLI_OPTS $MAVEN_OPTS --batch-mode --no-transfer-progress --non-recursive help:evaluate -Dexpression=project.version | grep -v "\[.*")
-
echo "VERSION=$RELEASE_VERSION" >> build.env
-
export RELEASE_TAG="v${RELEASE_VERSION}"
-
export EXISTING_TAGS=$(git ls-remote --tags origin | cut -f 2 | grep "refs/tags/$RELEASE_TAG$")
-
if [ -n "$EXISTING_TAGS" ]; then
echo "Tag $RELEASE_TAG already exists"; exit 0;
fi
-
./mvnw $MAVEN_CLI_OPTS $MAVEN_OPTS deploy -DskipTests
-
git add pom.xml
-
git commit -m "[ci skip] Set release version ${RELEASE_VERSION}"
-
git tag -a $RELEASE_TAG -m "Tag release ${RELEASE_TAG}"
-
git push origin $RELEASE_TAG
-
git push origin $RELEASE_BRANCH
# Checkout main branch
-
git stash -a
-
git checkout $MAIN_BRANCH
-
git reset --hard origin/$MAIN_BRANCH
-
git stash pop
# Merge release branch, bump patch version, push commits.
-
git merge -m "[ci skip] Merge branch '${RELEASE_BRANCH}' into ${MAIN_BRANCH}" --no-ff $RELEASE_BRANCH
-
./mvnw $MAVEN_CLI_OPTS $MAVEN_OPTS validate -DbumpPatch
-
export SNAPSHOT_VERSION=$(./mvnw $MAVEN_CLI_OPTS $MAVEN_OPTS --batch-mode --no-transfer-progress --non-recursive help:evaluate -Dexpression=project.version | grep -v "\[.*")
-
git add pom.xml
-
git commit -m "[ci skip] Set snapshot version ${SNAPSHOT_VERSION}"
-
git push origin $MAIN_BRANCH
artifacts
:
reports
:
dotenv
:
build.env
tags
:
-
java
rules
:
-
if
:
'
$CI_COMMIT_REF_NAME
==
$RELEASE_BRANCH'
# Jobs below runs after new SNAPSHOT is deployed to package registry. Triggers job on main branch in model repo,
# which builds model with the new version of VIPSCommon. This pipeline fails if model build fails.
verify_model_ALTERNARIA
:
...
...
@@ -643,4 +741,4 @@ update_model_SEPTREFHUM:
dependencies
:
-
deploy-release
rules
:
-
if
:
'
$CI_COMMIT_REF_NAME
==
$RELEASE_BRANCH'
\ No newline at end of file
-
if
:
'
$CI_COMMIT_REF_NAME
==
$RELEASE_BRANCH'
This diff is collapsed.
Click to expand it.
pom.xml
+
2
−
2
View file @
4023a17f
...
...
@@ -5,11 +5,11 @@
<parent>
<groupId>
no.nibio.vips
</groupId>
<artifactId>
vips-parent-pom
</artifactId>
<version>
1.1.
0
</version>
<version>
1.1.
3
</version>
</parent>
<artifactId>
VIPSCommon
</artifactId>
<version>
3.0.
1
</version>
<version>
3.0.
2-SNAPSHOT
</version>
<packaging>
jar
</packaging>
<name>
VIPSCommon
</name>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment