Verified Commit d6d6f3aa authored by Lukas Wiest's avatar Lukas Wiest 🚂
Browse files

feat: add ci pipeline

parent ab131beb
Pipeline #1235 passed with stages
in 1 minute and 11 seconds
variables:
MAVEN_CLI_OPTS: "-Dmaven.repo.local=$CI_PROJECT_DIR/maven-repo"
cache:
paths:
- maven-repo
maven:compile:
stage: compile
tags:
- docker
image: maven:3-openjdk-11-slim
script:
- mvn $MAVEN_CLI_OPTS clean
- mvn $MAVEN_CLI_OPTS compile test-compile
only:
changes:
- pom.xml
- src/**/*
artifacts:
expire_in: 3h
paths:
- target/
maven:test:
stage: test
tags:
- docker
image: maven:3-openjdk-11-slim
script:
- mvn $MAVEN_CLI_OPTS test
dependencies:
needs:
- maven:compile
only:
changes:
- pom.xml
- src/**/*
.maven:deploy: &mavenDeploy
stage: deploy
tags:
- docker
image: maven:3-openjdk-11-slim
script:
- 'mvn $MAVEN_CLI_OPTS deploy -s transfer-gitlab-settings.xml'
needs:
- maven:compile
- job: maven:test
artifacts: false
maven:publish:master:
<<: *mavenDeploy
only:
refs:
- master
changes:
- pom.xml
- src/**/*
maven:publish:release:
<<: *mavenDeploy
variables:
BUILD_NUMBER: $CI_COMMIT_TAG
only:
refs:
- /^(\d+\.){2}?\d+$/
changes:
- pom.xml
- src/**/*
except:
- branches
mkdocs:compile:
stage: compile
image: python:3.8
tags:
- docker
script:
- pip install -r requirements.txt -U
- mkdocs build --strict
only:
changes:
- docs/**/*
- mkdocs.yml
artifacts:
expire_in: 3h
paths:
- site/
mkdocs:bundle:
stage: deploy
image: alpine
tags:
- docker
script:
- tar c -zvf documentation.tar.gz site
needs:
- mkdocs:compile
only:
changes:
- docs/**/*
- mkdocs.yml
artifacts:
expire_in: 3 days
paths:
- ./*.tar.gz
mkdocs:deploy:
stage: deploy
tags:
- production
variables:
EXPORT_DIR: "/var/www/html/pages"
script:
- mkdir -p "$EXPORT_DIR/$CI_PROJECT_NAME"
- cp -r site/* "$EXPORT_DIR/$CI_PROJECT_NAME"
needs:
- mkdocs:compile
only:
refs:
- master-disabled-for-now
changes:
- docs/**/*
- mkdocs.yml
stages:
- compile
- test
- deploy
include:
- local: '/.gitlab-ci-maven.yml'
- local: '/.gitlab-ci-mkdocs.yml'
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment