Skip to content

Commit 2f39915

Browse files
authored
Make the parameter --commit only mandatory for the deploy task
1 parent e70ea45 commit 2f39915

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

Envoy.blade.php

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@
3737
throw new Exception('Server URL is not defined for environment '. $environment .'.');
3838
} elseif ( ! $repoUrl) {
3939
throw new Exception('Repository URL is not defined for environment '. $environment .'.');
40-
} elseif ( ! $commitHash) {
41-
throw new Exception('No commit hash/tag was provided. Please provide one using --commit.');
4240
}
4341

4442
// Define paths
@@ -52,7 +50,7 @@
5250
$releasePath = $releasesPath .'/'. (isset($release) ? $release : date('YmdHis'));
5351
@endsetup
5452

55-
@servers(['web' => '-A '. $sshOptions .' "'. $server .'"'])
53+
@servers(['web' => '-q -A '. $sshOptions .' "'. $server .'"'])
5654

5755
@task('deploy:setup')
5856
if [ ! -d "{{ $releasesPath }}" ]; then
@@ -70,22 +68,23 @@
7068

7169
@task('deploy:check')
7270
if [ ! -d "{{ $releasesPath }}" ]; then
73-
echo "Releases path not found."
71+
echo "Releases path not found." 1>&2;
7472
exit 1
7573
fi
7674

7775
if [ ! -d "{{ $sharedPath }}" ]; then
78-
echo "Shared path not found."
76+
echo "Shared path not found." 1>&2;
7977
exit 1
8078
fi
8179

8280
if [ ! -d "{{ $backupsPath }}" ]; then
83-
echo "Backups path not found."
81+
echo "Backups path not found." 1>&2;
8482
exit 1
8583
fi
8684
@endtask
8785

8886
@macro('deploy')
87+
deploy:assert_commit
8988
deploy:starting
9089
deploy:check
9190
deploy:started
@@ -109,6 +108,13 @@
109108
deploy:revert_release
110109
@endmacro
111110

111+
@task('deploy:assert_commit')
112+
@if (! $commitHash)
113+
echo "No commit hash/tag was provided. Please provide one using --commit." 1>&2;
114+
exit 1
115+
@endif
116+
@endtask
117+
112118
@task('deploy:update_code')
113119
export GIT_SSH_COMMAND="ssh -o PasswordAuthentication=no -o StrictHostKeyChecking=no"
114120

0 commit comments

Comments
 (0)