This repository has been archived by the owner on Feb 28, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Aerex
committed
Nov 2, 2017
1 parent
ba829d3
commit 1043228
Showing
7 changed files
with
106 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[commit] | ||
template = .gittemplate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Type(<scope>): <subject> | ||
# <body> | ||
# <footer> | ||
|
||
# Type should be one of the following: | ||
# * BREAKING CHANGES (breaking change) [major release -- 1.x.x] | ||
# * feat (new feature) [minor release -- x.1.x] | ||
# * fix (bug fix) [patch release -- 0.0.x] | ||
# * docs (changes to documentation) | ||
# * style (formatting, missing semi colons, etc; no code change) | ||
# * refactor (refactoring production code) | ||
# * test (adding missing tests, refactoring tests; no production code change) | ||
# * chore (updating grunt tasks etc; no production code change) | ||
# Scope is just the scope of the change. Something like (admin) or (teacher). | ||
# Subject should use clear words and say what you did. | ||
# The body should go into detail about changes made. | ||
# The footer should contain any Github (or other tool) issue references or actions. | ||
|
||
# For a full example of how to write a good commit message, check out | ||
# https://conventionalcommits.org/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,30 @@ | ||
language: node_js | ||
|
||
node_js: | ||
- '8' | ||
|
||
script: npm test && npm run coveralls && ./npm_patch.sh | ||
|
||
before_install: | ||
- npm i -g markdown-to-html | ||
- wget https://github.com/github/hub/releases/download/v2.2.9/hub-linux-386-2.2.9.tgz | ||
- tar -xvzf hub-linux-386-2.2.9.tgz | ||
- export PATH=${PATH}:$PWD/hub-linux-386-2.2.9/bin/ | ||
before_script: | ||
- cd /tmp | ||
- git clone -b master https://github.com/ibm-developer/changelog-generator-slack-notification.git | ||
- npm install changelog-generator-slack-notification | ||
- cd - | ||
script: npm test && npm run coveralls && ./npm_version_upgrade.sh | ||
branches: | ||
only: | ||
- development | ||
- master | ||
|
||
notifications: | ||
email: | ||
on_success: always | ||
on_failure: always | ||
slack: | ||
rooms: | ||
- "$SLACK_ARF_DEVOPS" | ||
|
||
secure: YsSIB1nMQvcgqDsjMcgIkRAPh3LB9xqxW8+237kPVIW2itSUvLr4VQqTcHOOKmG7U2vySQoC7Kcb+lm+8w98xv8OGOe2ikCDaB05ExyONivL0D0gbVEwbdIMuWg72SanIuSXcbDtaFnbn6sCPqHVZpXB3jSd9wKN8YOb0MWz3s1TG0AR0L9DRMrj0K9kGDpIkAqsKO5Tbm4AyXIafzih1gRXldLBvBCR+/W0tvhaPVIhuvNjXGRVs+1kp7daJKtdXDpUWjTx4w64nbr8ljmh50J3rLCdbh4TTlO/TVT3k3RD9IsfwaEeWS6j7/SMXdpT35DFxK1GetCHzJxQcKbMDR9O+6VgQRm24z1456mw4ayf860GtC8oU0+x7b9ndY3KQd6/qoXwFx0ngJN479KVpo5T96zEKkQ1XVCh2Jlx0Zw2iThzH/Ks9G+q7zNIYP3+9US6ogzszZPCHbJzCkllrL4C9FP3LBqSlnS7uon8D9/8RSd0MEA1fTWsF5LBKZdntIo2Ma6QlEB5yelbeP/XUE+AHKveDUCd1b7mq7u6Cnx9z8rS4O++Y3Otd2idITDArfvkncnWiOYTWUlYA/UNeBznZ7u2B7yCzKymp4t1u6Es/Kdh8xhzTVRDSQTKcUinyOitaRLb0vHtivJM2MjaLPeYqL5TudQPHKPuvaAMHjU= | ||
deploy: | ||
provider: npm | ||
email: $NPM_EMAIL | ||
api_key: $NPM_TOKEN | ||
email: "$NPM_EMAIL" | ||
api_key: "$NPM_TOKEN" | ||
on: | ||
branch: master | ||
|
||
condition: $NPM_VER != $PKG_VER | ||
after_deploy: | ||
- node /tmp/changelog-generator-slack-notification/index.js --html "$HTML" --name "$PKG_NAME" --api "$SLACK_WEBHOOK" --v "$PKG_VER" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env bash | ||
|
||
CMD=$(cat .git/config | grep "commit") | ||
if [ -z $CMD ]; then | ||
echo "$(cat .git/config)\n$(cat .gitconfig)" > ./.git/config | ||
else | ||
echo "commit file template already saved" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -ev | ||
|
||
echo "Auto version updating script : version 0.0.1" | ||
echo "Checking if a new version update is required ..." | ||
PKG_NAME=`node -e "console.log(require('./package.json').name);"` | ||
PKG_VER=`node -e "console.log(require('./package.json').version);"` | ||
NPM_VER=`npm show $PKG_NAME version` | ||
echo "$PKG_NAME : version = $PKG_VER, npm version = $NPM_VER" | ||
HTML=$(markdown CHANGELOG.md) | ||
|
||
if [ $TRAVIS_BRANCH = "master" ]; then | ||
echo "Build targetting master - checking if this is a PR or not" | ||
if [[ "${TRAVIS_PULL_REQUEST}" = "false" ]]; then | ||
echo "This is a build on master, performing additional steps" | ||
if [ $NPM_VER == $PKG_VER ]; then | ||
echo "Version numbers match, so changing version and committing changes" | ||
./prerelease.sh | ||
retval=$? | ||
if [[ $retval != 0 ]]; then | ||
exit $retval | ||
fi | ||
fi | ||
fi | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
set -x | ||
|
||
echo "Running pre-release checks and scans" | ||
CURRENT_PKG_VER=`node -e "console.log(require('./package.json').version);"` | ||
echo "Determining current version: ${CURRENT_PKG_VER}" | ||
LINE="bumping version in package.json from ${CURRENT_PKG_VER} to" | ||
PKG_VER_NEXT=$(standard-version --dry-run | grep 'package.json from' | awk -v FS="${LINE}" -v OFS="" '{$1 = ""; print}') | ||
PKG_VER_NEXT="$(echo -e "${PKG_VER_NEXT}" | tr -d '[:space:]')" | ||
|
||
echo "Determining next version: ${PKG_VER_NEXT}" | ||
|
||
git config user.email "travisci@travis.com" | ||
git config user.name "Travis CI" | ||
git config push.default simple | ||
|
||
echo "Creating git branch" | ||
BRANCH="updateTo${PKG_VER_NEXT}" | ||
git checkout -b $BRANCH | ||
|
||
npm run version | ||
git push --follow-tags origin $BRANCH | ||
hub pull-request -b development -m "chore: Merging CHANGELOG and package.json changes" | ||
hub pull-request -b master -m "chore: Merging CHANGELOG and package.json changes" |