forked from eclipse-lsp4j/lsp4j
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy-build.sh
executable file
·58 lines (51 loc) · 2.04 KB
/
deploy-build.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
#!/bin/bash
set -u # run with unset flag error so that missing parameters cause build failure
set -e # error out on any failed commands
set -x # echo all commands used for debugging purposes
SSHUSER="genie.lsp4j@projects-storage.eclipse.org"
SSH="ssh ${SSHUSER}"
SCP="scp"
DOWNLOAD=download.eclipse.org/lsp4j/builds/$BRANCH_NAME
DOWNLOAD_MOUNT=/home/data/httpd/$DOWNLOAD
# Deploying build to nightly location on download.eclipse.org
if $SSH test -e ${DOWNLOAD_MOUNT}-new; then
$SSH rm -r ${DOWNLOAD_MOUNT}-new
fi
if $SSH test -e ${DOWNLOAD_MOUNT}-last; then
$SSH rm -r ${DOWNLOAD_MOUNT}-last
fi
$SSH mkdir -p ${DOWNLOAD_MOUNT}-new
$SCP -rp build/p2-repository/* "${SSHUSER}:"${DOWNLOAD_MOUNT}-new
if $SSH test -e ${DOWNLOAD_MOUNT}; then
$SSH mv ${DOWNLOAD_MOUNT} ${DOWNLOAD_MOUNT}-last
fi
$SSH mv ${DOWNLOAD_MOUNT}-new ${DOWNLOAD_MOUNT}
# Only maven deploy specific branches
case $BRANCH_NAME in
main | release_*)
# GPG Sign and Deploy to Maven Central snapshot
find build/maven-repository -name '*.pom' | while read i
do
base="${i%.*}"
# The centos-7 agent is used because it provides gpg 2.0.x
# and we sign for OSSRH with gpg maven plug-in run at the command
# line.
# If a newer GPG version (> 2.1+) is used,
# --pinentry-mode loopback needs to be added as gpg argument in the pom.xml.
# If centos changes we may need to add the gpg arguments to some pom.xml
# somewhere
mvn -X \
org.apache.maven.plugins:maven-gpg-plugin:1.6:sign-and-deploy-file \
-DpomFile=${base}.pom \
-Dfile=${base}.jar \
-Dfiles=${base}-sources.jar,${base}-javadoc.jar \
-Dclassifiers=sources,javadoc \
-Dtypes=jar,jar \
-Durl=https://oss.sonatype.org/content/repositories/snapshots/ \
-DrepositoryId=ossrh
done
;;
*)
echo "Maven deployments only done on main and release branches"
;;
esac