forked from tangcent/easy-yapi
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
travis: auto deploy for patch pr. (tangcent#315)
- Loading branch information
Showing
4 changed files
with
49 additions
and
5 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 |
---|---|---|
|
@@ -8,13 +8,31 @@ matrix: | |
jdk: openjdk8 | ||
|
||
script: | ||
- ./plugin-script/build_plugin.sh | ||
|
||
- ./plugin-script/package_plugin.sh | ||
|
||
before_cache: | ||
- rm -f $HOME/.gradle/caches/** | ||
|
||
cache: | ||
directories: | ||
- $HOME/.gradle/caches/ | ||
- $HOME/.gradle/wrapper/ | ||
- $HOME/.gradle/wrapper/ | ||
|
||
before_deploy: | ||
- git config --local user.name "tangcent" | ||
- git config --local user.email "[email protected]" | ||
- echo jars- `ls plugin` | ||
- ./plugin-script/push_tag.sh | ||
|
||
deploy: | ||
provider: releases | ||
api_key: $GITHUB_TOKEN | ||
name: $TRAVIS_TAG_TITLE | ||
body: $TRAVIS_TAG_BODY | ||
file_glob: true | ||
file: plugin/* | ||
overwrite: true | ||
skip_cleanup: true | ||
on: | ||
branch: master | ||
repo: tangcent/easy-api |
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,4 +1,4 @@ | ||
#!/bin/sh | ||
#!/usr/bin/env bash | ||
# | ||
|
||
SOURCE="$0" | ||
|
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,4 +1,4 @@ | ||
#!/bin/sh | ||
#!/usr/bin/env bash | ||
# | ||
|
||
SOURCE="$0" | ||
|
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 | ||
# | ||
|
||
SOURCE="$0" | ||
while [[ -L "$SOURCE" ]]; do # resolve $SOURCE until the file is no longer a symlink | ||
scriptDir="$(cd -P "$(dirname "$SOURCE")" && pwd)" | ||
SOURCE="$(readlink "$SOURCE")" | ||
[[ ${SOURCE} != /* ]] && SOURCE="$scriptDir/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located | ||
done | ||
scriptDir="$(cd -P "$(dirname "$SOURCE")" && pwd)" | ||
basedir=${scriptDir%/*} | ||
echo "baseDir:"${basedir} | ||
|
||
version=$(cat ${basedir}/build.gradle | grep -Eo '[0-9][0-9.]+') | ||
echo "version:"${version} | ||
export DEPLOY_VERSION=version | ||
export TRAVIS_TAG="${version}-patch" | ||
git push origin :refs/tags/$TRAVIS_TAG | ||
git tag -a $TRAVIS_TAG -m "Auto deployment" | ||
export TRAVIS_TAG_TITLE="Auto deployment ${version}-patch" | ||
|
||
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then | ||
export TRAVIS_TAG_BODY="patch with [#${TRAVIS_PULL_REQUEST}](https://github.com/${TRAVIS_REPO_SLUG}/pull/${TRAVIS_PULL_REQUEST})" | ||
else | ||
export TRAVIS_TAG_BODY="patch with [#${TRAVIS_COMMIT_MESSAGE}](https://github.com/${TRAVIS_REPO_SLUG}/commit/${TRAVIS_COMMIT})" | ||
fi |