Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding deploy.dryRun param for deploy:artifact target. #149

Merged
merged 1 commit into from
Jun 14, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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