@@ -236,7 +236,7 @@ combining the two to save us some typing in the `script` section.
...
@@ -236,7 +236,7 @@ combining the two to save us some typing in the `script` section.
Here's a more elaborate example that splits up the tasks into 4 pipeline stages,
Here's a more elaborate example that splits up the tasks into 4 pipeline stages,
including two tests that run in parallel. The `build` is stored in the container
including two tests that run in parallel. The `build` is stored in the container
registry and used by subsequent stages, downloading the image
registry and used by subsequent stages, downloading the image
when needed. Changes to `master` also get tagged as `latest` and deployed using
when needed. Changes to `main` also get tagged as `latest` and deployed using
an application-specific deploy script:
an application-specific deploy script:
```yaml
```yaml
...
@@ -285,14 +285,14 @@ release-image:
...
@@ -285,14 +285,14 @@ release-image:
-docker tag $CONTAINER_TEST_IMAGE $CONTAINER_RELEASE_IMAGE
-docker tag $CONTAINER_TEST_IMAGE $CONTAINER_RELEASE_IMAGE
-docker push $CONTAINER_RELEASE_IMAGE
-docker push $CONTAINER_RELEASE_IMAGE
only:
only:
-master
-main
deploy:
deploy:
stage:deploy
stage:deploy
script:
script:
-./deploy.sh
-./deploy.sh
only:
only:
-master
-main
```
```
NOTE:
NOTE:
...
@@ -436,7 +436,7 @@ build_image:
...
@@ -436,7 +436,7 @@ build_image:
only:
only:
-branches
-branches
except:
except:
-master
-main
delete_image:
delete_image:
image:docker:19.03.12
image:docker:19.03.12
...
@@ -457,7 +457,7 @@ delete_image:
...
@@ -457,7 +457,7 @@ delete_image:
only:
only:
-branches
-branches
except:
except:
-master
-main
```
```
NOTE:
NOTE:
...
@@ -605,10 +605,10 @@ Here are examples of regex patterns you may want to use:
...
@@ -605,10 +605,10 @@ Here are examples of regex patterns you may want to use:
v.+
v.+
```
```
- Match only the tag named `master`:
- Match only the tag named `main`:
```plaintext
```plaintext
master
main
```
```
- Match tags that are either named or start with `release`:
- Match tags that are either named or start with `release`:
...
@@ -617,10 +617,10 @@ Here are examples of regex patterns you may want to use:
...
@@ -617,10 +617,10 @@ Here are examples of regex patterns you may want to use:
release.*
release.*
```
```
- Match tags that either start with `v`, are named `master`, or begin with `release`:
- Match tags that either start with `v`, are named `main`, or begin with `release`:
```plaintext
```plaintext
(?:v.+|master|release.*)
(?:v.+|main|release.*)
```
```
### Set cleanup limits to conserve resources
### Set cleanup limits to conserve resources
...
@@ -675,11 +675,11 @@ You can set, update, and disable the cleanup policies using the GitLab API.
...
@@ -675,11 +675,11 @@ You can set, update, and disable the cleanup policies using the GitLab API.
Examples:
Examples:
- Select all tags, keep at least 1 tag per image, clean up any tag older than 14 days, run once a month, preserve any images with the name `master` and the policy is enabled:
- Select all tags, keep at least 1 tag per image, clean up any tag older than 14 days, run once a month, preserve any images with the name `main` and the policy is enabled:
```shell
```shell
curl --request PUT --header'Content-Type: application/json;charset=UTF-8'--header"PRIVATE-TOKEN: <your_access_token>"\
curl --request PUT --header'Content-Type: application/json;charset=UTF-8'--header"PRIVATE-TOKEN: <your_access_token>"\