2018-08-15 09:36:55 +02:00
|
|
|
branches:
|
|
|
|
only:
|
|
|
|
- master
|
2019-03-01 15:28:07 +02:00
|
|
|
- /^it\/.*$/
|
2017-12-01 18:30:52 +02:00
|
|
|
language: groovy
|
2018-09-25 14:03:22 +02:00
|
|
|
sudo: required
|
|
|
|
services:
|
2018-10-25 12:56:32 +02:00
|
|
|
- docker
|
2018-11-07 14:08:24 +02:00
|
|
|
env:
|
|
|
|
global:
|
|
|
|
MAVEN_OPTS=-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
|
2017-12-15 12:09:05 +02:00
|
|
|
cache:
|
|
|
|
directories:
|
|
|
|
- $HOME/.m2
|
2018-10-25 12:56:32 +02:00
|
|
|
|
|
|
|
# Travis Lifecycle: https://docs.travis-ci.com/user/job-lifecycle#the-job-lifecycle
|
|
|
|
# Travis Stages: https://docs.travis-ci.com/user/build-stages/
|
|
|
|
# Travis Conditions: https://docs.travis-ci.com/user/conditional-builds-stages-jobs
|
|
|
|
jobs:
|
|
|
|
include:
|
2018-10-26 10:56:21 +02:00
|
|
|
- stage: Tests
|
|
|
|
name: Unit Tests
|
2018-11-07 11:25:00 +02:00
|
|
|
before_script:
|
|
|
|
- curl -L --output cc-test-reporter https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64
|
|
|
|
- chmod +x ./cc-test-reporter
|
|
|
|
- ./cc-test-reporter before-build
|
|
|
|
script: mvn package --batch-mode
|
|
|
|
after_script:
|
|
|
|
- JACOCO_SOURCE_PATH="src vars test" ./cc-test-reporter format-coverage target/site/jacoco/jacoco.xml --input-type jacoco
|
|
|
|
- ./cc-test-reporter upload-coverage
|
2018-11-07 13:05:28 +02:00
|
|
|
- name: Docs Build
|
2018-10-25 12:56:32 +02:00
|
|
|
if: type = pull_request
|
|
|
|
install: docker pull squidfunk/mkdocs-material:3.0.4
|
2018-12-20 10:06:31 +02:00
|
|
|
script:
|
|
|
|
- |
|
|
|
|
cp -r documentation/docs documentation/docs-tmp
|
2019-01-18 10:03:31 +02:00
|
|
|
documentation/bin/createDocu.sh vars documentation/docs-tmp/steps
|
2018-12-20 10:06:31 +02:00
|
|
|
docker run --rm -it -v ${TRAVIS_BUILD_DIR}:/docs -w /docs/documentation squidfunk/mkdocs-material:3.0.4 build --clean --verbose --strict
|
2019-02-26 17:17:03 +02:00
|
|
|
- name: Consumer Tests
|
2019-03-01 15:28:07 +02:00
|
|
|
if: repo = "SAP/jenkins-library" && ( (type != pull_request && branch =~ /^master$|^it\/.*$/) || (type == pull_request && head_repo = "SAP/jenkins-library" && head_branch =~ /^it\/.*$/) )
|
2019-02-26 17:17:03 +02:00
|
|
|
script: cd consumer-test && chmod +x integrationTestController.sh && ./integrationTestController.sh
|
2019-02-14 10:58:04 +02:00
|
|
|
|
2018-11-07 13:05:28 +02:00
|
|
|
- stage: Docs
|
|
|
|
name: Deploy
|
2018-10-31 11:36:38 +02:00
|
|
|
if: repo = "SAP/jenkins-library" AND branch = master AND NOT type = pull_request
|
2018-10-25 12:56:32 +02:00
|
|
|
install:
|
|
|
|
- docker pull squidfunk/mkdocs-material:3.0.4
|
|
|
|
- |
|
|
|
|
echo "Found change on master: Deployment of documentation"
|
|
|
|
PRIVATE_KEY="cfg/id_rsa"
|
|
|
|
openssl aes-256-cbc -K $encrypted_12c8071d2874_key -iv $encrypted_12c8071d2874_iv -in cfg/id_rsa.enc -out "${PRIVATE_KEY}" -d
|
|
|
|
chmod a+x gh-pages-deploy.sh
|
2018-12-20 10:06:31 +02:00
|
|
|
cp -r documentation/docs documentation/docs-tmp
|
2019-01-18 10:03:31 +02:00
|
|
|
documentation/bin/createDocu.sh vars documentation/docs-tmp/steps
|
2018-10-26 10:43:05 +02:00
|
|
|
script: docker run --rm -it --entrypoint "./gh-pages-deploy.sh" -e "TRAVIS_REPO_SLUG=${TRAVIS_REPO_SLUG}" -v ${TRAVIS_BUILD_DIR}:/docs -w /docs squidfunk/mkdocs-material:3.0.4
|
|
|
|
# TODO: make use of GHPages deploy provider: https://docs.travis-ci.com/user/deployment/pages/
|
2018-10-25 12:56:32 +02:00
|
|
|
|
2018-03-21 14:33:01 +02:00
|
|
|
#notifications:
|
|
|
|
# slack:
|
|
|
|
# secure: UYzfd4QYLtAX39r8LzV1dYp7cKMhYRRjI/xswMEkR+RgdMWxVPPH3kcsNLwkdNGSPn1b8Aidz8YLss9JolrepWjwI283dK8EUthZAOw03+PmL5X/3nOJ7aGv0sxwYqF5ypltBrerTf6jtPUTcQdtao+0O8bgnzShc6nWWE4MLXonjOm1pZLRUo81un+0bzm8C2ABIeHC6xuZCRycXP5u1mW1nDLK3900uY1rxIDTSZKEzA0IzLQhE9uROvI1r48fW8cKJQQjMMO5PPorq+0eDl2YTE8rQr9ldvuRE7A/ubsOQR0N5F8iAv1JTZXuXGt62fw6eKDQ1h94suEk7X+baV0EwlfhsHXcI1MxRFwxNSr9k1WaVFfA4TrM8XYBAcW3JGRA51ZK3q4EcjpuxpupaA7kZDtH53W7ePzH2TIp6yknln1q+yfcsP7cGv38sSKpKwOyMgAPRElkZzcoo31kw/PLzKPXYJEovRqx/0lWzczbFSscsroNaGCavC02++bUnyUXW2W+PG4gDSBFVZjtrvTPKnZ6DpHXV97x6xC/CzyhFj/Nf+ao/J9IIfocnc4vXJojwS550KIvM7xCDJwa/+29dajj2l6dQqrcOe3UT3O5UGU9I0KkGEDMfkLOD71eRy58qiYz3y953e52DvvzWQJbvfuk8ubMO+Fmn4GyRz8=
|