forked from johnjcool/keycloak-cas-services
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
73 lines (66 loc) · 3.37 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
sudo: false
language: java
jdk:
- oraclejdk8
services:
- docker
cache:
directories:
- $HOME/.m2
- $TRAVIS_BUILD_DIR/target
addons:
sonarcloud:
organization: "johnjcool-github"
stages:
- compile
- name: deploy_snapshot
if: branch = master AND type = push
- name: deploy_release
if: tag IS present
- code_quality
jobs:
include:
- stage: compile
- stage: deploy_snapshot
before_script:
- echo $GPG_SECRET_KEYS | base64 --decode | $GPG_EXECUTABLE --import
- echo $GPG_OWNERTRUST | base64 --decode | $GPG_EXECUTABLE --import-ownertrust
- export project_version=$(mvn help:evaluate -N -Dexpression=project.version|grep -v '\[')
script:
- mvn deploy --settings .travis/settings.xml -DskipTests=true -B -U -Prelease
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- cp src/main/docker/Dockerfile target/Dockerfile
- cd target
- docker build --tag $DOCKER_USERNAME/keycloak-cas:$project_version --build-arg project_version=${project_version} .
- docker push $DOCKER_USERNAME/keycloak-cas:$project_version
- cd ..
- stage: deploy_release
before_script:
- echo $GPG_SECRET_KEYS | base64 --decode | $GPG_EXECUTABLE --import
- echo $GPG_OWNERTRUST | base64 --decode | $GPG_EXECUTABLE --import-ownertrust
- export project_version=$TRAVIS_TAG
script:
- mvn org.codehaus.mojo:versions-maven-plugin:2.5:set --settings .travis/settings.xml -DnewVersion=$project_version -B -U
- mvn clean deploy --settings .travis/settings.xml -DskipTests=true -B -U -Prelease
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- cp src/main/docker/Dockerfile target/Dockerfile
- cd target
- docker build --tag $DOCKER_USERNAME/keycloak-cas:$project_version --build-arg project_version=${project_version} .
- docker push $DOCKER_USERNAME/keycloak-cas:$project_version
- docker tag $DOCKER_USERNAME/keycloak-cas:$project_version $DOCKER_USERNAME/keycloak-cas:latest
- docker push $DOCKER_USERNAME/keycloak-cas:latest
- cd ..
deploy:
provider: releases
api_key:
secure: X5KxTm0nA7QzGrIOroEqLuByj5aZyygWpltIQzDl4SCHnNXJ79trc0FRjmcwCpcspSRWLxKiM5J8DseXxjaFP415BTj5iK8eV+631DgOqF87uJDv5jrw9nRTzzqA35f4N+WiLnOf/OkilYOkF3CTWryD1aqwY6MhEeGXrDj7JCWfXBDgtLgUTO4yLE3So52NxxWcOMub9Aef1vvyihtazeRli2D5eqnl0v7G6Rze4IRY90iDQ5JPISOwXsGc09VZKvejUWCNgW2lyLH+oXMUAlVvq672skb+ECuy+QwsTXlvqn853LmavmVySQkukr39iQjahSVCgt4i4fCGKYnee0vWQIuC3TtlhcursYCDPtuIZlB+xgevuf9miv3EflcY3x+rAnGxLsV5bYvmtR8v/RjaokyjamzYaiCjgb+x04LA7TcAguRnDFgE2FhM/OezEY3HmYvHJzFhmFM7v1nYF8r3bx5zpYGTEoAuCZuVt5Oehzoa6mMkAODR/0UaBeHtI6a6YzJm0hrJERKJpxdOCg8d5G74HT2kcWy/fR/nrTXTWRelOs34bzyQfIqUzzVX3jqOqun+JDMLNhX6bARNuAECtGAA8BChy2NPj1zasKBjJUwtcIf/C3MPwGz7C6nnljIWg25s/selveyNIveP2OtIPAa+uwB1PqR53nYxatQ=
file:
- target/keycloak-cas-services-$project_version.jar
- target/keycloak-cas-services-$project_version-javadoc.jar
- target/keycloak-cas-services-$project_version-sources.jar
skip_cleanup: true
on:
tags: true
- stage: code_quality
script:
- mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent install sonar:sonar -Dsonar.login=$SONAR_TOKEN