-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.gitlab-ci.yml
52 lines (46 loc) · 2.54 KB
/
.gitlab-ci.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
include:
- local: '.gitlab-ci-release.yml'
variables:
# This will suppress any download for dependencies and plugins or upload messages which would clutter the console log.
# `showDateTime` will show the passed time in milliseconds. You need to specify `--batch-mode` to make this work.
MAVEN_OPTS: "-Dhttps.protocols=TLSv1.2 -Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true"
# As of Maven 3.3.0 instead of this you may define these options in `.mvn/maven.config` so the same config is used
# when running from the command line.
# `installAtEnd` and `deployAtEnd` are only effective with recent version of the corresponding plugins.
MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true"
GIT_SSL_NO_VERIFY: "true"
GIT_STRATEGY: clone
# Cache downloaded dependencies and plugins between builds.
# To keep cache across branches add 'key: "$CI_JOB_NAME"'
cache:
paths:
- .m2/repository
image: arkcase-gitlab-ci:1.0.2
stages:
- build
- release
build-snapshot:
stage: build
except:
changes:
#- .gitlab-ci.yaml
script:
- echo '<settings>' > /root/.m2/settings.xml
- echo ' <servers>' >> /root/.m2/settings.xml
- echo ' <server>' >> /root/.m2/settings.xml
- echo ' <id>arkcase.snapshot</id>' >> /root/.m2/settings.xml
- echo ' <username>admin</username>' >> /root/.m2/settings.xml
- echo " <password>$MVN_PASSWORD</password>" >> /root/.m2/settings.xml
- echo ' </server>' >> /root/.m2/settings.xml
- echo ' </servers>' >> /root/.m2/settings.xml
- echo '</settings>' >> /root/.m2/settings.xml
- apt-get update
- apt-get install -y zip sshpass
- ls -lh
- zip --exclude '*.git*' --exclude '*.m2*' -r /root/arkcase-config.zip .
- export VERSION=$(sed -n 's/^[[:space:]][[:space:]][[:space:]][[:space:]]<version>\(.*\)<\/version>/\1/p' < pom.xml)
- mvn deploy:deploy-file -Dfile=/root/arkcase-config.zip -DrepositoryId=arkcase.snapshot -Durl=$NEXUS_URL/repository/arkcase.snapshot/ -DgroupId=com.armedia.arkcase -DartifactId=arkcase-config -Dclassifier=core -Dpackaging=zip -Dversion=$VERSION -Dmaven.wagon.http.ssl.insecure=true
- export SSHPASS=$SSHPASS_ARKCASE
- sshpass -e sftp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null $SFTP_USER@$SFTP_SERVER <<< $'put /root/arkcase-config.zip /from-arkcase/arkcase-config-core.zip'
only:
- core