-
Notifications
You must be signed in to change notification settings - Fork 0
/
bitbucket-pipelines.yml
57 lines (55 loc) · 1.61 KB
/
bitbucket-pipelines.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
definitions:
steps:
- step: &build
name: Build
image: node:14.5.0-alpine
caches:
- node
script:
- npm install
- npm run build
artifacts:
- dist/**
- set: &deleteOldFiles
name: Deleting Old Files
script:
- pipe: atlassian/ssh-run:0.2.4
variables:
SSH_USER: $USER
SERVER: $SERVER
COMMAND: 'rm -rf /var/www/html/*'
DEBUG: 'false'
- step: &uploadToSFTP
name: Upload Generated Files to SFTP
script:
- pipe: atlassian/sftp-deploy:0.5.7
variables:
USER: $SFTP_USERNAME
SERVER: $SFTP_SERVER
PASSWORD: $SFTP_PASSWORD
REMOTE_PATH: $STAGING_DIR
LOCAL_PATH: 'dist/*'
DELETE_FLAG: 'true'
DEBUG: 'true'
SSH_KEY: 'opt/atlassian/pipelines/agent/ssh/id_rsa'
- step: &uploadToSFTPProd
name: Upload Generated Files to SFTP
script:
- pipe: atlassian/sftp-deploy:0.5.7
variables:
USER: $SFTP_USERNAME
SERVER: $SFTP_SERVER
PASSWORD: $SFTP_PASSWORD
REMOTE_PATH: $PRODUCTION_DIR
LOCAL_PATH: 'dist/*'
DELETE_FLAG: 'true'
DEBUG: 'true'
SSH_KEY: 'opt/atlassian/pipelines/agent/ssh/id_rsa'
pipelines:
branches:
staging:
- step: *build
- step: *uploadToSFTP
master:
- step: *build
- step: *uploadToSFTPProd