67 lines
1.9 KiB
YAML
67 lines
1.9 KiB
YAML
# Use the latest 2.1 version of CircleCI pipeline process engine. See: https://circleci.com/docs/2.0/configuration-reference
|
|
version: 2.1
|
|
|
|
executors:
|
|
update-executor:
|
|
docker:
|
|
- image: 'cimg/base:stable'
|
|
|
|
jobs:
|
|
get_commit_hash:
|
|
executor: update-executor
|
|
steps:
|
|
- run:
|
|
name: Install jq
|
|
command: sudo apt-get update && sudo apt-get install jq
|
|
- run: mkdir -p /home/circleci/project/circleci-workspace/persist
|
|
- run: echo $(curl -Ss -u "${CIRCLECI_CHARSHEETS_API_KEY}:" "https://circleci.com/api/v1.1/project/github/Roll20/roll20-character-sheets?filter=completed&limit=1" | jq -r '.[0]["vcs_revision"]') > /home/circleci/project/circleci-workspace/persist/last-commit
|
|
- persist_to_workspace:
|
|
root: /home/circleci/project/circleci-workspace/persist
|
|
paths:
|
|
- last-commit
|
|
update_sheet:
|
|
executor: update-executor
|
|
steps:
|
|
- checkout
|
|
- attach_workspace:
|
|
at: /home/circleci/project/circleci-workspace/persist
|
|
- run:
|
|
name: Update Character Sheets
|
|
command: |
|
|
.circleci/update_sheets.sh
|
|
# Orchestrate or schedule a set of jobs
|
|
workflows:
|
|
version: 2
|
|
update_sheets_staging:
|
|
jobs:
|
|
- get_commit_hash:
|
|
context: char-sheet-app-staging
|
|
filters:
|
|
branches:
|
|
only:
|
|
- master
|
|
- update_sheet:
|
|
requires:
|
|
- get_commit_hash
|
|
context: char-sheet-app-staging
|
|
filters:
|
|
branches:
|
|
only:
|
|
- master
|
|
- update_sheet:
|
|
requires:
|
|
- get_commit_hash
|
|
context: char-sheet-app-production
|
|
filters:
|
|
branches:
|
|
only:
|
|
- master
|
|
- update_sheet:
|
|
requires:
|
|
- get_commit_hash
|
|
context: char-sheet-app-dev
|
|
filters:
|
|
branches:
|
|
only:
|
|
- master
|