Skip to content

Commit da58420

Browse files
committed
Merge branch 'master' into release
* master: (42 commits) Updated CHANGELOG Fixes #273 by not copying the shared folder/file from the release if it has already been copied Re-added postgres env Testing only 1 env Test Test Changed cat command for travis Fix code climate issues Changed build image Fixes #275 by checking that the --no-suggest option exists before attempting to use it Fixes #276 - Allows the passphrase for the private key to be set Fixed missing reason of rollback (#270) Updated dependencies Updated dependencies Update README.md Update README.md Update README.md Update README.md Last chance Setting a random JWT ...
2 parents b32ac21 + eb492de commit da58420

File tree

81 files changed

+1079
-903
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+1079
-903
lines changed

.env.example

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ SOCKET_PORT=6001
1515
SOCKET_SSL_KEY_FILE=
1616
SOCKET_SSL_CERT_FILE=
1717
SOCKET_SSL_CA_FILE=
18+
SOCKET_SSL_KEY_PASSPHRASE=
1819

1920
DB_TYPE=mysql
2021
DB_HOST=localhost

.github/CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ PHPDoc blocks can be checked with
3030

3131
### Automated testing
3232

33-
Coding standards are checked using [StyleCI](http://styleci.io); mess, duplication, PHPDoc blocks and PHP syntax are checked using [PHPCI](https://www.phptesting.org)
33+
Coding standards are checked using [StyleCI](https://styleci.io/repos/33559148); mess, duplication, PHPDoc blocks and PHP syntax are checked using [TravisCI](https://travis-ci.org/REBELinBLUE/deployer)
3434

3535
## .editorconfig
3636

.github/PULL_REQUEST_TEMPLATE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Please prefix your pull request with one of the following: **[FEATURE]** **[FIX]
55
- [ ] I have read and understood the [contributing guidelines](https://github.com/REBElinBLUE/deployer/.github/CONTRIBUTING.md)?
66
- [ ] I have checked that another pull request for this purpose does not exist.
77
- [ ] I have considered, and confirmed that this submission will be valuable to others.
8-
- [ ] Do the PHPCI tests pass?
8+
- [ ] Do the TravisCI tests pass?
99
- [ ] Does the StyleCI test pass?
1010

1111
_NOTE: The last 2 are not required to open a PR and can be done afterwards /

.phpci.yml

-67
This file was deleted.

.travis.yml

+23-7
Original file line numberDiff line numberDiff line change
@@ -12,39 +12,54 @@ cache:
1212
- $HOME/.composer/cache
1313

1414
services:
15+
- mysql
1516
- postgresql
1617
- redis-server
1718

1819
addons:
1920
postgresql: "9.3"
21+
mariadb: "10.1"
2022

2123
before_install:
22-
- if [[ $TRAVIS_PHP_VERSION != 7.1 ]] ; then phpenv config-rm xdebug.ini; fi
24+
- if [[ $TRAVIS_PHP_VERSION == 5.6 ]] ; then phpenv config-rm xdebug.ini; fi
2325
- curl -L https://github.com/kr/beanstalkd/archive/v1.9.tar.gz | tar xz -C /tmp
2426
- cd /tmp/beanstalkd-1.9/
2527
- make
26-
- ./beanstalkd &
28+
- ./beanstalkd 2>&1 >/dev/null &
2729
- cd $TRAVIS_BUILD_DIR
2830

2931
install:
3032
- composer install --no-interaction --no-scripts --prefer-dist --no-suggest
3133

34+
env:
35+
- DB=mysql DB_USERNAME=travis
36+
- DB=pgsql DB_USERNAME=postgres
37+
# - DB=sqlite - SQLite is currently broken
38+
3239
before_script:
3340
- cp .env.example .env
34-
- sed -i 's/DB_TYPE=mysql/DB_TYPE=pgsql/g' .env
35-
- sed -i 's/DB_USERNAME=deployer/DB_USERNAME=postgres/g' .env
41+
- sed -i "s/DB_TYPE=mysql/DB_TYPE=$DB/g" .env
42+
- sed -i "s/DB_CONNECTION=mysql/DB_CONNECTION=$DB/g" .env
43+
- sed -i "s/DB_USERNAME=deployer/DB_USERNAME=$DB_USERNAME/g" .env
3644
- sed -i 's/DB_PASSWORD=secret/DB_PASSWORD=/g' .env
3745
- sed -i 's/SOCKET_SSL_KEY_FILE=//g' .env
3846
- sed -i 's/SOCKET_SSL_CERT_FILE=//g' .env
3947
- sed -i 's/SOCKET_SSL_CA_FILE=//g' .env
48+
- sed -i 's/SOCKET_SSL_KEY_PASSPHRASE=//g' .env
49+
- sed -i 's/REDIS_PASSWORD=null//g' .env
4050
- sed -i 's/TRUSTED_PROXIES=//g' .env
4151
- sed -i 's/GITHUB_OAUTH_TOKEN=//g' .env
52+
- sed -i "s/JWT_SECRET=changeme/JWT_SECRET=$(date +%s | sha256sum | base64 | head -c 32 ; echo)/g" .env
4253
- sed -i '/^#/ d' .env
4354
- sed -i '/^[[:blank:]]*$/d' .env
4455
- php artisan key:generate
45-
- php artisan jwt:generate
56+
#- php artisan jwt:generate --force
4657
- cat .env
47-
- psql -c 'CREATE DATABASE deployer;' -U postgres
58+
- if [[ "$DB" == "mysql" ]] ; then mysql -e 'CREATE DATABASE deployer;'; fi
59+
- if [[ "$DB" == "pgsql" ]] ; then psql -c 'CREATE DATABASE deployer;' -U postgres; fi
60+
- if [[ "$DB" == "sqlite" ]] ; then touch $TRAVIS_BUILD_DIR/database/database.sqlite; fi
61+
- php artisan optimize
62+
- php artisan js-localization:refresh
4863
- php artisan migrate --seed --env="testing"
4964
- chmod -R 777 storage/
5065
- chmod -R 777 bootstrap/
@@ -60,4 +75,5 @@ script:
6075
- vendor/bin/phpdoccheck --directory=app
6176

6277
after_script:
63-
- cat $TRAVIS_BUILD_DIR/storage/logs/*.log
78+
- find $TRAVIS_BUILD_DIR/storage/logs/*.log -type f -print -exec cat {} \;
79+
- vendor/bin/test-reporter

CHANGELOG.md

+26-9
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
# Change Log
22

3-
## [0.0.39](https://github.com/REBELinBLUE/deployer/tree/0.0.39) (2016-09-06)
3+
## [0.0.39](https://github.com/REBELinBLUE/deployer/tree/0.0.39) (2016-10-23)
44
[Full Changelog](https://github.com/REBELinBLUE/deployer/compare/0.0.38...0.0.39)
55

6-
**Implemented enhancements:**
6+
**Fixed bugs:**
7+
8+
- node socket.js doesn't work with SSL when key has a passphrase [\#276](https://github.com/REBELinBLUE/deployer/issues/276)
9+
- Install dev dependencies does not work with older versions of composer due to using a 1.2+ flag [\#275](https://github.com/REBELinBLUE/deployer/issues/275)
10+
- Persistent Folder creating multiple folders [\#273](https://github.com/REBELinBLUE/deployer/issues/273)
11+
12+
**Merged pull requests:**
713

8-
- Automatically detect and restart php-fpm [\#238](https://github.com/REBELinBLUE/deployer/pull/238) ([REBELinBLUE](https://github.com/REBELinBLUE))
9-
- Access control lists/User levels [\#236](https://github.com/REBELinBLUE/deployer/pull/236) ([REBELinBLUE](https://github.com/REBELinBLUE))
14+
- Fixed missing reason of rollback [\#270](https://github.com/REBELinBLUE/deployer/pull/270) ([phecho](https://github.com/phecho))
15+
- Added target trait [\#269](https://github.com/REBELinBLUE/deployer/pull/269) ([phecho](https://github.com/phecho))
16+
- Cleaning up polymorphic relationships \(projects/templates\) [\#265](https://github.com/REBELinBLUE/deployer/pull/265) ([REBELinBLUE](https://github.com/REBELinBLUE))
1017

1118
## [0.0.38](https://github.com/REBELinBLUE/deployer/tree/0.0.38) (2016-08-21)
1219
[Full Changelog](https://github.com/REBELinBLUE/deployer/compare/0.0.37...0.0.38)
@@ -16,7 +23,19 @@
1623
- usort: Array was modified by the user comparison function [\#258](https://github.com/REBELinBLUE/deployer/issues/258)
1724

1825
## [0.0.37](https://github.com/REBELinBLUE/deployer/tree/0.0.37) (2016-08-06)
19-
[Full Changelog](https://github.com/REBELinBLUE/deployer/compare/0.0.36...0.0.37)
26+
[Full Changelog](https://github.com/REBELinBLUE/deployer/compare/blah-blah-blah-blah...0.0.37)
27+
28+
**Fixed bugs:**
29+
30+
- --warning option don't exist on all versions of tar [\#257](https://github.com/REBELinBLUE/deployer/issues/257)
31+
- Fatal error if git tags contain a string which is not a valid version [\#256](https://github.com/REBELinBLUE/deployer/issues/256)
32+
- Installer gets into an infinite loop if there are PDO drivers loaded before MySQL [\#254](https://github.com/REBELinBLUE/deployer/pull/254) ([moxx](https://github.com/moxx))
33+
34+
## [blah-blah-blah-blah](https://github.com/REBELinBLUE/deployer/tree/blah-blah-blah-blah) (2016-08-02)
35+
[Full Changelog](https://github.com/REBELinBLUE/deployer/compare/test...blah-blah-blah-blah)
36+
37+
## [test](https://github.com/REBELinBLUE/deployer/tree/test) (2016-08-02)
38+
[Full Changelog](https://github.com/REBELinBLUE/deployer/compare/0.0.36...test)
2039

2140
**Implemented enhancements:**
2241

@@ -26,10 +45,7 @@
2645

2746
**Fixed bugs:**
2847

29-
- --warning option don't exist on all versions of tar [\#257](https://github.com/REBELinBLUE/deployer/issues/257)
30-
- Fatal error if git tags contain a string which is not a valid version [\#256](https://github.com/REBELinBLUE/deployer/issues/256)
3148
- Installer should check for node or nodejs [\#230](https://github.com/REBELinBLUE/deployer/issues/230)
32-
- Installer gets into an infinite loop if there are PDO drivers loaded before MySQL [\#254](https://github.com/REBELinBLUE/deployer/pull/254) ([moxx](https://github.com/moxx))
3349
- Incorrect Lang variables [\#239](https://github.com/REBELinBLUE/deployer/pull/239) ([uLow](https://github.com/uLow))
3450

3551
## [0.0.36](https://github.com/REBELinBLUE/deployer/tree/0.0.36) (2016-05-30)
@@ -113,6 +129,7 @@
113129
- Remove need for mcrypt [\#183](https://github.com/REBELinBLUE/deployer/issues/183)
114130
- Have the update process backup the DB [\#177](https://github.com/REBELinBLUE/deployer/issues/177)
115131
- Re-ordering groups [\#176](https://github.com/REBELinBLUE/deployer/issues/176)
132+
- Checking if composer exists [\#103](https://github.com/REBELinBLUE/deployer/issues/103)
116133
- Mirroring repositories locally to deployer [\#129](https://github.com/REBELinBLUE/deployer/pull/129) ([REBELinBLUE](https://github.com/REBELinBLUE))
117134
- Checking if composer is installed [\#104](https://github.com/REBELinBLUE/deployer/pull/104) ([REBELinBLUE](https://github.com/REBELinBLUE))
118135

@@ -420,4 +437,4 @@
420437
## [0.0.1](https://github.com/REBELinBLUE/deployer/tree/0.0.1) (2015-04-08)
421438

422439

423-
\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
440+
\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*

README.md

+13-13
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,22 @@ Deployer is a PHP Application deployment system powered by [Laravel 5.2](http://
44

55
Check out the [releases](https://github.com/REBELinBLUE/deployer/releases), [license](/LICENSE.md), [screenshots](/SCREENSHOTS.md), and [contribution guidelines](/.github/CONTRIBUTING.md).
66

7-
[![Gitter](https://img.shields.io/badge/chat-on%20gitter-green.svg)](https://gitter.im/REBELinBLUE/deployer)
7+
[![Gitter](https://img.shields.io/badge/chat-on%20gitter-brightgreen.svg?style=flat-square)](https://gitter.im/REBELinBLUE/deployer)
88

99
**Current Build Status**
1010

11-
[![StyleCI](https://styleci.io/repos/33559148/shield?style=flat)](https://styleci.io/repos/33559148)
12-
[![Build Status](https://travis-ci.org/REBELinBLUE/deployer.svg?branch=master)](https://travis-ci.org/REBELinBLUE/deployer)
13-
[![Build Status](http://ci.rebelinblue.com/build-status/image/3?branch=master&style=flat&label=PHPCI)](http://ci.rebelinblue.com/build-status/view/3?branch=master)
14-
[![Code Climate](https://codeclimate.com/github/REBELinBLUE/deployer/badges/gpa.svg)](https://codeclimate.com/github/REBELinBLUE/deployer)
15-
[![Test Coverage](https://codeclimate.com/github/REBELinBLUE/deployer/badges/coverage.svg)](https://codeclimate.com/github/REBELinBLUE/deployer)
16-
[![SensioLabs Insight](https://img.shields.io/sensiolabs/i/686dd98b-c0e5-465b-8f14-29b1cab47f3b.svg)](https://insight.sensiolabs.com/projects/686dd98b-c0e5-465b-8f14-29b1cab47f3b)
11+
[![StyleCI](https://styleci.io/repos/33559148/shield?style=flat-square&branch=master)](https://styleci.io/repos/33559148)
12+
[![Build Status](https://img.shields.io/travis/REBELinBLUE/deployer.svg?style=flat-square&branch=master)](https://travis-ci.org/REBELinBLUE/deployer)
13+
[![Code Climate](https://img.shields.io/codeclimate/github/REBELinBLUE/deployer.svg?style=flat-square)](https://codeclimate.com/github/REBELinBLUE/deployer)
14+
[![Test Coverage](https://img.shields.io/codeclimate/coverage/github/REBELinBLUE/deployer.svg?style=flat-square)](https://codeclimate.com/github/REBELinBLUE/deployer)
15+
[![SensioLabs Insight](https://img.shields.io/sensiolabs/i/686dd98b-c0e5-465b-8f14-29b1cab47f3b.svg?style=flat-square)](https://insight.sensiolabs.com/projects/686dd98b-c0e5-465b-8f14-29b1cab47f3b)
1716

1817
**Release Status**
1918

20-
[![PHP Dependency Status](https://www.versioneye.com/user/projects/5531329410e7141211000f29/badge.svg)](https://www.versioneye.com/user/projects/5531329410e7141211000f29)
21-
[![Node Dependency Status](https://www.versioneye.com/user/projects/5531329610e714f9e500109c/badge.svg)](https://www.versioneye.com/user/projects/5531329610e714f9e500109c)
22-
[![Latest Version](https://img.shields.io/github/release/REBELinBLUE/deployer.svg)](https://github.com/REBELinBLUE/deployer/releases)
19+
[![PHP Dependency Status](https://www.versioneye.com/user/projects/5531329410e7141211000f29/badge.svg?style=flat-square)](https://www.versioneye.com/user/projects/5531329410e7141211000f29)
20+
[![Node Dependency Status](https://www.versioneye.com/user/projects/5531329610e714f9e500109c/badge.svg?style=flat-square)](https://www.versioneye.com/user/projects/5531329610e714f9e500109c)
21+
[![Latest Version](https://img.shields.io/github/release/REBELinBLUE/deployer.svg?style=flat-square)](https://github.com/REBELinBLUE/deployer/releases)
22+
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](/LICENSE.md)
2323

2424
## What it does
2525

@@ -95,7 +95,7 @@ $ git clone https://github.com/REBELinBLUE/deployer.git
9595
2. Checkout the latest release
9696

9797
```shell
98-
$ git checkout 0.0.38
98+
$ git checkout 0.0.39
9999
```
100100

101101
3. Install dependencies
@@ -136,7 +136,7 @@ $ editor .env
136136

137137
```shell
138138
$ git fetch --all
139-
$ git checkout 0.0.38
139+
$ git checkout 0.0.39
140140
```
141141

142142
2. Update the dependencies
@@ -154,4 +154,4 @@ $ php artisan app:update
154154

155155
## License
156156

157-
Deployer is licensed under [The MIT License (MIT)](LICENSE.md).
157+
Deployer is licensed under [The MIT License (MIT)](/LICENSE.md).

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.0.39
1+
0.0.40-dev

app/Command.php

+5-14
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Illuminate\Database\Eloquent\Model;
66
use Illuminate\Database\Eloquent\SoftDeletes;
77
use REBELinBLUE\Deployer\Traits\BroadcastChanges;
8+
use REBELinBLUE\Deployer\Traits\HasTarget;
89

910
/**
1011
* The command model.
@@ -26,7 +27,7 @@
2627
*/
2728
class Command extends Model
2829
{
29-
use SoftDeletes, BroadcastChanges;
30+
use SoftDeletes, BroadcastChanges, HasTarget;
3031

3132
const BEFORE_CLONE = 1;
3233
const DO_CLONE = 2;
@@ -46,14 +47,15 @@ class Command extends Model
4647
*
4748
* @var array
4849
*/
49-
protected $hidden = ['project', 'created_at', 'deleted_at', 'updated_at'];
50+
protected $hidden = ['created_at', 'deleted_at', 'updated_at'];
5051

5152
/**
5253
* The attributes that are mass assignable.
5354
*
5455
* @var array
5556
*/
56-
protected $fillable = ['name', 'user', 'script', 'project_id', 'step', 'order', 'optional', 'default_on'];
57+
protected $fillable = ['name', 'user', 'script', 'target_type', 'target_id',
58+
'step', 'order', 'optional', 'default_on', ];
5759

5860
/**
5961
* The attributes that should be casted to native types.
@@ -62,23 +64,12 @@ class Command extends Model
6264
*/
6365
protected $casts = [
6466
'id' => 'integer',
65-
'project_id' => 'integer',
6667
'step' => 'integer',
6768
'optional' => 'boolean',
6869
'default_on' => 'boolean',
6970
'order' => 'integer',
7071
];
7172

72-
/**
73-
* Belongs to relationship.
74-
*
75-
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
76-
*/
77-
public function project()
78-
{
79-
return $this->belongsTo(Project::class);
80-
}
81-
8273
/**
8374
* Belongs to many relationship.
8475
*

app/ProjectFile.php app/ConfigFile.php

+5-15
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Illuminate\Database\Eloquent\Model;
66
use Illuminate\Database\Eloquent\SoftDeletes;
77
use REBELinBLUE\Deployer\Traits\BroadcastChanges;
8+
use REBELinBLUE\Deployer\Traits\HasTarget;
89

910
/**
1011
* Static file for project.
@@ -19,16 +20,16 @@
1920
* @property string $deleted_at
2021
* @property-read Project $project
2122
*/
22-
class ProjectFile extends Model
23+
class ConfigFile extends Model
2324
{
24-
use SoftDeletes, BroadcastChanges;
25+
use SoftDeletes, BroadcastChanges, HasTarget;
2526

2627
/**
2728
* The attributes that are mass assignable.
2829
*
2930
* @var array
3031
*/
31-
protected $fillable = ['name', 'path', 'content', 'project_id'];
32+
protected $fillable = ['name', 'path', 'content', 'target_type', 'target_id'];
3233

3334
/**
3435
* The attributes excluded from the model's JSON form.
@@ -43,17 +44,6 @@ class ProjectFile extends Model
4344
* @var array
4445
*/
4546
protected $casts = [
46-
'id' => 'integer',
47-
'project_id' => 'integer',
47+
'id' => 'integer',
4848
];
49-
50-
/**
51-
* Belongs to relationship.
52-
*
53-
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
54-
*/
55-
public function project()
56-
{
57-
return $this->belongsTo(Project::class);
58-
}
5949
}

0 commit comments

Comments
 (0)