forked from kennbroorg/poorskeme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
87 lines (82 loc) · 2.37 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
stages:
- install
- build
- upload
- release
# - deploy
variables:
PACKAGE_REGISTRY_URL: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/${CI_PROJECT_NAME}/${CI_COMMIT_TAG}"
install:
stage: install
image: node:14.18.2
rules:
- if: $CI_COMMIT_TAG # Run this job when a tag is created manually
script:
- cd frontend
- npm install @angular/cli
- npm install
artifacts:
expire_in: 2 weeks
paths:
- frontend/node_modules/
cache:
paths:
- frontend/node_modules/
# only:
# - master
build:
stage: build
image: node:14.18.2
rules:
- if: $CI_COMMIT_TAG # Run this job when a tag is created manually
dependencies:
- install
before_script:
- apt-get update -qy
- apt-get -y install zip unzip
- echo $CI_JOB_ID
# Writing GE_JOB_ID variable to environment file, will need the value in the next stage.
script:
- cd frontend
- npm install @angular/cli
- npm install @angular-devkit/build-angular
- npm run build --prod
- cd ..
- mkdir -p /tmp/poorSKeme/frontend
# TODO : README
- cp poorSKeme.py /tmp/poorSKeme
- cp api_poorSKeme.py /tmp/poorSKeme
- cp requirements.txt /tmp/poorSKeme
- cp API.yaml /tmp/poorSKeme
- cp -r frontend/dist /tmp/poorSKeme/frontend
# - mv /tmp/iKy-pack/backend/.README.md /tmp/iKy-pack/README.md
- cd /tmp
- zip -r poorSKeme.zip ./poorSKeme
- mv /tmp/poorSKeme.zip "$CI_PROJECT_DIR"
- cd $CI_PROJECT_DIR
artifacts:
expire_in: 2 weeks
paths:
- poorSKeme.zip
# - /tmp/poorSKeme.zip
upload:
stage: upload
image: curlimages/curl:latest
dependencies:
- build
rules:
- if: $CI_COMMIT_TAG
script:
- echo ${CI_JOB_TOKEN}
- echo ${PACKAGE_REGISTRY_URL}
- |
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file poorSKeme.zip "${PACKAGE_REGISTRY_URL}/poorSKeme.zip"
release:
image: registry.gitlab.com/gitlab-org/release-cli:latest
stage: release
dependencies:
- upload
rules:
- if: $CI_COMMIT_TAG # Run this job when a tag is created manually
script:
- release-cli create --name "Release $CI_COMMIT_TAG" --tag-name $CI_COMMIT_TAG --assets-link "{\"name\":\"poorSKeme.zip\",\"url\":\"${PACKAGE_REGISTRY_URL}/poorSKeme.zip\"}"