-
Notifications
You must be signed in to change notification settings - Fork 3
/
bitbucket-pipelines.yml
96 lines (93 loc) · 3.67 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# This is a sample build configuration for Javascript.
# Check our guides at https://confluence.atlassian.com/x/VYk8Lw for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: node:7
pipelines:
default:
- step:
script: # Modify the commands below to build your repository.
- npm install --verbose
- npm test --verbose
- if [ $? -eq 0 ]; then
- npm run deployable --verbose
- bash <(curl -s https://codecov.io/bash)
- scp -r deploy/last-build/* [email protected]:/home/npawdev/qa/catalog/v6/js
- fi
tags:
'*':
- step:
script:
- npm install --verbose
- npm test --verbose
- if [ $? -eq 0 ]; then
- npm run deployable --verbose
- bash <(curl -s https://codecov.io/bash)
- scp -r deploy/version/* [email protected]:/home/npawdev/qa/catalog/v6/js
- fi
custom: # Pipelines that are triggered manually
deploy-to-prod:
- step:
script:
- npm install --verbose
- npm test --verbose
- if [ $? -eq 0 ]; then
# Generate files
- npm run deployable --verbose
# S3
- apt-get update
- apt-get -y install awscli
- mkdir ~/.aws
- echo "[default]" >> ~/.aws/credentials
- echo "aws_access_key_id="$AWS_ACCESS_KEY_ID >> ~/.aws/credentials
- echo "aws_secret_access_key="$AWS_SECRET_ACCESS_KEY >> ~/.aws/credentials
- echo "[default]" >> ~/.aws/config
- echo "region="$AWS_DEFAULT_REGION >> ~/.aws/config
- echo "output=json" >> ~/.aws/config
- aws s3 cp deploy/prod/ s3://youbora-smartplugins/v6/js/ --recursive --acl=public-read
# codecov
- bash <(curl -s https://codecov.io/bash)
# deploy PROD file to qa
- scp -r deploy/prodfile/* [email protected]:/home/npawdev/qa/catalog/v6/js
- fi
npm-publish:
- step:
script:
- npm install --verbose
- npm test --verbose
- if [ $? -eq 0 ]; then
# npm publish
- echo $NPM_TOKEN >> ~/.npmrc
- npm run manifest --verbose
- npm publish --verbose -f
- fi
deployment:
- step:
deployment: production
script:
- npm install --verbose
- npm test --verbose
- if [ $? -eq 0 ]; then
# Generate files
- npm run deployable --verbose
# S3
- apt-get update
- apt-get -y install awscli
- mkdir ~/.aws
- echo "[default]" >> ~/.aws/credentials
- echo "aws_access_key_id="$AWS_ACCESS_KEY_ID >> ~/.aws/credentials
- echo "aws_secret_access_key="$AWS_SECRET_ACCESS_KEY >> ~/.aws/credentials
- echo "[default]" >> ~/.aws/config
- echo "region="$AWS_DEFAULT_REGION >> ~/.aws/config
- echo "output=json" >> ~/.aws/config
- aws s3 cp deploy/prod/ s3://youbora-smartplugins/v6/js/ --recursive --acl=public-read
# codecov
- bash <(curl -s https://codecov.io/bash)
# deploy PROD file to qa
- scp -r deploy/prodfile/* [email protected]:/home/npawdev/qa/catalog/v6/js
# npm publish
- echo $NPM_TOKEN >> ~/.npmrc
- npm run manifest --verbose
- npm publish --verbose -f
- fi