This repository has been archived by the owner on Feb 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gitlab-ci.yml
58 lines (56 loc) · 1.93 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
variables:
REGISTRY: gcr.io/walrus-network
MAVEN_CLI_OPTS: "-s .m2/settings.xml --batch-mode"
MAVEN_OPTS: "-Dmaven.repo.local=/data/.m2/repository"
stages:
- maven
- docker
maven:
image: openjdk:8-jdk-alpine
stage: maven
artifacts:
paths:
- jars
before_script:
- apk add patch make ca-certificates openssl python maven --update
# Install CA certs, openssl to https downloads, python for gcloud sdk
- update-ca-certificates
# Write our GCP service account private key into a file
- export GOOGLE_APPLICATION_CREDENTIALS=$GCLOUD_SERVICE_KEY
# Download and install Google Cloud SDK
- wget https://dl.google.com/dl/cloudsdk/release/google-cloud-sdk.tar.gz
- tar zxvf google-cloud-sdk.tar.gz && ./google-cloud-sdk/install.sh --usage-reporting=false --path-update=true
- google-cloud-sdk/bin/gcloud --quiet components update
- google-cloud-sdk/bin/gcloud auth activate-service-account --key-file $GCLOUD_SERVICE_KEY
- google-cloud-sdk/bin/gcloud config set project walrus-network
script:
- mvn $MAVEN_CLI_OPTS compile
- mvn $MAVEN_CLI_OPTS deploy
- sh populate.sh
only:
- master
retry:
max: 2
when: stuck_or_timeout_failure
docker:
image: docker:latest
stage: docker
dependencies:
- maven
services:
- docker:dind
variables:
DOCKER_TLS_CERTDIR: "/certs"
before_script:
- docker login -u _json_key --password-stdin https://gcr.io < $GCLOUD_SERVICE_KEY
script:
- docker build -t minecraft:base --build-arg CI_JOB_TOKEN .
- docker build -f Dockerfile-bukkit -t $REGISTRY/minecraft/bukkit-$CI_COMMIT_REF_SLUG --build-arg CI_JOB_TOKEN .
- docker build -f Dockerfile-bungee -t $REGISTRY/minecraft/bungee-$CI_COMMIT_REF_SLUG --build-arg CI_JOB_TOKEN .
- docker push $REGISTRY/minecraft/bukkit-$CI_COMMIT_REF_SLUG
- docker push $REGISTRY/minecraft/bungee-$CI_COMMIT_REF_SLUG
only:
- master
retry:
max: 2
when: script_failure