-
Notifications
You must be signed in to change notification settings - Fork 22
/
.gitlab-ci.yml
68 lines (61 loc) · 1.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
variables:
COURSIER_CACHE: cache/.coursier
default:
image: nafg/docker-sbt
cache:
key: default
paths:
- cache
.sbt_alias: &sbt_alias |-
shopt -s expand_aliases
alias sbt='sbt -v -sbt-dir cache/.sbt/launchers -sbt-boot cache/.sbt/boot -ivy cache/.ivy2 -Dslick.testkit-config=test-dbs/testkit-gitlab.conf'
stages:
- test
- automerge
- release
test:
stage: test
rules:
- when: always
variables:
POSTGRES_PASSWORD: 1234
MYSQL_ROOT_PASSWORD: 1234
services:
- postgres:latest
- mysql
script:
- *sbt_alias
- sbt +test
after_script:
automerge:
stage: automerge
rules:
- if: $CI_MERGE_REQUEST_IID && $CI_MERGE_REQUEST_SOURCE_PROJECT_PATH =~ /scala-steward//
variables:
GIT_STRATEGY: none
dependencies: []
cache: {}
script:
- BASE_URL="$CI_API_V4_URL/projects/$CI_PROJECT_ID/merge_requests/$CI_MERGE_REQUEST_IID/merge?merge_when_pipeline_succeeds=true"
- FULL_URL="$BASE_URL&private_token=$PAT_AUTOMERGE_SCALA_STEWARD"
- curl -X PUT $FULL_URL
publish to sonatype:
stage: release
rules:
- if: $CI_COMMIT_TAG =~ /^v\d/
script:
- *sbt_alias
- env PGP_PASSPHRASE="$(echo -n $PGP_PASSPHRASE_BASE64 | base64 -d)" sbt ci-release
create release in gitlab:
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
rules:
- if: $CI_COMMIT_TAG =~ /^v\d/
dependencies: []
cache: {}
script:
- echo 'running release_job'
release:
name: 'Release $CI_COMMIT_TAG'
description: 'Release $CI_COMMIT_TAG'
tag_name: '$CI_COMMIT_TAG'