Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
naming-backend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue 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
Anders Harrisson
naming-backend
Commits
4b3d5e88
Commit
4b3d5e88
authored
3 years ago
by
Anders Harrisson
Browse files
Options
Downloads
Patches
Plain Diff
Add GitLab-CI build pipeline
JIRA INFRA-4886
parent
f7f0eb91
No related branches found
No related tags found
No related merge requests found
Pipeline
#107464
passed
3 years ago
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+87
-0
87 additions, 0 deletions
.gitlab-ci.yml
Dockerfile
+2
-2
2 additions, 2 deletions
Dockerfile
with
89 additions
and
2 deletions
.gitlab-ci.yml
0 → 100644
+
87
−
0
View file @
4b3d5e88
variables
:
CONTAINER_BRANCH_IMAGE
:
$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
stages
:
-
compile
-
test
-
package
-
analyse
-
publish
-
image
-
release
-
deploy
.maven
:
image
:
registry.esss.lu.se/ics-docker/maven:openjdk-17
tags
:
-
docker
.docker
:
image
:
docker:latest
tags
:
-
docker
compile
:
stage
:
compile
extends
:
.maven
script
:
-
mvn --batch-mode compile
artifacts
:
paths
:
-
target/
expire_in
:
1 day
test
:
stage
:
test
extends
:
.maven
script
:
-
mvn --batch-mode test
artifacts
:
reports
:
junit
:
-
target/surefire-reports/TEST-*.xml
package
:
stage
:
package
extends
:
.maven
script
:
-
mvn --batch-mode install
artifacts
:
paths
:
-
target/naming-backend-*.jar
# sonar:
# stage: analyse
# extends: .maven
# script:
# - mvn --batch-mode sonar:sonar -Dsonar.login=$SONARQUBE_TOKEN -Dsonar.branch.name=$CI_COMMIT_REF_SLUG
# only:
# - branches@ics-software/naming-backend
docker-build
:
stage
:
image
extends
:
.docker
before_script
:
-
docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script
:
-
docker build -t $CONTAINER_BRANCH_IMAGE .
-
docker push $CONTAINER_BRANCH_IMAGE
only
:
-
branches
docker-release
:
stage
:
release
extends
:
.docker
before_script
:
-
apk add xmlstarlet
-
POM_VERSION=$(xmlstarlet sel -N pom=http://maven.apache.org/POM/4.0.0 -t -v "/pom:project/pom:version" pom.xml)
-
docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script
:
-
docker pull $CONTAINER_BRANCH_IMAGE
-
docker tag $CONTAINER_BRANCH_IMAGE $CI_REGISTRY_IMAGE:$POM_VERSION
-
docker tag $CONTAINER_BRANCH_IMAGE $CI_REGISTRY_IMAGE:latest
-
docker push $CI_REGISTRY_IMAGE:$POM_VERSION
-
docker push $CI_REGISTRY_IMAGE:latest
only
:
-
main
This diff is collapsed.
Click to expand it.
Dockerfile
+
2
−
2
View file @
4b3d5e88
...
...
@@ -5,6 +5,6 @@
FROM
openjdk:17
# deployment unit
COPY
target/naming-backend-
0.0.1-SNAPSHOT
.jar /naming/naming-backend
-0.0.1-SNAPSHOT
.jar
COPY
target/naming-backend-
*
.jar /naming/naming-backend.jar
CMD
["java", "-jar", "/naming/naming-backend
-0.0.1-SNAPSHOT
.jar", "--spring.config.name=application-docker"]
CMD
["java", "-jar", "/naming/naming-backend.jar", "--spring.config.name=application-docker"]
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