-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
55 lines (52 loc) · 1.28 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
image: framasoft/vuefs:latest
stages:
- test
- deploy
test:
stage: test
script:
- npm install -g yaml-lint
- for f in $(find ./app/ -name "*.yml" -type f);do echo $f; yamllint $f;done;
pages:
stage: deploy
script:
- npm install
- npm run preview
- mv -f public/$CI_PROJECT_NAME/* public
- find public -type f -iregex '.*\.\(htm\|html\|txt\|text\|js\|css\)$' -execdir gzip -f --keep {} \;
artifacts:
paths:
- public
cache:
paths:
- node_modules/
only:
refs:
- master
except:
variables:
- $DEPLOYEMENT_KEY
- $DEPLOYEMENT_KNOWN_HOSTS
- $DEPLOYEMENT_USER
- $DEPLOYEMENT_HOST
production:
stage: deploy
script:
- npm install
- npm run prod
- cp ./public/fr/index.html ./public/index.html
- for f in $(find -type l);do cp --remove-destination $(readlink -f $f) $f;done;
- mkdir "${HOME}/.ssh"
- chmod 700 "${HOME}/.ssh"
- echo -e "${DEPLOYEMENT_KNOWN_HOSTS}" > ${HOME}/.ssh/known_hosts;
- eval `ssh-agent -s`
- ssh-add <(echo "${DEPLOYEMENT_KEY}" | base64 --decode -i);
- echo "put -r public/* ${DEPLOYEMENT_USER}/" | sftp ${DEPLOYEMENT_USER}@${DEPLOYEMENT_HOST};
only:
refs:
- master
variables:
- $DEPLOYEMENT_KEY
- $DEPLOYEMENT_KNOWN_HOSTS
- $DEPLOYEMENT_USER
- $DEPLOYEMENT_HOST