-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathrobocorp-ci-template.gitlab-ci.yml
More file actions
74 lines (64 loc) · 2.32 KB
/
robocorp-ci-template.gitlab-ci.yml
File metadata and controls
74 lines (64 loc) · 2.32 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
# Python Automation testing and deploy example
# This template allows you to push your robot from your GitLab 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 environment.
# Prerequisites:
# You must configure the following variables within your GitLab project settings:
# * $CR_ACCESS_CREDENTIALS: This is the access token for your Control Room account and can be set
# per environment or globally within your project.
# * $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 environment you have configured.
# * $WORKSPACE_ID: This is the workspace ID associated with the environment. You should set this for
# each environment you have configured.
# The ROBOT_ID and WORKSPACE_ID should be configured at the deployment level so each pipeline deploys
# to the correct Workspace environment.
#
# 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
image: mcr.microsoft.com/playwright:v1.36.0
variables:
ROBOCORP_HOME: $CI_PROJECT_DIR/.robocorp
cache:
paths:
- .robocorp
before_script:
- apt-get update && apt-get install -y curl
- curl -o rcc https://downloads.robocorp.com/rcc/releases/latest/linux64/rcc
- chmod a+x rcc
- mv rcc /usr/local/bin/
- rcc holotree variables robot.yaml
test:
stage: test
script:
- rcc run -t "UNIT TESTS"
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
.deploy:
stage: deploy
variables:
CR_ACCESS_CREDENTIALS: $CR_ACCESS_CREDENTIALS
CR_ENDPOINT_URL: $CR_ENDPOINT_URL
ROBOT_ID: $ROBOT_ID
WORKSPACE_ID: $WORKSPACE_ID
script:
- >
rcc cloud push --robot $ROBOT_ID
--workspace $WORKSPACE_ID
--account $CR_ACCESS_CREDENTIALS:$CR_ENDPOINT_URL
deploy-production:
extends: .deploy
environment: production
only:
- main
deploy-test:
extends: .deploy
environment: test
only:
- test
deploy-dev:
extends: .deploy
environment: dev
only:
- dev