Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
87 lines (77 sloc) 3.13 KB
language: java
dist: xenial
services:
- docker
# Keep full Git history for SonarQube
git:
depth: false
addons:
apt:
packages:
- python3
- python3-pip
sonarcloud:
organization: "code-freak"
token:
secure: "hUYPJlQCW6OG76q/SsEJ4UNSaaNoBQSIYauPfbq/gWa6G1htbLEMHv2XbRT8e5/5S5shKes7dG6FTOCTrDGOAH8Go6ECcAes/hFah8PGOectVCjH9tgT6YFZOdUaiL/LUWx4hD9fDAwMAuLrXjfrQuWaZvS+Ca//GpXdl+FMmQkdtUgDopg2IEoleE/UEGm9XQBDWhokz5YMOvExjVY8GOB8E/nLs375VphW6pYOAjB2XRYX/k0lHSGW1CKcQ65W722WdZQuG2QoZeprkBpv+jGHhi8b1wKtWPL7622y8eM2MJ+cm1T3HQpR87KUGBWiCfoa/Ycf3/5tvMsLaee/TnkIG7oFvZt8ad9uugDILrhMTdAcvW4D/TtAibmj9uxIfRjYB7pQNP8OkQu1hQ9bAX0iIxMd5FLFodBulpGa/te44alW1Td2KIXKMEV2BPgfWOBScpAvBzgNpT1sb7dzF0RCFjFkyZcaVDDR3DkESvGqeompKBz5bqNrumjIAcJ5UjLqbhR7+yYQRLlHAd+7f+3pf9lD5OlNpRtC1wlKTnzD8T1TzIWrgiiZz3O6sesveIC92pxn91OBZgOtCfM8L3CWOKHdVZSYPzgueDI10N7ZC8x6KxrjbRV/RiHCIdfl4uEV6zFB1MTReKx4AqcbtG+ODwFcow36FWlD6pt8A8o="
# The commands are in order how they are executed in a job lifecycle
# https://docs.travis-ci.com/user/job-lifecycle#the-job-lifecycle
before_install:
# https://github.com/praekeltfoundation/docker-ci-deploy
- pip3 install --user --upgrade pip
- pip3 install --user docker-ci-deploy
- docker pull cfreak/codeclimate:latest
# Run gradle checks and try to build the Docker image as latest
script:
- ./gradlew check sonarqube
- docker build
--build-arg GITHUB_TOKEN
--build-arg GIT_COMMIT="$TRAVIS_COMMIT"
--build-arg GIT_TAG="$TRAVIS_TAG"
-t cfreak/code-freak:latest $TRAVIS_BUILD_DIR
after_success:
# Disable TLS 1.3: https://bugs.openjdk.java.net/browse/JDK-8221253
- ./gradlew -Djdk.tls.client.protocols="TLSv1,TLSv1.1,TLSv1.2" jacocoTestReport coveralls
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
# build & push image to Docker Cloud
# The Autobuild feature of Docker Cloud has been too slow in the past so we use Travis
before_deploy:
- docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
deploy:
# deploy master branch as latest
- provider: script
on:
branch: master
script: docker-ci-deploy --tag canary -- cfreak/code-freak
# deploy tags
- provider: script
on:
tags: true
# This will also tag and deploy minor and major version (1.2.3 as 1.2 and 1)
script: docker-ci-deploy --version-latest --version $TRAVIS_TAG --version-semver cfreak/code-freak
# deploy demo branch
- provider: script
on:
branch: demo
script: docker-ci-deploy --tag demo -- cfreak/code-freak
# publish release
- provider: script
skip_cleanup: true
on:
condition: $RELEASE_VERSION != ''
script: >-
git remote set-url origin https://${GITHUB_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git &&
git config --global user.email "${GITHUB_USER}" &&
git config --global user.name "Travis CI" &&
git checkout $TRAVIS_BRANCH &&
./gradlew release -Prelease.useAutomaticVersion=true -Prelease.releaseVersion=$RELEASE_VERSION
- provider: releases
api_key: $GITHUB_TOKEN
on:
tags: true
You can’t perform that action at this time.