49 lines
1.4 KiB
YAML
49 lines
1.4 KiB
YAML
version: 2
|
|
|
|
defaults: &defaults
|
|
docker:
|
|
- image: circleci/ruby:2.4
|
|
|
|
workflows:
|
|
version: 2
|
|
validate-then-generate-docs:
|
|
jobs:
|
|
- validate_atomics_generate_docs
|
|
|
|
jobs:
|
|
validate_atomics_generate_docs:
|
|
<<: *defaults
|
|
steps:
|
|
- checkout
|
|
- add_ssh_keys
|
|
|
|
- run:
|
|
name: Validate the format of atomic tests against the spec
|
|
command: |
|
|
bin/validate-atomics.rb
|
|
|
|
- run:
|
|
name: Generate nice markdown document for atomics
|
|
command: |
|
|
bin/generate-atomic-docs.rb
|
|
|
|
echo ""
|
|
echo ""
|
|
git status
|
|
echo ""
|
|
echo ""
|
|
git diff-index HEAD --
|
|
|
|
if git diff-index --quiet HEAD -- ; then
|
|
echo "Not committing documentation because there are no changes"
|
|
elif [[ "${CIRCLE_BRANCH}" == "master" ]]; then
|
|
echo "Not committing documentation because we are on master and doc changes should be part of pull request branches"
|
|
else
|
|
git config credential.helper 'cache --timeout=120'
|
|
git config user.email "<email>"
|
|
git config user.name "CircleCI Atomic Red Team doc generator"
|
|
|
|
git add atomics
|
|
git commit -am "Generate docs from job=$CIRCLE_JOB branch=$CIRCLE_BRANCH"
|
|
git push -u origin $CIRCLE_BRANCH
|
|
fi |