-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathconfig.yml
More file actions
164 lines (154 loc) · 5.2 KB
/
config.yml
File metadata and controls
164 lines (154 loc) · 5.2 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
version: 2.1
orbs:
# For documentation and more usage examples, see the orb's repo and registry pages:
# https://github.com/rainforestapp/rainforest-orb
# https://circleci.com/orbs/registry/orb/rainforest-qa/rainforest
rainforest: rainforest-qa/rainforest@3
heroku: circleci/heroku@1.1.1
commands:
check_chosen_ci:
steps:
- run:
name: Pick CI
command: |
ci=$(script/pick_ci.sh)
echo "Picked $ci"
if [ $ci != "circleci" ] ; then
circleci-agent step halt
fi
jobs:
test:
docker:
- image: circleci/ruby:2.7.1-node
auth:
username: $DOCKERHUB_USERNAME
password: $DOCKERHUB_TOKEN
environment:
RACK_ENV: test
steps:
- checkout
- attach_workspace:
at: /home/circleci/rspec
- run: gem install bundler
- run: bundle install
- run: bundle exec rake
# This job shows how to use commands provided by the Orb to run your Rainforest tests.
run_rainforest:
docker:
- image: cimg/base:2021.12
auth:
username: $DOCKERHUB_USERNAME
password: $DOCKERHUB_TOKEN
steps:
- checkout
- check_chosen_ci
- run: mkdir -p /home/circleci/.local/bin
- restore_cache:
keys:
- rainforest-run-{{ .Revision }}-{{ .BuildNum }}
- rainforest-run-{{ .Revision }}-
# Command provided by the Orb to install the CLI.
# This is only needed if you do not use the `rainforest/run` job (see below) or the
# `rainforest/default` executor (https://circleci.com/developer/orbs/orb/rainforest-qa/rainforest#executors).
- rainforest/install:
install_path: /home/circleci/.local/bin
# Command to run your tests. `run_group_id` should point to the Run Group you
# want to use for your releases. `environment_id` should point to your Staging or QA
# environment. See the docs for a full list of parameters:
# https://circleci.com/developer/orbs/orb/rainforest-qa/rainforest#commands-run_qa
- rainforest/run_qa:
run_group_id: ${RELEASE_RUN_GROUP_ID:-2401}
environment_id: ${RELEASE_ENVIRONMENT_ID:-343}
crowd: ${RELEASE_CROWD:-default}
conflict: cancel
# Passing in the pipeline ID enables rerunning only failed Rainforest tests when
# rerunning a failed CircleCI build.
pipeline_id: << pipeline.id >>
# Command to save the created run's ID. Together with the `restore_cache` and `save_cache` steps,
# this allows you to rerun only failed tests when rerunning a failed workflow.
- rainforest/save_run_id:
pipeline_id: << pipeline.id >>
- save_cache:
when: on_fail
key: rainforest-run-{{ .Revision }}-{{ .BuildNum }}
paths:
- ~/pipeline
merge_to_master:
docker:
- image: cimg/base:2020.01
auth:
username: $DOCKERHUB_USERNAME
password: $DOCKERHUB_TOKEN
steps:
- checkout
- check_chosen_ci
- add_ssh_keys:
fingerprints:
- "f5:3c:d0:d0:0b:5d:39:b4:2e:68:ba:b5:a3:85:30:f3"
- run: git push origin $CIRCLE_SHA1:refs/heads/master
workflows:
# Daily monitoring of general application functionality
nightly:
triggers:
- schedule:
cron: "0 0 16-31 * *"
filters:
branches:
only: develop
jobs:
- test
# Job provided by the Orb to run your tests.
# This accepts the same parameters as the `rainforest/run_qa` command (see above).
- rainforest/run:
context:
- RainforestQA
name: run_rainforest_nightly
run_group_id: ${RELEASE_RUN_GROUP_ID:-2401}
environment_id: ${RELEASE_ENVIRONMENT_ID:-343}
crowd: ${RELEASE_CROWD:-default}
conflict: cancel
pipeline_id: << pipeline.id >>
test_and_merge:
jobs:
- test:
context:
- DockerHub
# Push our code to our staging or QA server. We're using Heroku here but you will need
# to change this to match how you deploy your releases.
- heroku/deploy-via-git:
name: deploy_staging
app-name: rainforest-ci-sample-staging
pre-deploy:
- check_chosen_ci
filters:
branches:
only: develop
context:
- Heroku
# Run our Rainforest tests as above, but to be performed on any merge.
- run_rainforest:
requires:
- deploy_staging
context:
- RainforestQA
# Our Rainforest build was successful! Push the code to the master branch which
# will start another CircleCI workflow that will deploy our code to production.
- merge_to_master:
requires:
- run_rainforest
context:
- DockerHub
filters:
branches:
only: develop
release:
jobs:
- heroku/deploy-via-git:
name: deploy_production
app-name: rainforest-ci-sample-prd
filters:
branches:
only: master
context:
- DockerHub
- Heroku