Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2021-08-28 18:09:02 +00:00
parent 936e34d90c
commit 49d5a047c5
2 changed files with 68 additions and 8 deletions

View File

@ -33,7 +33,7 @@ The following table lists examples with step-by-step tutorials that are containe
| npm with semantic-release | [Publish npm packages to the GitLab Package Registry using semantic-release](semantic-release.md). |
| PHP with Laravel, Envoy | [Test and deploy Laravel applications with GitLab CI/CD and Envoy](laravel_with_gitlab_and_envoy/index.md). |
| PHP with npm, SCP | [Running Composer and npm scripts with deployment via SCP in GitLab CI/CD](deployment/composer-npm-deploy.md). |
| PHP with PHPunit, `atoum` | [Testing PHP projects](php.md). |
| PHP with PHPunit, `atoum` | [Testing PHP projects](php.md). |
| Secrets management with Vault | [Authenticating and Reading Secrets With HashiCorp Vault](authenticating-with-hashicorp-vault/index.md). |
### Contributed examples
@ -58,7 +58,7 @@ separate example projects:
Get started with GitLab CI/CD and your favorite programming language or framework by using a
`.gitlab-ci.yml` [template](https://gitlab.com/gitlab-org/gitlab/-/tree/master/lib/gitlab/ci/templates).
When you create a `gitlab-ci.yml` file in the UI, you can
When you create a `.gitlab-ci.yml` file in the UI, you can
choose one of these templates:
- [Android (`Android.gitlab-ci.yml`)](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Android.gitlab-ci.yml)
@ -76,7 +76,7 @@ choose one of these templates:
- [dotNET Core (`dotNET-Core.gitlab-ci.yml`)](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/dotNET-Core.gitlab-ci.yml)
- [Elixir (`Elixir.gitlab-ci.yml`)](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Elixir.gitlab-ci.yml)
- [Flutter (`Flutter.gitlab-ci.yml`)](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Flutter.gitlab-ci.yml)
- [goLang (`Go.gitlab-ci.yml`)](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Go.gitlab-ci.yml)
- [Golang (`Go.gitlab-ci.yml`)](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Go.gitlab-ci.yml)
- [Gradle (`Gradle.gitlab-ci.yml`)](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Gradle.gitlab-ci.yml)
- [Grails (`Grails.gitlab-ci.yml`)](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Grails.gitlab-ci.yml)
- [iOS with fastlane (`iOS-Fastlane.gitlab-ci.yml`)](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/iOS-Fastlane.gitlab-ci.yml)
@ -117,15 +117,15 @@ Note that older articles and videos may not reflect the state of the latest GitL
For examples of setting up GitLab CI/CD for cloud-based environments, see:
- [How to set up multi-account AWS SAM deployments with GitLab CI](https://about.gitlab.com/blog/2019/02/04/multi-account-aws-sam-deployments-with-gitlab-ci/)
- [Automating Kubernetes Deployments with GitLab CI/CD](https://www.youtube.com/watch?v=wEDRfAz6_Uw)
- Video: [Automating Kubernetes Deployments with GitLab CI/CD](https://www.youtube.com/watch?v=wEDRfAz6_Uw)
- [How to autoscale continuous deployment with GitLab Runner on DigitalOcean](https://about.gitlab.com/blog/2018/06/19/autoscale-continuous-deployment-gitlab-runner-digital-ocean/)
- [How to create a CI/CD pipeline with Auto Deploy to Kubernetes using GitLab and Helm](https://about.gitlab.com/blog/2017/09/21/how-to-create-ci-cd-pipeline-with-autodeploy-to-kubernetes-using-gitlab-and-helm/)
- [Demo - Deploying from GitLab to OpenShift Container Cluster](https://youtu.be/EwbhA53Jpp4)
- Video: [Demo - Deploying from GitLab to OpenShift Container Cluster](https://youtu.be/EwbhA53Jpp4)
See also the following video overviews:
- [Kubernetes, GitLab, and Cloud Native](https://www.youtube.com/watch?v=d-9awBxEbvQ).
- [Deploying to IBM Cloud with GitLab CI/CD](https://www.youtube.com/watch?v=6ZF4vgKMd-g).
- Video: [Kubernetes, GitLab, and Cloud Native](https://www.youtube.com/watch?v=d-9awBxEbvQ)
- Video: [Deploying to IBM Cloud with GitLab CI/CD](https://www.youtube.com/watch?v=6ZF4vgKMd-g)
### Customer stories
@ -160,7 +160,9 @@ For examples of others who have implemented GitLab CI/CD, see:
### Migrating to GitLab from third-party CI tools
- [Migrating from Jenkins to GitLab](https://youtu.be/RlEVGOpYF5Y)
- [Migrating from CircleCI to GitLab](../migration/circleci.md)
- [Migrating from Jenkins to GitLab](../migration/jenkins.md)
- Video: [Migrating from Jenkins to GitLab](https://youtu.be/RlEVGOpYF5Y)
### Integrating GitLab CI/CD with other systems

View File

@ -186,6 +186,38 @@ following these rules:
To override the default behavior, you can
[specify a service alias](#available-settings-for-services).
### Connecting Services
> - [Deployed behind a feature flag](https://gitlab.com/gitlab-org/gitlab-runner/-/issues/11751).
You can use inter-dependent services with complex jobs, like end-to-end tests where an
external API needs to communicate with its own database.
This behavior is currently behind a
[feature flag](https://docs.gitlab.com/runner/configuration/feature-flags.html),
which you can enable by defining the `FF_NETWORK_PER_BUILD` CI/CD variable
either in the job or globally.
For example, for an end-to-end test for a front-end application that uses an API, and where the API needs a database:
```yaml
end-to-end-tests:
image: node:latest
services:
- name: selenium/standalone-firefox:${FIREFOX_VERSION}
alias: firefox
- name: registry.gitlab.com/organization/private-api:latest
alias: backend-api
- postgres:9.6.19
variables:
FF_NETWORK_PER_BUILD: 1
POSTGRES_PASSWORD: supersecretpassword
BACKEND_POSTGRES_HOST: postgres
script:
- npm install
- npm test
```
## Passing CI/CD variables to services
You can also pass custom CI/CD [variables](../variables/index.md)
@ -311,6 +343,32 @@ services:
The syntax of `command` is similar to [Dockerfile's `CMD`](https://docs.docker.com/engine/reference/builder/#cmd).
## Using `services` with `docker run` (Docker-in-Docker) side-by-side
In addition to letting services talk to each other via `FF_NETWORK_PER_BUILD`,
containers started via `docker run` can also connect to services provided by GitLab.
This can be useful in case booting the service is expensive or time consuming.
This technique will allow running tests from multiple different client environments,
while only booting up the tested service once.
```yaml
access-service:
stage: build
image: docker:19.03.1
services:
- docker:dind # necessary for docker run
- tutum/wordpress:latest
variables:
FF_NETWORK_PER_BUILD: "true" # activate container-to-container networking
script: |
docker run --rm --name curl \
--volume "$(pwd)":"$(pwd)" \
--workdir "$(pwd)" \
--network=host \
curlimages/curl:7.74.0 curl "http://tutum-wordpress"
```
## How Docker integration works
Below is a high level overview of the steps performed by Docker during job