Skip to content

Commit

Permalink
Merge pull request #1 from bids-standard/master
Browse files Browse the repository at this point in the history
updates
  • Loading branch information
Cyril Pernet authored Jul 31, 2019
2 parents 1af72ad + e151e41 commit c7ef08c
Show file tree
Hide file tree
Showing 61 changed files with 21,929 additions and 619 deletions.
145 changes: 145 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
version: 2
jobs:
build:
docker:
- image: circleci/python:3.6.6
steps:
- checkout
- run: sudo chown -R circleci:circleci /usr/local/bin
- run: sudo chown -R circleci:circleci /usr/local/lib/python3.6/site-packages
- restore_cache: # ensure this step occurs *before* installing dependencies
key: deps9-{{ .Branch }}-{{ checksum "Pipfile.lock" }}
- run:
command: |
sudo pip install pip==18.0
sudo pip install pipenv==2018.7.1
pipenv install
- save_cache:
key: deps9-{{ .Branch }}-{{ checksum "Pipfile.lock" }}
paths:
- ".venv"
- "/usr/local/bin"
- "/usr/local/lib/python3.6/site-packages"
- run:
name: generate docs
command: pipenv run mkdocs build --clean --strict --verbose
- store_artifacts:
path: site

# Auto changelog collector
github-changelog-generator:
working_directory: ~/build
docker:
- image: ferrarimarco/github-changelog-generator:1.14.3
steps:
- setup_remote_docker:
version: 17.11.0-ce
- checkout
- run:
name: Build changelog
working_directory: ~/build
command: |
if (git log -1 --pretty=%s | grep Merge*) && (! git log -1 --pretty=%b | grep REL:) ; then
github_changelog_generator --user bids-standard --project bids-specification --token ${CHANGE_TOKEN} --output ~/build/CHANGES.md --base ~/build/src/pregh-changes.md --header-label Changelog --no-issues --no-issues-wo-labels --no-filter-by-milestone --no-compare-link --pr-label ""
cat ~/build/CHANGES.md
mv ~/build/CHANGES.md ~/build/src/CHANGES.md
else
echo "Commit or Release, do nothing"
fi
- persist_to_workspace:
root: .
paths: src

# Clear remark test
remark:
working_directory: ~
docker:
- image: node:latest
steps:
- checkout
- attach_workspace:
at: ~/build
- run:
name: update-npm
command: |
cd ~
npm install npm@latest
- run:
name: get remark
command: |
cd ~
npm install remark remark-cli
- run:
name: get remark styles
command: |
cd ~
npm install [email protected] [email protected] [email protected] [email protected]
- run: # remark the auto generated changes.md
name: remark on autogenerated CHANGES.md
command: |
cd ~/project
if (git log -1 --pretty=%s | grep Merge*) && (! git log -1 --pretty=%b | grep REL:) ; then
mkdir ~/project/src/tmp
cat ~/build/src/CHANGES.md
cp ~/build/src/CHANGES.md ~/project/src/CHANGES.md
~/node_modules/.bin/remark ~/project/src/CHANGES.md -o ~/project/src/tmp/CHANGES.md
~/node_modules/.bin/remark ~/project/src/tmp/CHANGES.md --frail
else
echo "Commit or Release, do nothing"
mkdir ~/project/src/tmp
touch ~/project/src/tmp/empty.txt
fi
- persist_to_workspace:
root: ~/project/src
paths: tmp

# Push built changelog to repo
Changelog-bot:
working_directory: ~/build
docker:
- image: circleci/openjdk:8-jdk
steps:
- setup_remote_docker:
version: 17.11.0-ce
- checkout
- attach_workspace:
at: ~/build
- deploy:
name: Changelog deployment
working_directory: ~/build
command: |
if (git log -1 --pretty=%s | grep Merge*) && (! git log -1 --pretty=%b | grep REL:) ; then
mv ~/build/tmp/CHANGES.md ~/build/src/CHANGES.md
merge_messsge=$(git log -1 | grep Merge | grep "pull")
PR_number=$(echo $merge_messsge | cut -d ' ' -f 4)
git config credential.helper 'cache --timeout=120'
git config user.email "[email protected]"
git config user.name "Changelog-bot"
git add ~/build/src/CHANGES.md
git commit -m "[DOC] Auto-generate changelog entry for PR ${PR_number}"
git push https://${CHANGE_TOKEN}@github.com/bids-standard/bids-specification.git master
else
echo "Commit or Release, do nothing"
fi
workflows:
version: 2
search_build:
jobs:
- build
- github-changelog-generator:
filters:
branches:
only: master
- remark:
requires:
- github-changelog-generator
filters:
branches:
only: master
- Changelog-bot:
requires:
- remark
filters:
branches:
only: master
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
site/
5 changes: 4 additions & 1 deletion .remarkrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"plugins": [
"preset-lint-markdown-style-guide",
["lint-no-duplicate-headings", false]
["lint-no-duplicate-headings", false],
["lint-list-item-indent", "tab-size"],
["lint-emphasis-marker", "consistent"],
["lint-maximum-line-length", false]
]
}
Loading

0 comments on commit c7ef08c

Please sign in to comment.