2021-07-05 14:58:55 +00:00
|
|
|
#### Circle CI YAML file
|
|
|
|
version: 2.1
|
2021-07-07 10:25:03 +00:00
|
|
|
|
2021-07-05 14:58:55 +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:
|
2021-07-05 14:58:55 +00:00
|
|
|
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:
|
2021-07-05 14:58:55 +00:00
|
|
|
is_branch_update:
|
|
|
|
type: string
|
|
|
|
default: "{{ IS_BRANCH_UDATE }}"
|
|
|
|
|
2021-07-07 10:25:03 +00:00
|
|
|
executors:
|
|
|
|
spacetools:
|
2021-07-05 14:58:55 +00:00
|
|
|
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
|
2021-07-05 14:58:55 +00:00
|
|
|
environment:
|
2021-07-07 10:25:03 +00:00
|
|
|
- UPD_BOT_LOGIN: << pipeline.parameters.bot_login >>
|
2021-07-05 14:58:55 +00:00
|
|
|
- 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
|
2021-07-05 14:58:55 +00:00
|
|
|
environment:
|
2021-07-07 10:25:03 +00:00
|
|
|
- UPD_BOT_LOGIN: << pipeline.parameters.bot_login >>
|
2021-07-05 14:58:55 +00:00
|
|
|
- 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
|
2021-07-05 14:58:55 +00:00
|
|
|
environment:
|
2021-07-07 13:52:34 +00:00
|
|
|
- PUBLISH: "built_in_updates"
|
2021-07-05 14:58:55 +00:00
|
|
|
- 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"
|
2021-07-05 14:58:55 +00:00
|
|
|
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
|
2021-07-05 14:58:55 +00:00
|
|
|
- run:
|
|
|
|
name: Apply the patch file
|
2021-08-01 20:34:01 +00:00
|
|
|
command: .circleci/update/apply_patch
|
2021-07-05 14:58:55 +00:00
|
|
|
- run:
|
|
|
|
name: Push changes to Spacemacs Bot account
|
2021-08-01 20:34:01 +00:00
|
|
|
command: .circleci/update/push
|
2021-07-05 14:58:55 +00:00
|
|
|
- run:
|
|
|
|
name: Open PR if built in files must be updated
|
2021-08-01 20:34:01 +00:00
|
|
|
command: .circleci/update/maybe_pr
|
2021-07-05 14:58:55 +00:00
|
|
|
"Update documentation files":
|
2021-07-07 10:25:03 +00:00
|
|
|
executor: spacetools
|
2021-07-05 14:58:55 +00:00
|
|
|
environment:
|
2021-07-07 13:52:34 +00:00
|
|
|
- PUBLISH: "documentation_updates"
|
2021-07-05 14:58:55 +00:00
|
|
|
- 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"
|
2021-07-05 14:58:55 +00:00
|
|
|
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
|
2021-07-05 14:58:55 +00:00
|
|
|
- run:
|
|
|
|
name: Apply the patch file
|
2021-08-01 20:34:01 +00:00
|
|
|
command: .circleci/update/apply_patch
|
2021-07-05 14:58:55 +00:00
|
|
|
- run:
|
|
|
|
name: Push changes to Spacemacs Bot account
|
2021-08-01 20:34:01 +00:00
|
|
|
command: .circleci/update/push
|
2021-07-05 14:58:55 +00:00
|
|
|
- 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:
|
|
|
|
- webe-dps-{{ .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:
|
|
|
|
key: webe-dps-{{ .Branch }}-{{ checksum ".circleci/web/.spacemacs" }}
|
|
|
|
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
|
2021-07-05 14:58:55 +00:00
|
|
|
|
|
|
|
workflows:
|
|
|
|
version: 2.1
|
|
|
|
validate-pr-files:
|
|
|
|
when:
|
|
|
|
not:
|
2021-07-06 12:56:57 +00:00
|
|
|
equal: [<< pipeline.parameters.is_branch_update >>, "yes"]
|
2021-07-05 14:58:55 +00:00
|
|
|
jobs:
|
|
|
|
- "Validate PR"
|
|
|
|
- "Validate Documentation"
|
|
|
|
update-documentation:
|
|
|
|
when:
|
2021-07-05 23:45:49 +00:00
|
|
|
and:
|
2021-07-06 12:56:57 +00:00
|
|
|
- equal: [<< pipeline.parameters.is_branch_update >>, "yes"]
|
|
|
|
- equal: [<< pipeline.git.branch >>, "develop"]
|
2021-07-05 14:58:55 +00:00
|
|
|
jobs:
|
|
|
|
- "Update documentation files"
|
2021-07-07 13:52:34 +00:00
|
|
|
- "Update website documentation"
|
2021-07-06 16:08:46 +00:00
|
|
|
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:
|
2021-07-05 14:58:55 +00:00
|
|
|
when:
|
2021-07-07 10:25:03 +00:00
|
|
|
equal: [<< pipeline.parameters.is_branch_update >>, "yes"]
|
2021-07-05 14:58:55 +00:00
|
|
|
triggers:
|
|
|
|
- schedule:
|
|
|
|
cron: "0 0,6,12,18 * * *"
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only:
|
|
|
|
- develop
|
|
|
|
jobs:
|
|
|
|
- "Update built-in files"
|