Commit 75361309 authored by Marcel Amirault's avatar Marcel Amirault

Update yaml codeblocks

Ran yamllint on yaml codeblocks to identify
minor formatting inconsistencies
parent 142d2df5
......@@ -85,7 +85,7 @@ This can be solved by adding your CA's certificate to the kaniko certificate
store:
```yaml
before_script:
before_script:
- mkdir -p /kaniko/.docker
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
- |
......
......@@ -228,6 +228,7 @@ deploy_terraform:
stage: deploy
script:
# Your Review App deployment scripts - for a working example please check https://gitlab.com/Flockademic/Flockademic/blob/5a45f1c2412e93810fab50e2dab8949e2d0633c7/.gitlab-ci.yml#L315
- echo
e2e:firefox:
stage: confidence-check
services:
......
......@@ -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).
```yaml
...
variables:
MYSQL_DATABASE: homestead
MYSQL_ROOT_PASSWORD: secret
DB_HOST: mysql
DB_USERNAME: root
...
```
#### Unit Test as the first job
......@@ -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`.
```yaml
...
unit_test:
script:
# Install app dependencies
......@@ -598,8 +592,6 @@ unit_test:
- php artisan migrate
# Run tests
- vendor/bin/phpunit
...
```
#### Deploy to production
......@@ -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.
```yaml
...
deploy_production:
script:
# Add the private SSH key to the build environment
......
......@@ -73,24 +73,16 @@ Now that we created the script that contains all prerequisites for our build
environment, let's add it in `.gitlab-ci.yml`:
```yaml
...
before_script:
- bash ci/docker_install.sh > /dev/null
...
```
Last step, run the actual tests using `phpunit`:
```yaml
...
test:app:
script:
- phpunit --configuration phpunit_myapp.xml
...
```
Finally, commit your files and push them to GitLab to see your build succeeding
......@@ -103,7 +95,7 @@ The final `.gitlab-ci.yml` should look similar to this:
image: php:5.6
before_script:
# Install dependencies
# Install dependencies
- bash ci/docker_install.sh > /dev/null
test:app:
......@@ -118,7 +110,7 @@ with a different Docker image version and the runner will do the rest:
```yaml
before_script:
# Install dependencies
# Install dependencies
- bash ci/docker_install.sh > /dev/null
# We test PHP5.6
......@@ -231,8 +223,6 @@ In order to execute Composer before running your tests, simply add the
following in your `.gitlab-ci.yml`:
```yaml
...
# Composer stores all downloaded packages in the vendor/ directory.
# Do not use the following if the vendor/ directory is committed to
# your git repository.
......@@ -241,15 +231,13 @@ cache:
- vendor/
before_script:
# Install composer dependencies
# Install composer dependencies
- wget https://composer.github.io/installer.sig -O - -q | tr -d '\n' > installer.sig
- php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
- php -r "if (hash_file('SHA384', 'composer-setup.php') === file_get_contents('installer.sig')) { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
- php composer-setup.php
- php -r "unlink('composer-setup.php'); unlink('installer.sig');"
- php composer.phar install
...
```
## Access private packages or dependencies
......
......@@ -238,7 +238,6 @@ case it will apply to all jobs in the pipeline:
```yaml
my_job:
image: alpine
...
```
#### `post`
......@@ -284,7 +283,6 @@ stages:
my_job:
stage: build
...
```
#### `steps`
......@@ -297,7 +295,6 @@ my_job:
script:
- echo "hello! the current time is:"
- time
...
```
### Directives
......
......@@ -91,8 +91,8 @@ to access it. This is where an SSH key pair comes in handy.
## Optionally, if you will be using any Git commands, set the user name and
## and email.
##
#- git config --global user.email "user@example.com"
#- git config --global user.name "User name"
# - git config --global user.email "user@example.com"
# - git config --global user.name "User name"
```
NOTE: **Note:**
......@@ -193,8 +193,8 @@ before_script:
## Replace example.com with your private server's domain name. Repeat that
## command if you have more than one server to connect to.
##
#- ssh-keyscan example.com >> ~/.ssh/known_hosts
#- chmod 644 ~/.ssh/known_hosts
# - ssh-keyscan example.com >> ~/.ssh/known_hosts
# - chmod 644 ~/.ssh/known_hosts
##
## You can optionally disable host key checking. Be aware that by adding that
......@@ -202,7 +202,7 @@ before_script:
## WARNING: Use this only with the Docker executor, if you use it with shell
## you will overwrite your user's SSH config.
##
#- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" >> ~/.ssh/config'
# - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" >> ~/.ssh/config'
```
## Example project
......
......@@ -3080,7 +3080,7 @@ For example, to match a single file:
```yaml
test:
script: [ "echo 'test' > file.txt" ]
script: ["echo 'test' > file.txt"]
artifacts:
expose_as: 'artifact 1'
paths: ['file.txt']
......@@ -3093,7 +3093,7 @@ An example that will match an entire directory:
```yaml
test:
script: [ "mkdir test && echo 'test' > test/file.txt" ]
script: ["mkdir test && echo 'test' > test/file.txt"]
artifacts:
expose_as: 'artifact 1'
paths: ['test/']
......@@ -3976,17 +3976,16 @@ tags. These options cannot be used together, so choose one:
- 'm1'
- 'm2'
- 'm3'
released_at: '2020-07-15T08:00:00Z' # Optional, will auto generate if not defined,
# or can use a variable.
released_at: '2020-07-15T08:00:00Z' # Optional, will auto generate if not defined, or can use a variable.
```
- To create a release automatically when commits are pushed or merged to the default branch,
using a new Git tag that is defined with variables:
NOTE: **Note:**
Environment variables set in `before_script` or `script` are not available for expanding
in the same job. Read more about
[potentially making variables available for expanding](https://gitlab.com/gitlab-org/gitlab-runner/-/issues/6400).
NOTE: **Note:**
Environment variables set in `before_script` or `script` are not available for expanding
in the same job. Read more about
[potentially making variables available for expanding](https://gitlab.com/gitlab-org/gitlab-runner/-/issues/6400).
```yaml
prepare_job:
......@@ -4023,8 +4022,7 @@ in the same job. Read more about
- 'm1'
- 'm2'
- 'm3'
released_at: '2020-07-15T08:00:00Z' # Optional, will auto generate if not defined,
# or can use a variable.
released_at: '2020-07-15T08:00:00Z' # Optional, will auto generate if not defined, or can use a variable.
```
#### `releaser-cli` command line
......@@ -4659,7 +4657,7 @@ If you want to temporarily 'disable' a job, rather than commenting out all the
lines where the job is defined:
```yaml
#hidden_job:
# hidden_job:
# script:
# - run test
```
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment