Welcome to mirror list, hosted at ThFree Co, Russian Federation.

raketasks.md « doc - gitlab.com/gitlab-org/gitlab-docs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1ffd0f5c0b700df5c5af92e78242d33893f722a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# GitLab docs rake tasks

The GitLab Docs project has some raketasks that automate various things. You
can see the list of rake tasks with:

```shell
bundle exec rake -T
```

## Generate the feature flag tables

The [feature flag tables](https://docs.gitlab.com/ee/user/feature_flags.html) are generated
dynamically when GitLab Docs are published.

To generate these tables locally, generate `content/_data/feature_flags.yaml`:

```shell
bundle exec rake generate_feature_flags
```

Do this any time you want fresh data from your GitLab checkout.

Any time you rebuild the site using `nanoc`, the feature flags tables are populated with data.

## Clean up redirects

The `docs:clean_redirects` rake task automates the removal of the expired redirect files,
which is part of the monthly [scheduled TW tasks](https://about.gitlab.com/handbook/product/ux/technical-writing/#regularly-scheduled-tasks)
as seen in the "Local tasks" section of the [issue template](https://gitlab.com/gitlab-org/technical-writing/-/blob/main/.gitlab/issue_templates/tw-monthly-tasks.md):

1. Make sure you have `jq` installed. On macOS:
   - Use `brew list` and see if `jq` is in the list.
   - If it is not installed, run `brew install jq`.

1. Optional. Run the rake task locally in your `gitlab-docs` directory in a "dry run" mode
   that does not create any MRs:

   ```shell
   SKIP_MR=true bundle exec rake docs:clean_redirects
   ```

1. Run the rake task locally in your `gitlab-docs` directory. This command creates up to five
   merge requests:

   ```shell
   bundle exec rake docs:clean_redirects
   ```

The task:

1. Searches the doc files of each upstream product and:
   1. Checks the `remove_date` defined in the YAML front matter. If the
      `remove_date` is before the day you run the task, it removes the doc
      and updates `content/_data/redirects.yaml`.
   1. Creates a branch, commits the changes, and pushes the branch with
      various push options to automatically create the merge request.
1. When all the upstream products MRs have been created, it creates a branch
   in the `gitlab-docs` repository, adds the changed `content/_data/redirects.yaml`,
   and pushes the branch with various push options to automatically create the
   merge request.

Once all the MRs have been created, be sure to edit them to cross link between
them and the recurring tasks issue.

To omit the automatic merge request creation:

```shell
SKIP_MR=true bundle exec rake docs:clean_redirects
```