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

Commit 31561c5

Browse files
committed
Removing branch argument from deploy tasks.
1 parent 1e452fb commit 31561c5

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ script:
5252
- ../bolted8/bolt.sh build:validate:test -Dbehat.run-server=true -Dbehat.launch-phantom=true
5353
# Deploy build artifact.
5454
- export DEPLOY_PR=true
55-
- ../bolted8/scripts/deploy/travis-deploy.sh 8.x 8.x-build
55+
- ../bolted8/scripts/deploy/travis-deploy.sh 8.x
5656
# Validate and run 'bolt' phpunit tests.
5757
- phpcs --standard=../bolted8/vendor/drupal/coder/coder_sniffer/Drupal/ruleset.xml tests
5858
- phpunit tests

template/build/core/phing/tasks/deploy.xml

+6-5
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,15 @@
22

33
<target name="deploy:artifact" description="Builds separate artifact and pushes to git.remotes defined project.yml.">
44

5-
<!-- deploy.branch and deploy.commitMsg must be passed as params at runtime. -->
5+
<!-- deploy.commitMsg must be passed as a param at runtime. -->
66
<if>
77
<or>
8-
<not><isset property="deploy.branch"/></not>
98
<not><isset property="deploy.commitMsg"/></not>
109
</or>
1110
<then>
12-
<fail>You must pass deploy.branch and deploy.commitMsg as runtime parameters.</fail>
11+
<fail>You must pass deploy.commitMsg as a runtime parameter.</fail>
1312
<echo message="Command should match syntax:"/>
14-
<echo message="./bolt.sh deploy:artifact -Ddeploy.branch=8.x-build -Ddeploy.commitMsg='BLT-123: The commit message.'"/>
13+
<echo message="./bolt.sh deploy:artifact -Ddeploy.commitMsg='BLT-123: The commit message.'"/>
1514
</then>
1615
</if>
1716

@@ -39,8 +38,10 @@
3938
<exec command="git remote add ${remoteName} ${deploy.remote}" dir="${deploy.dir}" logoutput="true" passthru="true"/>
4039
<exec command="git fetch ${remoteName}" dir="${deploy.dir}" logoutput="true" passthru="true"/>
4140

42-
<!-- Create the new branch. -->
41+
<!-- Create the new branch, "[source-branch-name]-build". -->
42+
<property name="deploy.branch" value="${git.current_branch}-build" />
4343
<exec command="git checkout -b ${deploy.branch}" dir="${deploy.dir}" logoutput="true" passthru="true"/>
44+
4445
<!-- Pull the latest updates (if available). -->
4546
<exec command="git merge ${remoteName}/${deploy.branch}" dir="${deploy.dir}" logoutput="true" passthru="true"/>
4647
</target>

template/scripts/deploy/travis-deploy.sh

+2-3
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,14 @@
33
# What does this script do?
44
# This script will watch for a Travis build on a specific
55
# $source_branch on the canonical GitHub repository and deploy build artifacts
6-
# to $dest_branch on the git.remote specified in project.yml.
6+
# to [source-branch]-build on the git.remote specified in project.yml.
77

88
# How to use this script?
99
# This script should be executed in the `after_success` section of .travis.yml.
1010
# It requires two arguments. Example call:
1111
# `scripts/deploy/travis-deploy.sh master master-build`
1212

1313
source_branch=$1 # The branch to watch.
14-
dest_branch=$2 # The branch to which the build artifact should be committed and deployed.
1514
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
1615

1716
# Note that the canonical repository is watched. Commits to forked repositories
@@ -27,7 +26,7 @@ if [[ "${TRAVIS_PULL_REQUEST}" = "false" ]] || [[ "${DEPLOY_PR}" = "true" ]];
2726
echo "Build artifact will be deployed."
2827
commit_msg="Automated commit by Travis CI for Build #${TRAVIS_BUILD_ID}";
2928
# Call the `deploy` Phing target, passing in required parameters.
30-
${DIR}/../../bolt.sh deploy:artifact -Ddeploy.branch="${dest_branch}" -Ddeploy.commitMsg="${commit_msg}";
29+
${DIR}/../../bolt.sh deploy:artifact -Ddeploy.commitMsg="${commit_msg}";
3130
else
3231
echo "Build artifact will NOT be deployed for this branch."
3332
fi

0 commit comments

Comments
 (0)