-
Notifications
You must be signed in to change notification settings - Fork 0
/
bitbucket-pipelines.yml
53 lines (51 loc) · 2.07 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
image: node:18.17.0
pipelines:
branches:
master:
- step:
caches:
- node
name: Build
script:
- npm install
- npm run build
- export TZ='GMT-3'
- echo 'GMT-3' > /etc/timezone
- echo -en "Date - `date`\nBitbucket Build Version - ${BITBUCKET_BUILD_NUMBER}\nBitbucket Commit ID - ${BITBUCKET_COMMIT}\nButbucket Branch - ${BITBUCKET_BRANCH}\nBitBucket Repo UUID - ${BITBUCKET_REPO_UUID}\nBitBucket Repo Full Name - ${BITBUCKET_REPO_FULL_NAME}" >> dist/version.txt
artifacts:
- dist/**
- step:
name: Deploy
deployment: prod
script:
- pipe: atlassian/rsync-deploy:0.5.0 # fetch updates
variables:
USER: $USER
SERVER: $IP
REMOTE_PATH: /opt/dex/src/frontend
LOCAL_PATH: dist/
EXTRA_ARGS: '-az --exclude-from=${BITBUCKET_CLONE_DIR}/.gitignore --exclude-from=${BITBUCKET_CLONE_DIR}/.rsyncignore --no-perms'
'{dev,feature/*}':
- step:
caches:
- node
name: Build
script:
- npm install
- npm run build
- export TZ='GMT-3'
- echo 'GMT-3' > /etc/timezone
- echo -en "Date - `date`\nBitbucket Build Version - ${BITBUCKET_BUILD_NUMBER}\nBitbucket Commit ID - ${BITBUCKET_COMMIT}\nButbucket Branch - ${BITBUCKET_BRANCH}\nBitBucket Repo UUID - ${BITBUCKET_REPO_UUID}\nBitBucket Repo Full Name - ${BITBUCKET_REPO_FULL_NAME}" >> dist/version.txt
artifacts:
- dist/**
- step:
name: Deploy
deployment: dev
script:
- pipe: atlassian/rsync-deploy:0.5.0 # fetch updates
variables:
USER: $USER
SERVER: $IP
REMOTE_PATH: /opt/dex/src/frontend
LOCAL_PATH: dist/
EXTRA_ARGS: '-az --exclude-from=${BITBUCKET_CLONE_DIR}/.gitignore --exclude-from=${BITBUCKET_CLONE_DIR}/.rsyncignore --no-perms'