-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
131 lines (126 loc) · 6.45 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
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
image: maven:3-jdk-8
testing:
stage: test
script:
- wget -q -O - https://dist.eugridpma.info/distribution/igtf/current/GPG-KEY-EUGridPMA-RPM-3 | apt-key add -
- echo "deb http://repository.egi.eu/sw/production/cas/1/current egi-igtf core" > /etc/apt/sources.list.d/egi.list
- mkdir -p /etc/grid-security/certificates
- apt update
- apt install -y --install-recommends ca-policy-egi-core
- wget http://software.plgrid.pl/packages/general/ca_PLGRID-SimpleCA-1.0-4.noarch.rpm
- apt install -y alien
- alien --to-deb ca_PLGRID-SimpleCA-1.0-4.noarch.rpm
- dpkg -i ca-plgrid-simpleca_1.0-5_all.deb
- apt install -y fetch-crl
- echo "$APP_PROPS" > src/test/resources/config/application.properties
- echo "$USER_CERT" > src/test/resources/usercert.pem
- echo "$USER_KEY" > src/test/resources/userkey.pem
- mvn test -B -Dmaven.repo.local=/cache/.m2/repository
prod_deploy:
stage: deploy
environment: production
only:
- production
script:
- eval $(ssh-agent -s)
- ssh-add <(echo "$SSH_RW_KEY")
- mkdir -p ~/.ssh
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
- mvn clean package -B -DskipTests -Dmaven.repo.local=/cache/.m2/repository
- ssh [email protected] "mkdir -p rimrock"
- scp target/*.jar [email protected]:rimrock/rimrock.jar
- ssh [email protected] "chmod +x rimrock/rimrock.jar"
- ssh [email protected] "sudo /etc/init.d/rimrock restart"
bugfix_release:
stage: deploy
only:
- master
when: manual
script:
- eval $(ssh-agent -s)
- ssh-add <(echo "$SSH_RW_KEY")
- mkdir -p ~/.ssh
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
- git config --global user.name "Gitlab CI"
- git config --global user.email [email protected]
- git remote set-url origin [email protected]:cyfronet/rimrock.git
- git checkout master
- git fetch
- git reset --hard origin/master
- mvn -B -Dmaven.repo.local=/cache/.m2/repository build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.incrementalVersion} versions:commit
- export version=`printf 'RIMROCK_VERSION=${project.version}' | mvn -Dmaven.repo.local=/cache/.m2/repository help:evaluate | grep RIMROCK_VERSION | sed "s/RIMROCK_VERSION=//"`
- export date=`date +%Y-%m-%d`
- echo "Evaluated version and date are $version and $date"
- sed -i "s/unreleased/$version/" CHANGELOG
- git add CHANGELOG pom.xml
- git commit -m "release $version"
- git tag -a "$version" -m "release $version"
- sed -i '1i\v unreleased\n' CHANGELOG
- mvn -B -Dmaven.repo.local=/cache/.m2/repository build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion}-SNAPSHOT versions:commit
- git add CHANGELOG pom.xml
- export version=`printf 'RIMROCK_VERSION=${project.version}' | mvn -Dmaven.repo.local=/cache/.m2/repository help:evaluate | grep RIMROCK_VERSION | sed "s/RIMROCK_VERSION=//"`
- git commit -m "next development cycle for $version"
- git push origin master
- git push origin --tags
feature_release:
stage: deploy
only:
- master
when: manual
script:
- eval $(ssh-agent -s)
- ssh-add <(echo "$SSH_RW_KEY")
- mkdir -p ~/.ssh
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
- git config --global user.name "Gitlab CI"
- git config --global user.email [email protected]
- git remote set-url origin [email protected]:cyfronet/rimrock.git
- git checkout master
- git fetch
- git reset --hard origin/master
- mvn -B -Dmaven.repo.local=/cache/.m2/repository build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.nextMinorVersion}.0 versions:commit
- export version=`printf 'RIMROCK_VERSION=${project.version}' | mvn -Dmaven.repo.local=/cache/.m2/repository help:evaluate | grep RIMROCK_VERSION | sed "s/RIMROCK_VERSION=//"`
- export date=`date +%Y-%m-%d`
- echo "Evaluated version and date are $version and $date"
- sed -i "s/unreleased/$version/" CHANGELOG
- git add CHANGELOG pom.xml
- git commit -m "release $version"
- git tag -a "$version" -m "release $version"
- sed -i '1i\v unreleased\n' CHANGELOG
- mvn -B -Dmaven.repo.local=/cache/.m2/repository build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion}-SNAPSHOT versions:commit
- git add CHANGELOG pom.xml
- export version=`printf 'RIMROCK_VERSION=${project.version}' | mvn -Dmaven.repo.local=/cache/.m2/repository help:evaluate | grep RIMROCK_VERSION | sed "s/RIMROCK_VERSION=//"`
- git commit -m "next development cycle for $version"
- git push origin master
- git push origin --tags
api_release:
stage: deploy
only:
- master
when: manual
script:
- eval $(ssh-agent -s)
- ssh-add <(echo "$SSH_RW_KEY")
- mkdir -p ~/.ssh
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
- git config --global user.name "Gitlab CI"
- git config --global user.email [email protected]
- git remote set-url origin [email protected]:cyfronet/rimrock.git
- git checkout master
- git fetch
- git reset --hard origin/master
- mvn -B -Dmaven.repo.local=/cache/.m2/repository build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.nextMajorVersion}.0.0 versions:commit
- export version=`printf 'RIMROCK_VERSION=${project.version}' | mvn -Dmaven.repo.local=/cache/.m2/repository help:evaluate | grep RIMROCK_VERSION | sed "s/RIMROCK_VERSION=//"`
- export date=`date +%Y-%m-%d`
- echo "Evaluated version and date are $version and $date"
- sed -i "s/unreleased/$version/" CHANGELOG
- git add CHANGELOG pom.xml
- git commit -m "release $version"
- git tag -a "$version" -m "release $version"
- sed -i '1i\v unreleased\n' CHANGELOG
- mvn -B -Dmaven.repo.local=/cache/.m2/repository build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion}-SNAPSHOT versions:commit
- git add CHANGELOG pom.xml
- export version=`printf 'RIMROCK_VERSION=${project.version}' | mvn -Dmaven.repo.local=/cache/.m2/repository help:evaluate | grep RIMROCK_VERSION | sed "s/RIMROCK_VERSION=//"`
- git commit -m "next development cycle for $version"
- git push origin master
- git push origin --tags