-
-
Notifications
You must be signed in to change notification settings - Fork 79
/
.gitlab-ci.yml
61 lines (55 loc) · 1.52 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
image: node:18
cache:
paths:
- node_modules/
variables:
AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
S3_BUCKET: $S3_BUCKET
S3_PATH: $S3_PATH
ALPHA_SITE: $ALPHA_SITE
ALPHA_PATH: $ALPHA_PATH
ALPHA_BRANCH: $ALPHA_BRANCH
#This declares the pipeline stages
stages:
- prepare
- build
prepare:
only:
variables:
- $CI_COMMIT_BRANCH == $ALPHA_BRANCH
changes:
- module-alpha.json
stage: prepare
script:
- echo "BUILD_TIME=$(date +%Y%m%d%H%M%S)" > vars.env
- echo "VERSION=$(node ./.gitlab/get-alpha-version.js)" >> vars.env
artifacts:
reports:
dotenv: vars.env
build:
only:
variables:
- $CI_COMMIT_BRANCH == $ALPHA_BRANCH
changes:
- module-alpha.json
stage: build
script:
- apt-get update; apt-get -y install zip unzip awscli jq
- npm ci
- npm run build
- echo "$(node ./.gitlab/build-alpha-module.js | jq .)"
- node ./.gitlab/build-alpha-module.js | jq . > module.json
- ./icon.sh
- zip -r ./ddb-importer.zip module.json dist icons handlebars css img lang data vendor macros LICENSE.md
- aws s3 cp ./ddb-importer.zip s3://$S3_BUCKET/$S3_PATH/ --cache-control no-cache
- aws s3 cp ./module.json s3://$S3_BUCKET/$S3_PATH/ --cache-control no-cache
- echo "Manifest located at $(node ./.gitlab/get-manifest-path.js)"
artifacts:
public: false
paths:
- module.json
- ddb-importer.zip
untracked: false
expire_in: 14 days