This repository has been archived by the owner on Nov 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
61 lines (56 loc) · 1.82 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
stages:
- build_tar
- upload_tar
- trigger_ami_build
.tags: &tags
tags:
- csiro-vm
build_tar:
<<: *tags
image: node:boron
cache:
paths:
- ~/.npm
stage: build_tar
script:
- DESCRIBE=$(git describe)
- echo ${DESCRIBE} > describe
- BRANCH=$(git rev-parse --abbrev-ref HEAD)
- echo ${BRANCH} > branch
- npm install && npm install
- ./node_modules/gulp/bin/gulp.js release
- tar -czf aremi-natmap-${BRANCH}-${DESCRIBE}.tar.gz serverconfig.json package.json node_modules wwwroot && echo
artifacts:
paths:
- "aremi-natmap-*.tar.gz"
- describe
- branch
upload_tar:
<<: *tags
image: docker-registry.it.csiro.au/aremi/aremi-s3-uploader
dependencies:
- build_tar
stage: upload_tar
allow_failure: false
script:
- DESCRIBE=$(cat ./describe)
- BRANCH=$(cat ./branch)
- aws configure set aws_access_key_id ${access_key}
- aws configure set aws_secret_access_key ${secret_key}
- aws s3 cp aremi-natmap-${BRANCH}-${DESCRIBE}.tar.gz s3://aremi-ci-apps/aremi-natmap-${BRANCH}-${DESCRIBE}.tar.gz
artifacts:
paths:
- describe
- branch
trigger_ami_build:
<<: *tags
image: docker-registry.it.csiro.au/aremi/aremi-ami-builder
dependencies:
- upload_tar
stage: trigger_ami_build
script:
- DESCRIBE=$(cat ./describe)
- BRANCH=$(cat ./branch)
- TAR=aremi-natmap-${BRANCH}-${DESCRIBE}.tar.gz
- curl -s -X POST -F token=${aremi_cloud_token} -F ref=master -F variables[tar]=${TAR} -F variables[access_key]=${access_key} -F variables[secret_key]=${secret_key} -F variables[tag]=${DESCRIBE} "https://data61.githost.io/api/v4/projects/39/trigger/pipeline" > /dev/null
- echo "Triggered a build on another repository. Check https://data61.githost.io/TerriaJS/aremi-cloud/pipelines to find the build. Logs will continue there."