-
Notifications
You must be signed in to change notification settings - Fork 82
/
release.sh
executable file
·51 lines (43 loc) · 1.45 KB
/
release.sh
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
#!/bin/bash
set -e -u -x
apk add --no-cache git openssh
version=$(cat version/version)
mkdir -p $HOME/.ssh
cat >$HOME/.ssh/config <<EOL
Host github.com
StrictHostKeyChecking no
IdentityFile ~/.ssh/key
EOL
echo $git_private_key >$HOME/.ssh/key
chmod 0400 $HOME/.ssh/key
# Write a Maven config file that allows uploading the build artifact
# to the Jenkins repository.
cat >maven-settings.xml <<EOL
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>maven.jenkins-ci.org</id> <!-- For parent 1.397 or newer; this ID is used for historical reasons and independent of the actual host name -->
<username>${artifactory_username}</username>
<password>${artifactory_password}</password>
</server>
</servers>
</settings>
EOL
# Maven will use git to make a commit. It should be configured.
git config --global user.email "release-robot@cloud-graphite.com"
git config --global user.name "release-robot"
pushd plugin
GOOGLE_PROJECT_ID=$project_id GOOGLE_CREDENTIALS=$service_account_json \
mvn \
-B \
-Dmaven.test.skip=true \ #TODO delete
-Dtag=google-compute-engine-$version \
-DreleaseVersion=$version \
-DdevelopmentVersion=$version \
-DpushChanges=false \
release:prepare \
release:perform
popd