Skip to content

Commit 0848b84

Browse files
committed
feat: generate-circleci-config.py CircleCI Schd PL
1 parent dc563f2 commit 0848b84

File tree

2 files changed

+37
-11
lines changed

2 files changed

+37
-11
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
1616
an ```apt-get update -y``` before ```apt-get install``` so added the
1717
update
1818
* ```dev-env``` 0.6.19 -> 0.6.21
19+
* change ```generate-circleci-config.py``` to start
20+
using [CircleCI Scheduled Pipelines](https://circleci.com/docs/2.0/scheduled-pipelines)
1921

2022
### Removed
2123

bin/generate-circleci-config.py

Lines changed: 35 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@
162162
"${{DOCKER_PASSWORD}}"
163163
fi
164164
165-
pull_and_test:
165+
run_all_spiders:
166166
working_directory: ~/repo
167167
executor: my_executor
168168
environment:
@@ -179,23 +179,47 @@
179179
workflows:
180180
version: 2
181181
commit:
182+
when:
183+
or:
184+
- equal: [webhook, << pipeline.trigger_source >>]
185+
- equal: [api, << pipeline.trigger_source >>]
182186
jobs:
183187
- build_package_test_and_deploy:
184188
context:
185189
- {context}
186190
- docker-executor
187191
188-
nightly:
189-
triggers:
190-
- schedule:
191-
# https://crontab.guru/ is super useful in decoding the value of the cron key
192-
cron: "0 0 * * *"
193-
filters:
194-
branches:
195-
only:
196-
- master
192+
#
193+
# ~> curl \\
194+
# -s \\
195+
# --header "Circle-Token: ${{PERSONAL_API_TOKEN}}" \\
196+
# -X POST \
197+
# --header 'Content-Type: application/json' \\
198+
# --data-raw '{{
199+
# "name": "Run All Spiders",
200+
# "description": "Run All Spiders",
201+
# "attribution-actor": "system",
202+
# "parameters": {{
203+
# "branch": "master"
204+
# }},
205+
# "timetable": {{
206+
# "per-hour": 1,
207+
# "hours-of-day": [23],
208+
# "days-of-week": ["MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"]
209+
# }}
210+
# }}' \\
211+
# --header 'Accept: application/json' \\
212+
# https://circleci.com/api/v2/project/gh/simonsdave/gaming-spiders/schedule | \\
213+
# jq .
214+
# ~>
215+
#
216+
run_all_spiders:
217+
when:
218+
and:
219+
- equal: [scheduled_pipeline, << pipeline.trigger_source >>]
220+
- equal: ["Run All Spiders", << pipeline.schedule.name >>]
197221
jobs:
198-
- pull_and_test:
222+
- run_all_spiders:
199223
context:
200224
- {context}
201225
- docker-executor

0 commit comments

Comments
 (0)