Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
org.etsi.osl.main
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
OSL
code
org.etsi.osl.main
Commits
e14e5074
Commit
e14e5074
authored
1 year ago
by
Dimitrios Giannopoulos
Browse files
Options
Downloads
Patches
Plain Diff
added central gitlab ci
parent
93b1ce35
No related branches found
No related tags found
3 merge requests
!34
Merging develop (merged from 2024Q2_RC) into main creating for 2024Q2 Release
,
!33
Merging 2024Q2_RC into main creating for 2024Q2 Release
,
!20
Resolve "Update gitlab CI file to use inherited jobs from main"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+42
-4
42 additions, 4 deletions
.gitlab-ci.yml
with
42 additions
and
4 deletions
.gitlab-ci.yml
+
42
−
4
View file @
e14e5074
stages
:
-
deploy
-
java_build
-
docker_build
deploy
:
stage
:
deploy
.default_rules
:
&default_rules
rules
:
-
if
:
'
$CI_COMMIT_REF_NAME
==
"main"'
-
if
:
'
$CI_COMMIT_REF_NAME
==
"develop"'
-
if
:
'
$CI_COMMIT_REF_NAME
==
"12-create-a-pipeline-to-build-and-publish-the-docker-image-in-gitlab-registry"'
variables
:
DEFAULT_TAG
:
"
1.2.0-SNAPSHOT"
before_script
:
-
|
if [ "$CI_COMMIT_REF_NAME" = "main" ] && [ -n "$CI_COMMIT_TAG" ]; then
export APP_VERSION=$CI_COMMIT_TAG
elif [ "$CI_COMMIT_REF_NAME" = "develop" ]; then
export APP_VERSION="develop"
else
export APP_VERSION=$DEFAULT_TAG
fi
java_build
:
stage
:
java_build
image
:
maven:3.9.5-ibm-semeru-17-focal
script
:
-
mvn deploy -s ci_settings.xml -DskipTests
-
mvn deploy -s ci_settings.xml -DskipTests -Dversion=$APP_VERSION
artifacts
:
paths
:
-
target/
<<
:
*default_rules
.docker_build
:
stage
:
docker_build
image
:
name
:
gcr.io/kaniko-project/executor:debug
entrypoint
:
[
"
"
]
script
:
-
/kaniko/executor --context "${CI_PROJECT_DIR}" --dockerfile "${CI_PROJECT_DIR}/Dockerfile" --destination "${CI_REGISTRY_IMAGE}:$APP_VERSION"
-
|
if [ "$CI_COMMIT_REF_NAME" = "main" ]; then
echo "Pushing Docker image with tag 'latest'"
/kaniko/executor --context "${CI_PROJECT_DIR}" --dockerfile "${CI_PROJECT_DIR}/Dockerfile" --destination "${CI_REGISTRY_IMAGE}:latest"
fi
<<
:
*default_rules
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