Skip to content
This repository was archived by the owner on May 25, 2025. It is now read-only.

Commit 64aac2f

Browse files
committed
Release document only from master branch
1 parent afc44bd commit 64aac2f

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

.travis.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@ sudo: false
22
language: java
33
jdk: oraclejdk7
44

5-
after_success:
6-
- ./gradlew asciidoctor
7-
- ./gradle/release-docs.sh
5+
install: ./gradlew -v
6+
script: ./gradlew check asciidoctor
7+
after_success: ./gradle/release-docs.sh
8+
before_deploy: ./gradlew shadowJar bintrayUpload
89

9-
before_deploy:
10-
- ./gradlew shadowJar bintrayUpload
1110
deploy:
1211
provider: releases
1312
api_key:

gradle/release-docs.sh

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
#!/bin/bash -xe
2-
HUB=2.2.0
2+
HUB="2.2.0"
3+
PR_SOURCE="build/asciidoc/html5"
34
PR_REPO="gradle-ssh-plugin/gradle-ssh-plugin.github.io"
4-
PR_BRANCH="${TRAVIS_BRANCH}-${TRAVIS_BUILD_NUMBER}"
5+
PR_BRANCH="travis-${TRAVIS_BUILD_NUMBER}"
6+
PR_MESSAGE="Release document"
7+
8+
# Release only from master branch
9+
test "$TRAVIS_BRANCH" = "master"
10+
test -d "$PR_SOURCE"
511

612
# Set credential
713
mkdir -p "$HOME/.config"
@@ -30,9 +36,9 @@ hub clone "$PR_REPO" _
3036
cd _
3137
hub checkout -b "$PR_BRANCH"
3238
hub rm -r docs
33-
cp -a ../build/asciidoc/html5 docs
39+
cp -a "../$PR_SOURCE" docs
3440
hub add .
35-
hub commit -m "Release from $TRAVIS_BRANCH"
41+
hub commit -m "$PR_MESSAGE"
3642
hub push origin "$PR_BRANCH"
37-
hub pull-request -m "Release from $TRAVIS_BRANCH"
43+
hub pull-request -m "$PR_MESSAGE"
3844
cd ..

0 commit comments

Comments
 (0)