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
2019-10-15 14:06:02 +02:00
jdk :
- openjdk8
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
2019-04-10 12:26:54 +02:00
# Travis GHPages deploy provider: https://docs.travis-ci.com/user/deployment/pages/
2018-10-25 12:56:32 +02:00
jobs :
include :
2018-10-26 10:56:21 +02:00
- stage : Tests
2019-11-12 17:34:05 +02:00
name : Golang Build
if : type = pull_request
script :
- docker build -t piper:${TRAVIS_BRANCH} .
- name : Golang Build & Publish
if : type != pull_request && repo = "SAP/jenkins-library" && branch = "master"
script :
- docker build -t piper:${TRAVIS_BRANCH} .
- docker create --name piper_${TRAVIS_BRANCH} piper:${TRAVIS_BRANCH}
- docker cp piper_${TRAVIS_BRANCH}:/build/piper .
- docker rm piper_${TRAVIS_BRANCH}
- cp ./piper ./piper_master
- chmod +x ./piper
2019-11-22 09:09:27 +02:00
- ./piper githubPublishRelease --token ${GITHUB_TOKEN} --version latest --assetPath ./piper_master
2019-11-12 17:34:05 +02:00
- name : Groovy 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
2019-10-22 15:41:27 +02:00
script :
- mvn package --batch-mode
2018-11-07 11:25:00 +02:00
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
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-05-09 10:28:54 +02:00
script : cd consumer-test && groovy consumerTestController.groovy
2019-02-14 10:58:04 +02:00
2018-11-07 13:05:28 +02:00
- stage : Docs
2019-04-12 13:17:56 +02:00
name : Create Documentation
2019-04-10 12:26:54 +02:00
install : docker pull squidfunk/mkdocs-material:3.0.4
2019-11-25 12:28:22 +02:00
before_script :
- documentation/bin/createDocu.sh
2019-11-26 10:55:49 +02:00
- docker run -u `id -u`:`id -g` --rm -it -e GOCACHE=/tmp -v ${TRAVIS_BUILD_DIR}:/docu-gen golang sh -c "cd /docu-gen && go get github.com/SAP/jenkins-library/... && go run /docu-gen/pkg/generator/step-metadata.go --docuDir=/docu-gen/documentation/docs/steps/ --docuGen=true "
2019-05-15 16:12:02 +02:00
script :
- docker run -u `id -u`:`id -g` --rm -it -v ${TRAVIS_BUILD_DIR}/documentation:/docs squidfunk/mkdocs-material:3.0.4 build --clean --strict
2019-11-25 12:28:22 +02:00
after_script :
2019-05-15 16:12:02 +02:00
- mkdir -p documentation/docs-gen/misc
- cp target/docuMetaData.json documentation/docs-gen/misc
2019-04-10 12:26:54 +02:00
deploy :
on :
branch : master
provider : pages
skip_cleanup : true
github_token : ${GITHUB_TOKEN}
name : 'Travis CI Publisher'
2019-04-10 13:49:40 +02:00
local_dir : 'documentation/docs-gen'
2019-04-10 12:26:54 +02:00
keep_history : true
#verbose: true