Skip to content

Commit

Permalink
Adding deploy.dryRun param for deploy:artifact target. (#149)
Browse files Browse the repository at this point in the history
  • Loading branch information
grasmash authored Jun 14, 2016
1 parent 5e671d2 commit fba1561
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
10 changes: 8 additions & 2 deletions template/build/core/phing/tasks/deploy.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,13 @@
<phingcall target="deploy:artifact:build"/>
<phingcall target="deploy:artifact:commit"/>

<!-- Push up changes to remotes. -->
<phingcall target="deploy:artifact:push-all"/>
<!-- Push up changes to remotes if this is not a dry run.-->
<if>
<not><isset property="deploy.dryRun"/></not>
<then>
<phingcall target="deploy:artifact:push-all"/>
</then>
</if>
</target>

<target name="deploy:artifact:add-remote" description="Adds a git remote and checks out deploy branch from upstream.">
Expand Down Expand Up @@ -70,6 +75,7 @@
</target>

<target name="deploy:artifact:commit">
<!-- We make these commands quiet because they can cause the output to be so long that Travis CI stops logging. -->
<exec command="git add -A" dir="${deploy.dir}" logoutput="true" passthru="true" checkreturn="true"/>
<exec command="git commit -m '${deploy.commitMsg}' --quiet" dir="${deploy.dir}" logoutput="true" passthru="true" checkreturn="true"/>
</target>
Expand Down
14 changes: 12 additions & 2 deletions template/readme/deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ In order to create the build artifact in `/deploy`, simply run

This task is analogous to `setup:build:all` but with a few critical differences:
* The docroot is created at `/deploy/docroot`.
* Only production required to the docroot
* Only production required to the docroot
* (planned) CSS / JS are compiled in production mode (compressed / minified)
* (planned) Sensitive files, such as CHANGELOG.txt, are removed.

Expand All @@ -36,13 +36,23 @@ After the artifact is created, you can inspect it or even run it as a website lo
## <a name="build-artifact"></a>Create and deploy the build artifact

To both create and deploy the build artifact in a single command, run the following command

````
./blt.sh deploy:artifact -Ddeploy.branch=develop-build -Ddeploy.commitMsg='BLT-123: The commit message.'
````

This command will commit the artifact to the `develop-build` branch with the specified commit message and push it to the remotes defined in project.yml.

### Debugging deployment artifacts

If you would like to create, commit, but _not push_ the artifact, you may do a dry run:

````
./blt.sh deploy:artifact -Ddeploy.branch=develop-build -Ddeploy.commitMsg='BLT-123: The commit message.' -Ddeploy.dryRun=true
````

This is helpful for debugging deployment artifacts.

## Continuous integration

Instead of performing these deployments manually, you can enlist the help of a CI tool such as Travis or Jenkins.
Expand Down

0 comments on commit fba1561

Please sign in to comment.