-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbitbucket-pipelines.yml
More file actions
85 lines (77 loc) · 2.84 KB
/
bitbucket-pipelines.yml
File metadata and controls
85 lines (77 loc) · 2.84 KB
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
# Python Automation testing and deploy example
# This template allows you to push your robot from your BitBucket repository to your configured
# Control Room. This configuration will run an automation's unit tests via `rcc` as part of
# any pull request and deploy the project upon merge/commit to the Control Room depending
# on the configured deployments.
# Prerequisites:
# You must configure the following variables within your BitBucket repository settings:
# * $CR_ACCESS_CREDENTIALS: This is the access token for your Control Room account and can be set
# per deployment or globally within your repository.
# * $CR_ENDPOINT_URL: This is the API endpoint per the Control Room API helper for uploading a robot.
# * $ROBOT_ID: This is the ID of the robot within the Control Room Robot UI. You should set this for
# each deployment you have configured.
# * $WORKSPACE_ID: This is the workspace ID associated with the deployment. You should set this for
# each deployment you have configured.
# The ROBOT_ID and WORKSPACE_ID should be configured at the deployment level so each pipeline deploys
# to the correct Workspace.
#
# The robot in control room must be configured as a `robot file` type of robot.
# For more information on creating/getting these values in control room, check out https://robocorp.com/docs/rcc/workflow
definitions:
caches:
robocorp-cache:
key:
files:
- robot.yaml
- conda.yaml
path: ~/.robocorp
script:
&installRcc curl -o rcc https://downloads.robocorp.com/rcc/releases/latest/linux64/rcc &&
chmod a+x rcc &&
mv rcc /usr/local/bin/ &&
echo "RCC installed"
steps:
- step: &deploy
name: Deploy to Control Room
script:
- *installRcc
- >
rcc cloud push
--robot $ROBOT_ID
--workspace $WORKSPACE_ID
--account $CR_ACCESS_CREDENTIALS:$CR_ENDPOINT_URL
- step: &test
name: Run Unit Tests
script:
- *installRcc
- rcc run -t "UNIT TESTS"
caches:
- robocorp-cache
image: mcr.microsoft.com/playwright:v1.36.0
pipelines:
branches:
main:
- step:
<<: *deploy
deployment: Production
test:
- step:
<<: *deploy
deployment: Test
dev:
- step:
<<: *deploy
deployment: Dev
pull-requests:
main:
- step: *test
test:
- step: *test
dev:
- step: *test
# Due to how BitBucket pull-request pipelines work, you must specifiy a source branch for
# the pull-request pipeline to run. This is why we have the "**" branch here. You should
# change this to the branch or pattern you want to run the pull-request pipeline on. An
# example would be "feature/*" to run the pipeline on any branch that starts with "feature/".
"**":
- step: *test