Skip to content

Commit 1087f8b

Browse files
PotHixlord
authored andcommitted
Document --source-only and add --push-only
The `--source-only` already works to only build and not deploy. But sometimes we want to just push and not build. An example of that is when you want to use Docker to build the project, avoiding the installation of the whole Ruby environment in your computer. This commit adds `--push-only` to add the ability to execute only the actions related to `git` and avoid the project build. No API was broken by this commit, it's a minor change.
1 parent 2e88f72 commit 1087f8b

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

deploy.sh

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,14 @@ Options:
1515
deploy branch.
1616
-n, --no-hash Don't append the source commit's hash to the deploy
1717
commit's message.
18+
--source-only Only build but not push
19+
--push-only Only push but not build
1820
"
1921

20-
bundle exec middleman build --clean
22+
23+
run_build() {
24+
bundle exec middleman build --clean
25+
}
2126

2227
parse_args() {
2328
# Set args from a local environment file.
@@ -200,4 +205,11 @@ sanitize() {
200205
"$@" 2> >(filter 1>&2) | filter
201206
}
202207

203-
[[ $1 = --source-only ]] || main "$@"
208+
if [[ $1 = --source-only ]]; then
209+
run_build
210+
elif [[ $1 = --push-only ]]; then
211+
main "$@"
212+
else
213+
run_build
214+
main "$@"
215+
fi

0 commit comments

Comments
 (0)