Last active
December 12, 2018 22:37
-
-
Save therebelrobot/61a2b3afd15bbc4d2fbbecd8c3ea8230 to your computer and use it in GitHub Desktop.
CircleCI Repeated Cron Job
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# change defaults:docker:image for a different docker image | |
# change jobs:checkout:steps:restore_cache:keys and :save_cache:key to the file needed for checksum | |
# change jobs:checkout:steps:run to whatever is needed for dep installation | |
# change jobs:checkout:steps:save_cache:paths to the paths you'd like to cache between runs | |
# change task:steps:run:command to the bash command to run | |
# change workflows:repeated:triggers:schedule:cron to the appropriate cron syntax | |
# cron reference: https://www.unix.com/man-page/POSIX/1posix/crontab/ | |
# cron recipes: https://alvinalexander.com/linux/unix-linux-crontab-every-minute-hour-day-syntax | |
defaults: &defaults | |
docker: | |
- image: circleci/node:8.11-jessie-browsers | |
working_directory: ~/tmp/circlci-now | |
version: 2 | |
jobs: | |
checkout: | |
<<: *defaults | |
steps: | |
- checkout | |
- attach_workspace: | |
at: ~/tmp/circlci-now | |
- restore_cache: | |
keys: | |
- npm-cache-{{ .Branch }}-{{ checksum "package.json" }} | |
- npm-cache-{{ .Branch }} | |
- npm-cache- | |
- run: | |
name: Dependency Install | |
command: yarn | |
- save_cache: | |
key: npm-cache-{{ .Branch }}-{{ checksum "package.json" }} | |
paths: | |
- node_modules | |
- persist_to_workspace: | |
root: . | |
paths: . | |
task: | |
<<: *defaults | |
steps: | |
- attach_workspace: | |
at: ~/tmp/circlci-now | |
- run: | |
name: Run Coverage | |
command: | | |
./run-script.sh | |
workflows: | |
version: 2 | |
repeated: | |
triggers: | |
- schedule: | |
cron: "0 0 * * *" | |
filters: | |
branches: | |
only: | |
- master | |
jobs: | |
- task | |
requires: | |
- checkout |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment