-
Notifications
You must be signed in to change notification settings - Fork 7
/
.gitlab-ci.yml
178 lines (167 loc) · 5.66 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:
- version
- test
- build
- publish
# - doc-build
# - doc-serve
- release
variables:
GIT_SUBMODULE_STRATEGY: recursive
VERSION_FILE: version.sh
GIT_DEPTH: 500
JDK_VERSION: 11.0.11.hs-adpt
SBT_VERSION: 1.3.10
SPHINX_VERSION: 3.2.1
DOCKER_VERSION: 19.03.12
SCALA_MAJOR_VERSION: 2
SCALA_MINOR_VERSION: 12
GKL_VERSION: 0.8.8
HADOOP_BAM_VERSION: 8.0.1-SNAPSHOT
DISQ_VERSION: 0.3.9-SNAPSHOT
# --------------------------------- STAGE: version ---------------------------------------------------------------------
version-branch:
stage: version
image:
name: mdomke/git-semver:v4.0.1
entrypoint: [""]
script:
- cd /builds/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME && git-semver --format x.y.z+m | sed -e 's/$/-SNAPSHOT/g' | xargs -I {} echo "export VERSION={}" > $VERSION_FILE
- cat $VERSION_FILE
artifacts:
paths:
- $VERSION_FILE
tags: [ docker ]
except: [ master, tags ]
version-tag:
stage: version
image:
name: mdomke/git-semver:v4.0.1
entrypoint: [""]
script:
- cd /builds/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME && git-semver --no-hash --no-pre | xargs -I {} echo "export VERSION={}" > $VERSION_FILE
- cat $VERSION_FILE
artifacts:
paths:
- $VERSION_FILE
tags: [ docker ]
only:
- tags
except:
- branches
test:
stage: test
image:
name: biodatageeks/jdk-sbt:$JDK_VERSION-$SBT_VERSION
variables:
SBT_OPTS: "-Dsbt.ivy.home=sbt-cache/ivy"
cache:
key: $CI_PROJECT_PATH
paths:
- "sbt-cache/ivy/cache"
before_script:
- source $VERSION_FILE
script:
- sbt clean test
except: [ master ]
tags: [ docker ]
build:
stage: build
image:
name: biodatageeks/jdk-sbt:$JDK_VERSION-$SBT_VERSION
variables:
SBT_OPTS: "-Dsbt.ivy.home=sbt-cache/ivy"
cache:
key: $CI_PROJECT_PATH
paths:
- "sbt-cache/ivy/cache"
before_script:
- source $VERSION_FILE
script:
- sbt clean package
- ./merge_jars.sh
/builds/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME/lib/gkl-$GKL_VERSION-darwin-SNAPSHOT.jar
/builds/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME/target/scala-$SCALA_MAJOR_VERSION.$SCALA_MINOR_VERSION/sequila_$SCALA_MAJOR_VERSION.$SCALA_MINOR_VERSION-$VERSION.jar
- ./merge_jars.sh
/builds/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME/lib/hadoop-bam-$HADOOP_BAM_VERSION.jar
/builds/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME/target/scala-$SCALA_MAJOR_VERSION.$SCALA_MINOR_VERSION/sequila_$SCALA_MAJOR_VERSION.$SCALA_MINOR_VERSION-$VERSION.jar
- ./merge_jars.sh
/builds/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME/lib/disq-$DISQ_VERSION.jar
/builds/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME/target/scala-$SCALA_MAJOR_VERSION.$SCALA_MINOR_VERSION/sequila_$SCALA_MAJOR_VERSION.$SCALA_MINOR_VERSION-$VERSION.jar
artifacts:
paths:
- /builds/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME/target/scala-$SCALA_MAJOR_VERSION.$SCALA_MINOR_VERSION/
tags: [ docker ]
except: [ master ]
publish:
stage: publish
image:
name: biodatageeks/jdk-sbt:$JDK_VERSION-$SBT_VERSION
variables:
SBT_OPTS: "-Dsbt.ivy.home=sbt-cache/ivy -Dcom.sun.net.ssl.checkRevocation=false"
cache:
key: $CI_PROJECT_PATH
paths:
- "sbt-cache/ivy/cache"
before_script:
- source $VERSION_FILE
script:
- ls -ltra /root/.ivy2/
- mv /builds/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME/target/scala-$SCALA_MAJOR_VERSION.$SCALA_MINOR_VERSION/sequila*jar /tmp
- sbt publishLocal
- mv /tmp/sequila*jar /builds/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME/target/scala-$SCALA_MAJOR_VERSION.$SCALA_MINOR_VERSION/
- sbt publish
tags: [ docker ]
except: [ master, tags ]
release:
stage: release
image:
name: biodatageeks/jdk-sbt:$JDK_VERSION-$SBT_VERSION
variables:
SBT_OPTS: "-Dsbt.ivy.home=sbt-cache/ivy"
cache:
key: $CI_PROJECT_PATH
paths:
- "sbt-cache/ivy/cache"
before_script:
- source $VERSION_FILE
script:
- cd /builds/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME
- mv /builds/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME/target/scala-$SCALA_MAJOR_VERSION.$SCALA_MINOR_VERSION/sequila*jar /tmp
- sbt publish
- mv /tmp/sequila*jar /builds/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME/target/sonatype-staging/$VERSION/org/$CI_PROJECT_NAMESPACE/${CI_PROJECT_NAME}_${SCALA_MAJOR_VERSION}.${SCALA_MINOR_VERSION}/$VERSION/
- find /builds/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME/target/sonatype-staging/ -name "$CI_PROJECT_NAME*.jar" -o -name "$CI_PROJECT_NAME*.pom" | xargs -I {} sh -c "sha1sum {} > {}.sha1"
- find /builds/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME/target/sonatype-staging/ -name "$CI_PROJECT_NAME*.jar" -o -name "$CI_PROJECT_NAME*.pom" | xargs -I {} sh -c "md5sum {} > {}.md5"
- find /builds/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME/target/sonatype-staging/ -name "$CI_PROJECT_NAME*.jar" -o -name "$CI_PROJECT_NAME*.pom" | xargs -I {} sh -c "echo $PGP_PASSPHRASE | PASSPHRASE=$PGP_PASSPHRASE gpg --detach-sign --armor --use-agent --pinentry-mode loopback --command-fd 0 --output {}.asc {}"
- sbt sonatypeBundleRelease
tags: [ docker ]
only:
- tags
except:
- branches
when: manual
#doc-build:
# stage: doc-build
# image:
# name: "sphinxdoc/sphinx:$SPHINX_VERSION"
# before_script:
# - pip install -U sphinx_rtd_theme rst2pdf sphinxcontrib-github_ribbon "sphinxcontrib-bibtex<2.0.0"
# - source $VERSION_FILE
# script:
# - cd docs && ./docs.sh html
# artifacts:
# paths:
# - /builds/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME/docs/build/
# tags: [ docker ]
# except: [ master]
#
#doc-serve:
# stage: doc-serve
# image:
# name: docker:$DOCKER_VERSION
# before_script:
# - source $VERSION_FILE
# script:
# - ./build_docs.sh
# tags: [ docker ]
# except: [ master]