-
Notifications
You must be signed in to change notification settings - Fork 16
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
1 parent
cc396b9
commit 3177c2b
Showing
5 changed files
with
68 additions
and
3 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
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,6 @@ | ||
#!/bin/bash -e | ||
|
||
echo Upload coverage to Coveralls | ||
export CI_PULL_REQUEST=${SD_PULL_REQUEST} | ||
export COVERALLS_SERVICE_NAME=screwdriver | ||
cat ./artifacts/coverage/lcov.info | ./node_modules/.bin/coveralls |
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,42 @@ | ||
#!/bin/bash -e | ||
|
||
if [ -z "$GIT_KEY" ] || [ -z "$NPM_TOKEN" ]; then | ||
echo Skipping publish in Pull Request | ||
exit 0 | ||
fi | ||
|
||
GITHUB_FINGERPRINT=16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48 | ||
|
||
echo Addding github.com to known_hosts | ||
mkdir -p /root/.ssh | ||
touch /root/.ssh/known_hosts | ||
ssh-keyscan -H github.com >> /root/.ssh/known_hosts | ||
chmod 600 /root/.ssh/known_hosts | ||
|
||
echo Validating good known_hosts | ||
ssh-keygen -l -f ~/.ssh/known_hosts | grep $GITHUB_FINGERPRINT | ||
|
||
echo Starting ssh-agent | ||
eval "$(ssh-agent -s)" | ||
|
||
echo Loading github key | ||
echo $GIT_KEY > git_key | ||
echo $GIT_KEY | ||
cat git_key | ||
ssh-add git_key | ||
# ssh-add <(echo $GIT_KEY) | ||
|
||
echo Setting up secrets | ||
GIT_PATH=`git remote -v | grep push | sed 's/ (push)//' | cut -d'/' -f4-5` | ||
git remote set-url --push origin git@github.com:$GIT_PATH | ||
npm config set access public > /dev/null 2>&1 | ||
npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN > /dev/null 2>&1 | ||
|
||
echo Bump the version | ||
./node_modules/.bin/npm-auto-version | ||
|
||
echo Publish the package | ||
npm publish | ||
|
||
echo Push the new tag to GitHub | ||
git push origin --tags -q |
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,15 @@ | ||
jobs: | ||
main: | ||
image: node:6 | ||
steps: | ||
- install: npm install | ||
- test: npm test | ||
- coverage: ./ci/coverage | ||
- publish: ./ci/publish | ||
secrets: | ||
# Publishing to NPM | ||
- NPM_TOKEN | ||
# Pushing tags to Git | ||
- GIT_KEY | ||
# Uploading coverage information to coveralls | ||
- COVERALLS_REPO_TOKEN |