Skip to content
Snippets Groups Projects
Commit 750d4a34 authored by tranoris's avatar tranoris
Browse files

adding cicd related files

parent 754d27a8
No related branches found
No related tags found
No related merge requests found
Pipeline #8650 failed
/target/
include:
- ci-templates/default.yml
- local: ci-templates/build.yml
rules:
- if: '$CI_COMMIT_REF_NAME == "main" || $CI_COMMIT_REF_NAME == "develop" || $CI_COMMIT_REF_PROTECTED'
- local: ci-templates/build_unprotected.yml
rules:
- if: '$CI_COMMIT_REF_NAME != "main" && $CI_COMMIT_REF_NAME != "develop" && !$CI_COMMIT_REF_PROTECTED'
maven_build:
extends: .maven_build
.project 0 → 100644
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.etsi.osl.controllers.sylva</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>
.maven_build:
extends: .default
stage: build
image: maven:3.9.5-ibm-semeru-17-focal
script:
- mvn deploy -s ci_settings.xml -Dversion=$APP_VERSION
artifacts:
paths:
- target/
.docker_build:
extends: .default
stage: build
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
script:
- export DOCKER_TAG=$APP_VERSION
- |
if [ "$CI_COMMIT_REF_NAME" = "main" ]; then
echo "Pushing Docker image with tag 'latest'"
export DOCKER_TAG=latest
fi
- /kaniko/executor --context "${CI_PROJECT_DIR}" --dockerfile "${CI_PROJECT_DIR}/Dockerfile" --destination "${CI_REGISTRY_IMAGE}:$DOCKER_TAG"
stages:
- .pre
- build
- test
- post
- security
.default:
before_script:
- |
if [ "$CI_COMMIT_REF_PROTECTED" = true ] && [ -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=$CI_COMMIT_REF_NAME
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment