-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy path.gitlab-ci.yml
59 lines (56 loc) · 1.58 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
stages:
- package
- build
- deploy
Package_staging:
image: node
stage: package
script:
- echo "$PACKAGE_FILE_STAGING" > package.json
- ls
- npm install --force
artifacts:
expire_in: 1 week
paths:
- node_modules
only:
- master
Build_staging:
image: node
stage: build
script:
- echo "$ENV_FILE_STAGING" > .env
- echo "$CONFIG_FILE_STAGING" > nuxt.config.js
# - echo "$PACKAGE_FILE_STAGING" > package.json
- ls
# - npm install --force
- npm run build --standalone
artifacts:
expire_in: 1 week
paths:
- .env
- .nuxt
- static
- nuxt.config.js
- package.json
only:
- master
Deploy_staging:
image: alpine
stage: deploy
script:
- apk add --no-cache rsync openssh
- mkdir -p ~/.ssh
- echo "$SSH_PRIVATE_KEY" >> ~/.ssh/id_dsa
- chmod 600 ~/.ssh/id_dsa
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
- rsync -rav --delete .nuxt/ tamannaorange@67.227.213.5:~/np-service.tamanna.orangebd.com/.nuxt
- rsync -rav static/ tamannaorange@67.227.213.5:~/np-service.tamanna.orangebd.com/static
- rsync nuxt.config.js tamannaorange@67.227.213.5:~/np-service.tamanna.orangebd.com/
- rsync package.json tamannaorange@67.227.213.5:~/np-service.tamanna.orangebd.com/
- ssh tamannaorange@67.227.213.5 "cd ~/np-service.tamanna.orangebd.com && rm -f package-lock.json && npm install --force && pm2 restart eService && exit "
environment:
name: production
url: https://np-service.tamanna.orangebd.com
only:
- master