Skip to content
This repository has been archived by the owner on Dec 2, 2020. It is now read-only.

Commit

Permalink
chore: update circleci for automerge
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Johnson committed Jul 22, 2020
1 parent 7aa8134 commit 649be6c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
23 changes: 20 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:
- "ec:9f:2e:aa:1f:c9:ab:49:57:8f:c0:cd:2e:5b:f3:b0"
- checkout
- run:
name: "Check and skip if npm-publish"
command: |
COMMIT_MSG=$(git log --format=oneline -n 1 $CIRCLE_SHA1)
if [[ $COMMIT_MSG == *"[npm-publish]"* ]]; then
Expand All @@ -20,6 +21,22 @@ jobs:
- run: yarn install --frozen-lockfile
- run: yarn lint
- run: yarn test
- run:
name: Check branch for auto-upgrade
command: |
if [[ ${CIRCLE_BRANCH} != "upgrade-"* ]]; then
circleci-agent step halt
fi
- run:
name: Merge auto-upgrade into master
command: |
git config --global user.email "$GIT_AUTHOR_EMAIL"
git config --global user.name "$GIT_AUTHOR_NAME"
git fetch --all
git checkout master
git reset --hard origin/master
git merge --no-ff ${CIRCLE_BRANCH} -m "chore(auto-upgrade): Upgrade Tests Passed [auto-merge]"
git push origin
npm_publish:
docker:
- image: circleci/node:12
Expand All @@ -29,6 +46,7 @@ jobs:
- "ec:9f:2e:aa:1f:c9:ab:49:57:8f:c0:cd:2e:5b:f3:b0"
- checkout
- run:
name: "Check and skip if npm-publish"
command: |
COMMIT_MSG=$(git log --format=oneline -n 1 $CIRCLE_SHA1)
if [[ $COMMIT_MSG == *"[npm-publish]"* ]]; then
Expand All @@ -52,7 +70,7 @@ jobs:
- run:
name: "Set TARGETBRANCH env variable"
command: |
TARGETBRANCH=upgrade_$(date '+%Y-%m-%d')
TARGETBRANCH=upgrade-$(date '+%Y-%m-%d')
echo "export TARGETBRANCH=$TARGETBRANCH" >> $BASH_ENV
- run:
name: "Try to upgrade"
Expand All @@ -69,7 +87,6 @@ jobs:
- run:
name: "Create PR"
command: |
TARGETBRANCH=upgrade_$(date '+%Y-%m-%d')
git commit -a -m "[chore] upgrade all [automated]"
git push --force origin $TARGETBRANCH
git push --set-upstream origin $TARGETBRANCH
Expand All @@ -94,7 +111,7 @@ workflows:
context: public_package_publish
triggers:
- schedule:
cron: "30 * * * *"
cron: "45 * * * *"
filters:
branches:
only:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"release": "semantic-release",
"arkit": "arkit -f index.ts -o docs/images/arkit.svg",
"arkit.png": "arkit -f index.ts -o docs/images/arkit.png",
"upgrade.base": "yarn upgrade --latest && rm yarn.lock | true && yarn | true && yarn lint.fix | true",
"upgrade.base": "yarn upgrade --latest && rm yarn.lock | true && yarn | true && yarn lint.fix || true",
"up": "yarn upgrade.base && yarn lint && yarn build && yarn test"
},
"dependencies": {
Expand Down

0 comments on commit 649be6c

Please sign in to comment.