forked from SAP-archive/devops-cm-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
93 lines (91 loc) · 6.23 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
83
84
85
86
87
88
89
90
91
92
93
language: java
sudo: false
jdk:
- oraclejdk8
# Signing is not really required here. We keep it, since we get aware of issues earlier.
# In case we are outside the base repo signing is skipped since the encrypted variables
# are not availabe in this case. "noop" profile is just an empty profile, only available
# in order to avoid a warning from maven wrt non existing profile.
install:
- |
PROFILE=noop
echo "TRAVIS_REPO_SLUG: ${TRAVIS_REPO_SLUG}"
echo "TRAVIS_PULL_REQUEST_SLUG: ${TRAVIS_PULL_REQUEST_SLUG}"
if [ ! -z "${TRAVIS_PULL_REQUEST_SLUG}" ]
then
if [ "${TRAVIS_REPO_SLUG}" == "SAP/devops-cm-client" ]
then
if [ "${TRAVIS_PULL_REQUEST_SLUG}" == "${TRAVIS_REPO_SLUG}" ]
then
echo "[INFO]: Configuring code signing."
PROFILE=signing
else
echo "[INFO]: Pull request proposed from outside base repo. Not preparing code signing."
fi
else
echo "[INFO]: Pull request proposed to other repo than base repo. Not preparing code signing."
fi
else
echo "[INFO]: No pull request."
if [ "${TRAVIS_REPO_SLUG}" == "SAP/devops-cm-client" ]
echo "[INFO]: Configuring code signing."
PROFILE=signing
then
echo "[INFO]: No pull request and outside base repo. Not preparing code signing."
fi
fi
echo "[INFO] Running with profile: ${PROFILE}"
mvn --settings cfg/settings.xml -P ${PROFILE} clean verify
script:
- mkdir tmp/
- export PROJECT_VERSION=`mvn -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive exec:exec`
- tar -C tmp -xvf modules/dist.cli/target/dist.cli-${PROJECT_VERSION}.tar.gz
- tmp/bin/cmclient --version | grep -q "^${PROJECT_VERSION}"
cache:
directories:
- $HOME/.m2
before_install:
- |
echo "TRAVIS_REPO_SLUG: ${TRAVIS_REPO_SLUG}"
echo "TRAVIS_PULL_REQUEST_SLUG: ${TRAVIS_PULL_REQUEST_SLUG}"
if [ ! -z "${TRAVIS_PULL_REQUEST_SLUG}" ]
then
if [ "${TRAVIS_REPO_SLUG}" == "SAP/devops-cm-client" ]
then
if [ "${TRAVIS_PULL_REQUEST_SLUG}" == "${TRAVIS_REPO_SLUG}" ]
then
echo "[INFO]: Prepare code signing."
openssl aes-256-cbc -K $encrypted_d5d7c7a681ca_key -iv $encrypted_d5d7c7a681ca_iv -in cfg/codesigning.asc.enc -out cfg/codesigning.asc -d
gpg --fast-import cfg/codesigning.asc
else
echo "[INFO]: Pull request proposed from outside base repo. Not preparing code signing."
fi
else
echo "[INFO]: Pull request proposed to other repo than base repo. Not preparing code signing."
fi
else
echo "[INFO]: No pull request."
if [ "${TRAVIS_REPO_SLUG}" == "SAP/devops-cm-client" ]
echo "[INFO]: Prepare code signing."
openssl aes-256-cbc -K $encrypted_d5d7c7a681ca_key -iv $encrypted_d5d7c7a681ca_iv -in cfg/codesigning.asc.enc -out cfg/codesigning.asc -d
gpg --fast-import cfg/codesigning.asc
then
echo "[INFO]: No pull request and outside base repo. Not preparing code signing."
fi
fi
deploy:
- provider: script
script: mvn clean deploy --settings cfg/settings.xml -P signing -DaltDeploymentRepository=ossrh::default::https://oss.sonatype.org/service/local/staging/deploy/maven2
on:
branch: release
- provider: script
script: mvn clean deploy --settings cfg/settings.xml -P signing -DaltDeploymentRepository=ossrh::default::https://oss.sonatype.org/content/repositories/snapshots
on:
branch: master
repo: SAP/devops-cm-client
env:
global:
- secure: "nHxFPejYlhtglcXnekn0o/66fuJQQSEeQZxdGwrPXP38XjTNeRs686UbNb8KDrCKPghlgLY5DlEPn+dSko3+rhFabcEh91T3J+3vmTRYHmSKwSHKkRr0/5uHos7AcU/Yq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