-
Notifications
You must be signed in to change notification settings - Fork 4
/
.gitlab-ci.yml
80 lines (75 loc) · 2.08 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
image: node:12.19.0
stages:
- install
- test
- build
- deploy
install:
stage: install
script:
- cd frontend
- npm install @angular/cli
- npm install
artifacts:
expire_in: 2 weeks
paths:
- frontend/node_modules/
cache:
paths:
- frontend/node_modules/
test:nglint:
stage: test
dependencies:
- install
script:
- cd frontend
- npm run lint:ci
build:
stage: build
dependencies:
- test:nglint
before_script:
- apt-get update -qy
- apt-get -y install zip unzip
script:
- cd frontend
- npm install @angular/cli
- npm install @angular-devkit/build-angular
- npm run build
- cd ..
- mkdir -p /tmp/Fecalface-pack/frontend
- cp -r backend /tmp/Fecalface-pack
- cp requirements.txt /tmp/Fecalface-pack
- cp -r frontend/dist /tmp/Fecalface-pack/frontend
- mv /tmp/Fecalface-pack/backend/.README.md /tmp/Fecalface-pack/README.md
- cd /tmp
- zip -r latest.zip ./Fecalface-pack
- mv /tmp/latest.zip "$CI_PROJECT_DIR"
- cd $CI_PROJECT_DIR
artifacts:
expire_in: 2 weeks
paths:
- latest.zip
only:
- master
deploy:
stage: deploy
before_script:
- 'command -v ssh-agent >/dev/null || ( apt-get update -y && apt-get install openssh-client -y )'
- eval $(ssh-agent -s)
- ssh-add <(echo "$SSH_PRIVATE_KEY")
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
script:
- git config --global user.email "${GITLAB_USER_EMAIL}"
- git config --global user.name "${GITLAB_USER_NAME}"
- git clone git@gitlab.com:kennbroorg/shit-bucket/fecalface-page.git /tmp/page
- cp latest.zip /tmp/page/file/latest.zip
- cd /tmp/page
- git add file/latest.zip
- git commit -m "Fecalface ZIP file from $CI_COMMIT_SHORT_SHA" || echo "No changes, nothing to commit!"
- git remote rm origin && git remote add origin git@gitlab.com:kennbroorg/shit-bucket/fecalface-page.git
- git push origin master
only:
- master