-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Envoy.blade.php
52 lines (43 loc) · 1.6 KB
/
Envoy.blade.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// See Envoy doc: https://laravel.com/docs/5.8/envoy
//
// Configure with: `envoy run git-config --host=my-host --site=site-conf`
// Deploy with: `envoy run deploy`
@servers(['local' => 'localhost', 'web' => $web ])
@setup
$commit = exec('git log --pretty="%H" -n1 HEAD');
//$version = exec('php artisan monica:getversion');
$release = exec('git log --pretty="%h" -n1 HEAD');
@endsetup
@story('deploy')
pull
sentry-file
push
@endstory
@task('push', ['on' => 'local'])
git push -u deploy {{ $branch ?? 'master' }} --force
git reset --hard {{ $commit }}
git branch --set-upstream-to=origin/master master
@endtask
@task('pull', ['on' => 'local'])
git fetch origin
git checkout {{ $branch ?? 'master' }}
git pull
@endtask
@task('sentry-file', ['on' => 'local'])
echo {{ $commit }} > .sentry-commit
echo {{ $release }} > .sentry-release
git add -f .sentry-commit .sentry-release
git commit -m 'add sentry files'
@endtask
@task('sentry-release', ['on' => 'web'])
php artisan sentry:release --force -vvv --release=$(cat .sentry-release) --environment=$SENTRY_ENV --commit=$(cat .sentry-commit)
@endtask
@task('sentry-local', ['on' => 'local'])
test -x ~/.local/bin/sentry-cli || curl -sL https://sentry.io/get-cli/ | INSTALL_DIR=~/.local/bin bash
source .env
php artisan sentry:release --force -vvv --release={{ $release }} --environment={{ $environment ?? 'production' }} --commit={{ $commit }}
@endtask
@task('git-config', ['on' => 'local'])
git remote remove deploy || true
git remote add deploy {{ $site.'@'.$host.':'.$site.'.git' }}
@endtask