forked from RodrigoMoOr/sut-cs-sem6-sp-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bitbucket-pipelines.yml
76 lines (72 loc) · 2.25 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
# Image of NodeJS to be use (general for all pipeline)
image: node:16.14.2
pipelines:
branches:
# CI pipeline that will run on all feature branches
feature/*:
- step:
name: Run Unit Tests
caches:
- node
# script list of commands that are executed in sequence:
# Installing all dependencies
# Running the automated test from project
script:
- npm install
- npm run test
# CI Pipeline that will run on develop branch (when PRs are merged from feature branches -> develop)
develop:
- step:
name: Run Unit Tests
# Using a cache the dependecies are downloaded once to atlasian's servers and then locally loaded into the build each time
caches:
- node
script:
- npm install
- npm run test
# TODO: Commented while we figure out how to run 2e2 tests in Bitbucket pipeline container
# - step:
# name: Run End-to-End Test
# script:
# - npm run test:e2e
- step:
name: Compile Application
caches:
- node
script:
- npm install
- npm run build
# CD Pipeline to deploy app to Heroku
master:
- step:
name: Run Unit Tests
caches:
- node
script:
- npm install
- npm run test
- step:
name: Compile Application
caches:
- node
script:
- npm install
- npm run build
- step:
name: Create App Artifact for Deployment
script:
#Creating archive for solution
- tar czfv application.tgz dist/
- step:
name: Deploy to Heroku
deployment: production
caches:
- node
script:
- pipe: atlassian/heroku-deploy:0.1.1
variables:
HEROKU_API_KEY: $HEROKU_API_KEY
HEROKU_APP_NAME: $HEROKU_APP_NAME
#The value of the ZIP_FILE variable is a path
#to the tar.gz file containing a valid Heroku application sources
ZIP_FILE: 'application.tgz'