Pour tout problème contactez-nous par mail : support@froggit.fr | La FAQ :grey_question: | Rejoignez-nous sur le Chat :speech_balloon:

Skip to content
Snippets Groups Projects
Commit e45849f9 authored by Christophe Chaudier's avatar Christophe Chaudier :rocket:
Browse files

Merge branch '52-java-build' into 'master'

Resolve "(java) build"

Closes #52

See merge request lydra/gitlab-ci-templates!36
parents 7c64809e 9b49f666
No related branches found
No related tags found
No related merge requests found
Pipeline #1354 failed
......@@ -6,6 +6,7 @@ include:
- '/templates/activate-dind.yml'
- '/templates/stages.yml'
- '/templates/job/java/lint.yml'
- '/templates/job/java/build.yml'
- '/templates/job/container/build.yml'
- '/templates/job/container/lint.yml'
- '/templates/job/container/delivery.yml'
......@@ -101,6 +102,10 @@ node::test:
- test/node/vueapp/node_modules
# --------[ Java ]--------
java:build:
variables:
working_directory: "test/java-jar"
java:lint:
variables:
working_directory: "test/java-jar"
......@@ -247,7 +247,7 @@ node::build:
paths:
- node_modules
before_script:
- cd $working_directory
- cd ${working_directory}
script:
- npm ci
```
......
......@@ -2,4 +2,4 @@
variables:
working_directory: "$CI_PROJECT_DIR"
script:
- cd $working_directory
\ No newline at end of file
- cd ${working_directory}
......@@ -19,14 +19,15 @@ variables:
variables:
working_directory: "$CI_PROJECT_DIR"
before_script:
- cd $working_directory
- cd ${working_directory}
.base_ansible:
extends: .base_tpl
variables:
ANSIBLE_VAULT_PASSWORD_FILE: .vault_pass
before_script:
- cd $working_directory
- cd ${working_directory}
- test -z ${ANSIBLE_VAULT_PASSWORD} || echo ${ANSIBLE_VAULT_PASSWORD} > ${ANSIBLE_VAULT_PASSWORD_FILE}
- test -d ansible && chmod 750 ansible
......@@ -40,7 +41,7 @@ variables:
## without extra base64 encoding.
## https://gitlab.com/gitlab-examples/ssh-private-key/issues/1#note_48526556
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
- cd $working_directory
- cd ${working_directory}
.node-cache-push:
cache:
......
......@@ -2,4 +2,4 @@
variables:
working_directory: "$CI_PROJECT_DIR"
script:
- cd $working_directory
\ No newline at end of file
- cd ${working_directory}
# Build JAVA applications using Apache Maven (http://maven.apache.org)
# For docker image tags see https://hub.docker.com/_/maven/
# For general lifecycle information see https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
# L'application java est construite et tout les fichier target/*.jar sont mis dans le cache pour les jobs suivants
java:build:
extends:
- .java
- .java-cache-push
stage: build
script:
- mvn ${MAVEN_CLI_OPTS} dependency:go-offline ${MAVEN_SETTINGS}
- mvn ${MAVEN_CLI_OPTS} clean package -DskipTests ${MAVEN_SETTINGS}
......@@ -12,8 +12,9 @@ variables:
tpl_directory: "gci-templates"
MAVEN_OPTS: ""
MAVEN_CLI_OPTS: ""
JAVA_VERSION: "11"
MAVEN_SETTINGS: ""
MAVEN_VERSION: "3"
JAVA_VERSION: "11"
JDK_TYPE: "openjdk"
......@@ -22,14 +23,14 @@ variables:
variables:
working_directory: "$CI_PROJECT_DIR"
before_script:
- cd $working_directory
- cd ${working_directory}
.base_ansible:
extends: .base_tpl
variables:
ANSIBLE_VAULT_PASSWORD_FILE: .vault_pass
before_script:
- cd $working_directory
- cd ${working_directory}
- test -z ${ANSIBLE_VAULT_PASSWORD} || echo ${ANSIBLE_VAULT_PASSWORD} > ${ANSIBLE_VAULT_PASSWORD_FILE}
- test -d ansible && chmod 750 ansible
......@@ -43,7 +44,7 @@ variables:
## without extra base64 encoding.
## https://gitlab.com/gitlab-examples/ssh-private-key/issues/1#note_48526556
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
- cd $working_directory
- cd ${working_directory}
# --------[ Node ]--------
.node-cache-push:
......@@ -67,13 +68,30 @@ variables:
image: node:14.15.4-slim
# --------[ Java ]--------
.java-cache-push:
cache:
policy: push
key: "java-$CI_COMMIT_REF_SLUG"
paths:
- ${working_directory}/target/*.jar
.java-cache-pull:
cache:
policy: pull
key: "java-$CI_COMMIT_REF_SLUG"
paths:
- ${working_directory}/target/*.jar
.java:
extends: .base_tpl
extends:
- .base_tpl
- .java-cache-pull
image: maven:${MAVEN_VERSION}-${JDK_TYPE}-${JAVA_VERSION}
variables:
MAVEN_ACTION: "-version"
script:
- mvn ${MAVEN_CLI_OPTS} ${MAVEN_ACTION}
- mvn ${MAVEN_CLI_OPTS} ${MAVEN_ACTION} ${MAVEN_SETTINGS}
# --------[ Container ]--------
.container:build:
......
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