# Your Review App deployment scripts - for a working example please check https://gitlab.com/Flockademic/Flockademic/blob/5a45f1c2412e93810fab50e2dab8949e2d0633c7/.gitlab-ci.yml#L315
# Your Review App deployment scripts - for a working example please check https://gitlab.com/Flockademic/Flockademic/blob/5a45f1c2412e93810fab50e2dab8949e2d0633c7/.gitlab-ci.yml#L315
@@ -566,15 +566,11 @@ Also set the variables `DB_HOST` to `mysql` and `DB_USERNAME` to `root`, which a
...
@@ -566,15 +566,11 @@ Also set the variables `DB_HOST` to `mysql` and `DB_USERNAME` to `root`, which a
We define `DB_HOST` as `mysql` instead of `127.0.0.1`, as we use MySQL Docker image as a service which [is linked to the main Docker image](../../docker/using_docker_images.md#how-services-are-linked-to-the-job).
We define `DB_HOST` as `mysql` instead of `127.0.0.1`, as we use MySQL Docker image as a service which [is linked to the main Docker image](../../docker/using_docker_images.md#how-services-are-linked-to-the-job).
```yaml
```yaml
...
variables:
variables:
MYSQL_DATABASE:homestead
MYSQL_DATABASE:homestead
MYSQL_ROOT_PASSWORD:secret
MYSQL_ROOT_PASSWORD:secret
DB_HOST:mysql
DB_HOST:mysql
DB_USERNAME:root
DB_USERNAME:root
...
```
```
#### Unit Test as the first job
#### Unit Test as the first job
...
@@ -584,8 +580,6 @@ We defined the required shell scripts as an array of the [script](../../yaml/REA
...
@@ -584,8 +580,6 @@ We defined the required shell scripts as an array of the [script](../../yaml/REA
These scripts are some Artisan commands to prepare the Laravel, and, at the end of the script, we'll run the tests by `PHPUnit`.
These scripts are some Artisan commands to prepare the Laravel, and, at the end of the script, we'll run the tests by `PHPUnit`.
```yaml
```yaml
...
unit_test:
unit_test:
script:
script:
# Install app dependencies
# Install app dependencies
...
@@ -598,8 +592,6 @@ unit_test:
...
@@ -598,8 +592,6 @@ unit_test:
-php artisan migrate
-php artisan migrate
# Run tests
# Run tests
-vendor/bin/phpunit
-vendor/bin/phpunit
...
```
```
#### Deploy to production
#### Deploy to production
...
@@ -615,8 +607,6 @@ The `only` keyword tells GitLab CI/CD that the job should be executed only when
...
@@ -615,8 +607,6 @@ The `only` keyword tells GitLab CI/CD that the job should be executed only when
Lastly, `when: manual` is used to turn the job from running automatically to a manual action.
Lastly, `when: manual` is used to turn the job from running automatically to a manual action.
```yaml
```yaml
...
deploy_production:
deploy_production:
script:
script:
# Add the private SSH key to the build environment
# Add the private SSH key to the build environment