Skip to content

Instantly share code, notes, and snippets.

addons:
apt:
packages:
- sshpass
stages:
- frontend
- backend
- deploy
- patch
cache:
directories:
- "$HOME/.m2/repository/"
- "$HOME/src/main/resources/static/"
- "$HOME/dist/"
cache:
key: "$CI_COMMIT_REF_NAME"
paths:
- .m2/repository/
- src/main/resources/static/
- dist/
Frontend:
extends: .Job_Only
image: node:10
stage: frontend
before_script:
- npm install
script:
- npm test
after_script:
- npm run dist
...
Patch:
image: maven:3.3.9
only:
changes:
- "pom.xml"
refs:
- merge_requests
stage: patch
before_script:
...
Deploy:
extends: .Job_Only
image: maven:3.3.9
stage: deploy
before_script:
- POM_VERSION=$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)
- apt-get update -qq && apt-get install -y -qq sshpass
script:
- ls -all ./dist
...
BE_Build:
extends: .Job_Only
image: maven:3.3.9
stage: bebuild
script:
- mvn install -DskipTests=true $MAVEN_OPTS $MAVEN_CLI_OPTS
...
...
BE_Test:
extends: .Job_Only
image: maven:3.3.9
stage: betest
script:
- mvn test $MAVEN_OPTS
...
...
FE_Build:
extends: .Job_Only
image: node:10
stage: febuild
before_script:
- npm install
script:
- npm run dist
- ls -all ./src/main/resources/static