forked from codefreak/codefreak
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
82 lines (71 loc) · 2.89 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
language: java
dist: xenial
services:
- docker
# Keep full Git history for SonarQube
git:
depth: false
env:
# webpack build needs a lot of memory
- NODE_OPTIONS=--max_old_space_size=4096
addons:
apt:
packages:
- python3
- python3-pip
sonarcloud:
# you cannot rename organizations on sonarcloud, so we stick with code-freak
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
install:
# skip bootJar for project initialization
- ./gradlew assemble -x bootJar
# Run gradle check as only script
script:
- ./gradlew check sonarqube
- ./gradlew jibDockerBuild -x check
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/codefreak
# 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/codefreak
# 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 -x check -x bootJar -Prelease.useAutomaticVersion=true -Prelease.releaseVersion=$RELEASE_VERSION
- provider: releases
api_key: $GITHUB_TOKEN
on:
tags: true