-
Notifications
You must be signed in to change notification settings - Fork 99
/
deploy.sh
executable file
·65 lines (54 loc) · 1.76 KB
/
deploy.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/bin/bash
# exit on error
set -e
THIS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
if [ -z "$GPG_KEY_ID" ]; then
echo "[ERROR] Key Id not specified!"
exit 1
fi
if [ -z "$GPG_KEY_PASSPHRASE" ]; then
echo "[ERROR] GPG passphrase is not specified for $GPG_KEY_ID!"
exit 1
fi
if [ -z "$GPG_PRIVATE_KEY" ]; then
echo "[ERROR] GPG private key file is not specified!"
exit 1
fi
echo "[INFO] Import PGP Key"
if ! gpg --list-secret-key | grep "$GPG_KEY_ID"; then
gpg --allow-secret-key-import --import "$GPG_PRIVATE_KEY"
fi
OSSRH_DEPLOY_SETTINGS_XML="$THIS_DIR/mvn_settings_ossrh_deploy.xml"
cat > $OSSRH_DEPLOY_SETTINGS_XML << SETTINGS.XML
<?xml version="1.0" encoding="UTF-8"?>
<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>ossrh</id>
<username>$SONATYPE_USER</username>
<password>$SONATYPE_PWD</password>
</server>
</servers>
<profiles>
<profile>
<id>ossrh</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<gpg.executable>gpg2</gpg.executable>
<gpg.keyname>$GPG_KEY_ID</gpg.keyname>
<gpg.passphrase>$GPG_KEY_PASSPHRASE</gpg.passphrase>
</properties>
</profile>
</profiles>
</settings>
SETTINGS.XML
mvn --settings $OSSRH_DEPLOY_SETTINGS_XML -DskipTests clean deploy
#confluent release
mvn -f pom_confluent.xml --settings $OSSRH_DEPLOY_SETTINGS_XML -DskipTests clean package
#white source
# whitesource/run_whitesource.sh
aws s3 cp target/components/packages/*.zip s3://sfc-eng-jenkins/repository/kafka/