spacemacs/.circleci/config_tmpl.yml

210 lines
6.3 KiB
YAML
Raw Permalink Normal View History

#### Circle CI YAML file
version: 2.1
2021-07-07 10:25:03 +00:00
parameters:
prj_owner:
type: string
default: "syl20bnr"
prj_repo:
type: string
default: "spacemacs"
2021-07-07 10:25:03 +00:00
website_owner:
type: string
default: "syl20bnr"
website_repo:
type: string
2021-07-07 10:25:03 +00:00
default: "develop.spacemacs.org"
bot_login:
type: string
default: "SpacemacsBot"
# Will be filled by setup script:
is_branch_update:
type: string
default: "{{ IS_BRANCH_UDATE }}"
2021-07-07 10:25:03 +00:00
executors:
spacetools:
docker:
- image: jare/spacemacs-circleci:latest
2021-07-07 10:25:03 +00:00
working_directory: ~/.emacs.d
2021-07-07 13:52:34 +00:00
environment:
- BASH_ENV: ".circleci/shared"
2021-07-07 10:25:03 +00:00
jobs:
"Validate PR":
executor: spacetools
environment:
2021-07-07 10:25:03 +00:00
- UPD_BOT_LOGIN: << pipeline.parameters.bot_login >>
- PRJ_OWNER: << pipeline.parameters.prj_owner >>
- PRJ_REPO: << pipeline.parameters.prj_repo >>
steps:
- checkout
- run:
name: Make sure that this PR targets develop branch
command: .circleci/PR_base
- run:
name: Make sure that this PR doesn't need rebase
command: .circleci/PR_rebased
"Validate Documentation":
2021-07-07 10:25:03 +00:00
executor: spacetools
environment:
2021-07-07 10:25:03 +00:00
- UPD_BOT_LOGIN: << pipeline.parameters.bot_login >>
- PRJ_OWNER: << pipeline.parameters.prj_owner >>
- PRJ_REPO: << pipeline.parameters.prj_repo >>
steps:
- checkout
- run:
name: Select changed files
command: .circleci/select_pr_changed
- run:
name: validate changed documentation files
command: .circleci/org/validate
"Update built-in files":
2021-07-07 10:25:03 +00:00
executor: spacetools
environment:
2021-07-07 13:52:34 +00:00
- PUBLISH: "built_in_updates"
- PRJ_OWNER: << pipeline.parameters.prj_owner >>
- PRJ_REPO: << pipeline.parameters.prj_repo >>
2021-07-07 10:25:03 +00:00
- UPD_BOT_LOGIN: << pipeline.parameters.bot_login >>
- UPD_BOT_REPO: << pipeline.parameters.prj_repo >>
- PR_BRANCH: "develop"
steps:
- checkout
- run:
name: Initialize bot account
command: .circleci/bot_init
- run:
name: Download latest versions
command: .circleci/built_in/upd_built_in
- run:
name: Create patch file with the updates
2021-08-01 20:34:01 +00:00
command: .circleci/update/make_patch
- run:
name: Apply the patch file
2021-08-01 20:34:01 +00:00
command: .circleci/update/apply_patch
- run:
name: Push changes to Spacemacs Bot account
2021-08-01 20:34:01 +00:00
command: .circleci/update/push
- run:
name: Open PR if built in files must be updated
2021-08-01 20:34:01 +00:00
command: .circleci/update/maybe_pr
"Update documentation files":
2021-07-07 10:25:03 +00:00
executor: spacetools
environment:
2021-07-07 13:52:34 +00:00
- PUBLISH: "documentation_updates"
- PRJ_OWNER: << pipeline.parameters.prj_owner >>
- PRJ_REPO: << pipeline.parameters.prj_repo >>
2021-07-07 10:25:03 +00:00
- UPD_BOT_LOGIN: << pipeline.parameters.bot_login >>
- UPD_BOT_REPO: << pipeline.parameters.prj_repo >>
- PR_BRANCH: "develop"
steps:
- checkout
- run:
name: Initialize bot account
command: .circleci/bot_init
- run:
name: Export documentation files
command: .circleci/org/sdnize
- run:
name: Update documentation files
command: .circleci/org/update_docs
- run:
name: Create patch file with the updates
2021-08-01 20:34:01 +00:00
command: .circleci/update/make_patch
- run:
name: Apply the patch file
2021-08-01 20:34:01 +00:00
command: .circleci/update/apply_patch
- run:
name: Push changes to Spacemacs Bot account
2021-08-01 20:34:01 +00:00
command: .circleci/update/push
- run:
name: Open PR if documentation needs fixes
2021-08-01 20:34:01 +00:00
command: .circleci/update/maybe_pr
2021-07-07 10:25:03 +00:00
"Update website documentation":
executor: spacetools
environment:
2021-07-07 13:52:34 +00:00
- PUBLISH: "website_documentation_updates"
2021-07-07 10:25:03 +00:00
- PRJ_OWNER: << pipeline.parameters.website_owner >>
- PRJ_REPO: << pipeline.parameters.website_repo >>
- UPD_BOT_LOGIN: << pipeline.parameters.bot_login >>
- UPD_BOT_REPO: << pipeline.parameters.website_repo >>
- PR_BRANCH: "gh-pages"
steps:
- checkout
- run:
name: Initialize bot account
command: .circleci/bot_init
2021-07-09 17:09:25 +00:00
- restore_cache:
keys:
2021-10-23 14:31:09 +00:00
- webe-dps-v2-{{ .Branch }}-{{ checksum ".circleci/web/.spacemacs" }}
2021-07-07 13:52:34 +00:00
- run:
name: Install dependencies
command: .circleci/web/install_deps
2021-07-09 17:09:25 +00:00
- save_cache:
2021-10-23 14:31:09 +00:00
key: webe-dps-v2-{{ .Branch }}-{{ checksum ".circleci/web/.spacemacs" }}
2021-07-09 17:09:25 +00:00
paths:
- ~/.emacs.d/elpa
2021-07-07 10:25:03 +00:00
- run:
name: Export documentation files
command: .circleci/web/htmlize
2021-07-07 13:52:34 +00:00
- run:
name: Clone website repo
command: |
git clone -b "${PR_BRANCH}" \
https://github.com/${PRJ_OWNER}/${PRJ_REPO} \
"/tmp/${PUBLISH}_old"
- run:
name: Replace old web files
command: rsync -avh ~/.emacs.d/export/ "/tmp/${PUBLISH}_old"
2021-07-07 10:25:03 +00:00
- run:
name: Create patch file with the updates
2021-08-01 20:34:01 +00:00
command: |
cd "/tmp/${PUBLISH}_old" && \
~/.emacs.d/.circleci/update/make_patch
2021-07-07 10:25:03 +00:00
- run:
name: Apply the patch file
2021-08-01 20:34:01 +00:00
command: .circleci/update/apply_patch
2021-07-07 10:25:03 +00:00
- run:
name: Push changes to Spacemacs Bot account
2021-08-01 20:34:01 +00:00
command: .circleci/update/push
2021-07-07 10:25:03 +00:00
- run:
name: Open PR if web documentation needs fixes
2021-08-01 20:34:01 +00:00
command: .circleci/update/maybe_pr
workflows:
version: 2.1
validate-pr-files:
when:
not:
2021-07-06 12:56:57 +00:00
equal: [<< pipeline.parameters.is_branch_update >>, "yes"]
jobs:
- "Validate PR"
- "Validate Documentation"
update-documentation:
when:
and:
2021-07-06 12:56:57 +00:00
- equal: [<< pipeline.parameters.is_branch_update >>, "yes"]
- equal: [<< pipeline.git.branch >>, "develop"]
jobs:
- "Update documentation files"
2021-07-07 13:52:34 +00:00
- "Update website documentation"
update-built-in-on-push:
when:
and:
- equal: [<< pipeline.parameters.is_branch_update >>, "yes"]
- equal: [<< pipeline.git.branch >>, "develop"]
jobs:
- "Update built-in files"
2021-07-07 10:25:03 +00:00
update-built-in-on-schedule:
when:
2021-07-07 10:25:03 +00:00
equal: [<< pipeline.parameters.is_branch_update >>, "yes"]
triggers:
- schedule:
cron: "0 0,6,12,18 * * *"
filters:
branches:
only:
- develop
jobs:
- "Update built-in files"