-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
177 lines (167 loc) · 6.56 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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
stages:
- prepare
- build_and_test
- deploy
cache:
key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
paths:
- .m2/repository/
- target/
variables:
RELEASE_HUB_PROJECT: jaybird
CI_URL: ${CI_PROJECT_URL}/pipelines/${CI_PIPELINE_ID}
TAG_BRANCH: master
MAVEN_CLI_OPTS: "-s .m2/settings.xml --batch-mode -U"
MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository"
RDB3_VERSION: "3.0.18"
RDB5_VERSION: "5.0.1"
RDB6_VERSION: "6.0.0-SNAPSHOT.735"
MAVEN_VERSION: "3.9.4"
http_proxy: http://git.red-soft.biz:3128
https_proxy: http://git.red-soft.biz:3128
no_proxy: localhost,172.0.0.0/8,127.0.0.0/8,.red-soft.biz
.prepare_template: &prepare_template
tags:
- docker
- builder
- x86_64
stage: prepare
image: openjdk:8-jdk-alpine
script:
- mkdir .ci
- echo ${VERSION} > .ci/version
- echo ${BRANCH} > .ci/branch
- echo ${CONTEXT} > .ci/context
- mvn $MAVEN_CLI_OPTS releasehub-build:register -Pdeploy-internal -DreleaseHubBuildOnlyCreate -DreleaseHubBuildVersion=$VERSION -DreleaseHubBuildContext=${CONTEXT} -DreleaseHubBuildBranch=${BRANCH} -DreleaseHubBuildCommit=${CI_COMMIT_SHA} -DreleaseHubBuildCIURL=${CI_URL}
artifacts:
expire_in: 1 day
paths:
- .ci/
prepare:snapshot:
<<: *prepare_template
before_script:
- apk --update add maven
- REAL_VERSION=$(mvn $MAVEN_CLI_OPTS -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec)
- VERSION=$(mvn $MAVEN_CLI_OPTS -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec|sed 's/\(.*\)-.*/\1/')
- "[ \"$REAL_VERSION\" = \"${VERSION}-SNAPSHOT\" ] || (echo Stopping build. Expected ${VERSION}-SNAPSHOT version. Create tag for this commit!; exit 1)"
- export BUILDNO=$(mvn $MAVEN_CLI_OPTS -q --non-recursive releasehub-build:buildno -Pdeploy-internal -DreleaseHubBuildVersion=${VERSION}-SNAPSHOT)
- export VERSION=${VERSION}-SNAPSHOT.${BUILDNO}
- export BRANCH=${CI_COMMIT_REF_NAME}
- export CONTEXT=commit
except:
- tags
prepare:release:
<<: *prepare_template
before_script:
- apk --update add maven
- VERSION_IN_POM=$(mvn -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec)
- export VERSION=$(echo ${CI_COMMIT_TAG}|sed 's/v//')
- export BRANCH=${TAG_BRANCH}
- export CONTEXT=tag
- "[ \"$VERSION\" = \"$VERSION_IN_POM\" ] || (echo Project version in pom.xml and tag do not match!; exit 1)"
only:
- tags
.deploy_template: &deploy_template
image:
name: openjdk:17-jdk-buster
entrypoint: []
tags:
- docker
- builder
- x86_64
stage: deploy
before_script:
- export VERSION=`cat .ci/version`
- export BRANCH=`cat .ci/branch`
- export CONTEXT=`cat .ci/context`
- wget https://dlcdn.apache.org/maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz
- tar -xvf apache-maven-$MAVEN_VERSION-bin.tar.gz
- mv apache-maven-$MAVEN_VERSION /opt/
- M2_HOME='/opt/apache-maven-$MAVEN_VERSION'
- PATH="$M2_HOME/bin:$PATH"
- export PATH
- ln -s /opt/apache-maven-$MAVEN_VERSION/bin/mvn /usr/bin/mvn
- mkdir -p /usr/lib/jvm/ && ln -s /usr/local/openjdk-17/ /usr/lib/jvm/java-17-openjdk-amd64
build_and_test:
tags:
- docker
- tester
- x86_64
stage: build_and_test
variables:
JAVA_HOME: /usr/java17
image:
name: registry.red-soft.biz:5000/docker-images/rdbbuildenv:rdb6-1
before_script:
- |
if [[ "${RDB_VERSION:0:1}" -eq "6" ]]; then
export RDB_MAJOR_VERSION="6"
export REPORT_PREFIX=rdb6_${REPORT_PREFIX}
elif [[ "${RDB_VERSION:0:1}" -eq "5" ]]; then
export RDB_MAJOR_VERSION="5"
export REPORT_PREFIX=rdb5_${REPORT_PREFIX}
elif [[ "${RDB_VERSION:0:1}" -eq "3" ]]; then
export RDB_MAJOR_VERSION="3"
export REPORT_PREFIX=rdb3_${REPORT_PREFIX}
export EXTRA_DEPENDENCIES="$EXTRA_DEPENDENCIES"
else
die "Do not know how to test RDB ${RDB_VERSION}"
fi
- echo proxy=$http_proxy >> /etc/yum.conf
- yum install -y krb5-server krb5-workstation expect git $EXTRA_DEPENDENCIES
- wget https://dlcdn.apache.org/maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz && tar -xvf apache-maven-$MAVEN_VERSION-bin.tar.gz && mv apache-maven-$MAVEN_VERSION /opt/
- ln -s /opt/apache-maven-$MAVEN_VERSION/bin/mvn /usr/bin/mvn
- wget https://download.oracle.com/java/17/archive/jdk-17.0.12_linux-x64_bin.rpm && rpm -Uvh jdk-17.0.12_linux-x64_bin.rpm
- wget https://dl.min.io/client/mc/release/linux-amd64/archive/mcli-20210613174822.0.0.x86_64.rpm && rpm -Uvh mcli-20210613174822.0.0.x86_64.rpm
- /opt/cprocsp/sbin/amd64/cpconfig -license -set $LICENSE_CRYPTOPRO4
- ./ci/configure_kerberos.sh
- export VERSION=`cat .ci/version`
- ln -s `update-alternatives --display java | sed -n '2p;3q' | awk -F\" '{split($1, v, " ");printf("%s", v[5])}' | awk '{ NF -= 2 } 1' FS=/ OFS=/` /usr/java17
script:
- ./ci/test.sh
parallel:
matrix:
- TYPE: JDK17
TEST_JAVA_JVM: /usr/java17/bin/java
GDS_TYPE: "PURE_JAVA"
RDB_VERSION: [ $RDB3_VERSION, $RDB5_VERSION, $RDB6_VERSION ]
- TYPE: JDK17_fboonative_only
TEST_JAVA_JVM: /usr/java17/bin/java
GDS_TYPE: "FBOONATIVE"
REPORT_PREFIX: jdk17_fboonative_
RDB_VERSION: $RDB6_VERSION
- TYPE: JDK17_native_only
TEST_JAVA_JVM: /usr/java17/bin/java
GDS_TYPE: "NATIVE"
REPORT_PREFIX: jdk17_native_
RDB_VERSION: $RDB6_VERSION
- TYPE: JDK17_fbooembedded_only
TEST_JAVA_JVM: /usr/java17/bin/java
GDS_TYPE: "FBOOEMBEDDED"
REPORT_PREFIX: jdk17_fbooembedded_
RDB_VERSION: $RDB6_VERSION
- TYPE: JDK17_embedded_only
TEST_JAVA_JVM: /usr/java17/bin/java
GDS_TYPE: "EMBEDDED"
REPORT_PREFIX: jdk17_embedded_
RDB_VERSION: $RDB6_VERSION
deploy:internal:
<<: *deploy_template
stage: deploy
script:
- mvn $MAVEN_CLI_OPTS deploy -Pdeploy-internal -Dmaven.test.skip.exec -DreleaseHubBuildVersion=$VERSION
- mvn $MAVEN_CLI_OPTS --non-recursive releasehub-build:publish -Pdeploy-internal -DreleaseHubBuildVersion=$VERSION
deploy:nexus_snapshots:
<<: *deploy_template
stage: deploy
script:
- mvn $MAVEN_CLI_OPTS deploy -Pdeploy-nexus-snapshots -Dmaven.test.skip.exec
except:
- tags
deploy:nexus_releases:
<<: *deploy_template
stage: deploy
script:
- mvn $MAVEN_CLI_OPTS deploy -Pdeploy-nexus-releases -Dmaven.test.skip.exec
only:
- tags