Commit b5ddd3b8 authored by Nick Gaskill's avatar Nick Gaskill

Merge branch '326498-evaluate-master-main-usage-and-resolve-issues-package' into 'master'

Resolve "Evaluate master/main usage and resolve issues - Package"

See merge request gitlab-org/gitlab!66469
parents 4b456219 0de30c56
......@@ -63,7 +63,7 @@ a group's namespace, rather than a user's namespace. Composer packages
git commit -m 'Composer package test'
git tag v1.0.0
git remote add origin git@gitlab.example.com:<namespace>/<project-name>.git
git push --set-upstream origin master
git push --set-upstream origin main
git push origin v1.0.0
```
......
......@@ -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,
including two tests that run in parallel. The `build` is stored in the container
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:
```yaml
......@@ -285,14 +285,14 @@ release-image:
- docker tag $CONTAINER_TEST_IMAGE $CONTAINER_RELEASE_IMAGE
- docker push $CONTAINER_RELEASE_IMAGE
only:
- master
- main
deploy:
stage: deploy
script:
- ./deploy.sh
only:
- master
- main
```
NOTE:
......@@ -436,7 +436,7 @@ build_image:
only:
- branches
except:
- master
- main
delete_image:
image: docker:19.03.12
......@@ -457,7 +457,7 @@ delete_image:
only:
- branches
except:
- master
- main
```
NOTE:
......@@ -605,10 +605,10 @@ Here are examples of regex patterns you may want to use:
v.+
```
- Match only the tag named `master`:
- Match only the tag named `main`:
```plaintext
master
main
```
- 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:
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
(?:v.+|master|release.*)
(?:v.+|main|release.*)
```
### Set cleanup limits to conserve resources
......@@ -675,11 +675,11 @@ You can set, update, and disable the cleanup policies using the GitLab API.
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
curl --request PUT --header 'Content-Type: application/json;charset=UTF-8' --header "PRIVATE-TOKEN: <your_access_token>" \
--data-binary '{"container_expiration_policy_attributes":{"cadence":"1month","enabled":true,"keep_n":1,"older_than":"14d","name_regex":"","name_regex_delete":".*","name_regex_keep":".*-master"}}' \
--data-binary '{"container_expiration_policy_attributes":{"cadence":"1month","enabled":true,"keep_n":1,"older_than":"14d","name_regex":"","name_regex_delete":".*","name_regex_keep":".*-main"}}' \
"https://gitlab.example.com/api/v4/projects/2"
```
......
......@@ -711,7 +711,7 @@ you can configure GitLab CI/CD to build new packages automatically.
### Create Maven packages with GitLab CI/CD by using Maven
You can create a new package each time the `master` branch is updated.
You can create a new package each time the `main` branch is updated.
1. Create a `ci_settings.xml` file that serves as Maven's `settings.xml` file.
......@@ -768,7 +768,7 @@ You can create a new package each time the `master` branch is updated.
script:
- 'mvn deploy -s ci_settings.xml'
only:
- master
- main
```
1. Push those files to your repository.
......@@ -781,7 +781,7 @@ user's home location. In this example:
### Create Maven packages with GitLab CI/CD by using Gradle
You can create a package each time the `master` branch
You can create a package each time the `main` branch
is updated.
1. Authenticate with [a CI job token in Gradle](#authenticate-with-a-ci-job-token-in-gradle).
......@@ -794,7 +794,7 @@ is updated.
script:
- 'gradle publish'
only:
- master
- main
```
1. Commit files to your repository.
......
......@@ -322,7 +322,7 @@ If you're using NuGet with GitLab CI/CD, a CI job token can be used instead of a
personal access token or deploy token. The token inherits the permissions of the
user that generates the pipeline.
This example shows how to create a new package each time the `master` branch is
This example shows how to create a new package each time the `main` branch is
updated:
1. Add a `deploy` job to your `.gitlab-ci.yml` file:
......@@ -340,7 +340,7 @@ updated:
- dotnet nuget add source "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/nuget/index.json" --name gitlab --username gitlab-ci-token --password $CI_JOB_TOKEN --store-password-in-clear-text
- dotnet nuget push "bin/Release/*.nupkg" --source gitlab
only:
- master
- main
```
1. Commit the changes and push it to your GitLab repository to trigger a new CI/CD build.
......
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