forked from ct-js/ct-js-old
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
72 lines (65 loc) · 1.65 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
default:
image: cosmomyzrailgorynych/docker-nw-builder:node-20
# Caching settigns for NPM, according to https://docs.gitlab.com/ee/ci/caching/index.html#cache-nodejs-dependencies
before_script:
- npm ci --cache .npm --prefer-offline
cache:
key: $CI_COMMIT_REF_SLUG
paths:
- node_modules
- app/node_modules
- .npm/
stages:
- test
- pack
workflow:
rules:
# Skip WIPs
- if: $CI_COMMIT_MESSAGE =~ /WIP/
when: never
# Include PRs
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
# Skip duplication for merge requests to develop, master, v1.x
- if: '$CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS'
when: never
# Include develop, master, v1.x direct pushes
- if: $CI_COMMIT_BRANCH == "develop"
- if: $CI_COMMIT_BRANCH == "master"
- if: $CI_COMMIT_BRANCH == "v1.x"
# For testing
- if: $CI_COMMIT_BRANCH == "gitlab-ci"
preinstall:
stage: .pre
script:
- "npm install"
- "gulp -f devSetup.gulpfile.js"
lint:
needs: ["preinstall"]
stage: test
script:
- gulp lint
build:
needs: ["preinstall"]
stage: test
script:
- gulp build
pack-deploy-release:
tags: [ "saas-linux-medium-amd64" ]
stage: pack
needs: ["lint", "build"]
script:
- gulp -f devSetup.gulpfile.js
- gulp deploy --buildNum=$CI_COMMIT_TAG
only:
- tags
- master
pack-deploy-nightly:
stage: pack
needs: ["lint", "build"]
rules:
- if: $CI_COMMIT_BRANCH == "develop"
script:
- npm i -g gulp-cli
- gulp -f devSetup.gulpfile.js
- gulp packages --nightly --buildNum=$CI_COMMIT_SHORT_SHA
- gulp deployItchOnly --nightly --buildNum=$CI_COMMIT_SHORT_SHA