Skip to content

Commit

Permalink
(CONT-885) Remove gitlab config
Browse files Browse the repository at this point in the history
  • Loading branch information
chelnak committed Apr 25, 2023
1 parent a776159 commit 89b3a9a
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 296 deletions.
33 changes: 1 addition & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,36 +47,6 @@ The following is a description and explanation of each of the keys within config
| required | The default list of files or paths for git to ignore or untrack that are commonly specified in a module project.
| paths | Defines any additional files or paths for git to ignore or untrack. (see the [gitignore](https://git-scm.com/docs/gitignore) documentation).

### .gitlab-ci.yml

>[Gitlab CI](https://about.gitlab.com/features/gitlab-ci-cd/) is a continuous integration platform that is free for all open source projects hosted on Github and Gitlab.com, it also has a self-hosted option that is free as well. We can trigger automated pipelines with ever change to our code base in the main branch, other branches, tags, or additional triggers.
Gitlab CI uses a .gitlab-ci.yml file in the root of your repository tell Gitlab CI what jobs to run when in the pipeline.

Key | Description |
| :------------- |:--------------|
| override |Defines whether your local `.sync.yml` will ignore the default values in pdk-templates. Defaults to `false`|
| defaults/custom | The `defaults` and `custom` keys are special keys used to denote when configuration is coming from `config_defaults.yml` or `.sync.yml`. While it is possible for users to extend the defaults provided by PDK, it's suggested that the user should only use the `custom` key to separate their overrides/extended configuration from the PDK provided defaults. |
| custom_stages |Defines a custom job stage for when the CI/CD jobs will be executed in the pipeline. By default `syntax` and `unit` are defined unless `override: true`.|
| beaker |Defines if you want the default, Docker-in-Docker acceptance job added. Can be set to `true` to enable the default `acceptance` job, or you can specify the `variables` and `tags` subkeys. These subkeys function the same as the `global_variables` option and the `tags` subkey found in the `ruby_versions` option.|
| global_variables |Allows you to set any global environment variables for the gitlab-ci pipeline. Currently includes setting the Puppet gem version.|
| cache | If this setting exists, it expects a single sub-key called `paths`. `paths` is an array of paths that will be cached for each subsequent job. Defaults to `['vendor/bundle']`|
| tags | If this setting exists, it expects an array of tags that will be added to each job. Not set by default.|
| bundler\_args |Define any arguments you want to pass through to bundler. The default is `--without system_tests --path vendor/bundle --jobs $(nproc)` which avoids installing unnecessary gems while installing them to the `vendor/bundler.|
| ruby_versions |Define a list of ruby_versions to test against. Each version can have a series of sub-keys that are options. `checks` is the rake command(s) to run during the job. `puppet_version` sets the PUPPET_GEM_VERSION environment variable. `allow_failure` is an array of `checks` where you want to allow failures. `tags` is an array of Gitlab CI Runner tags. `code_quality` is a boolean that when enabled adds [Code Quality](https://docs.gitlab.com/ee/ci/testing/code_quality.html) reports to jobs that run puppet-lint (version [3.2.0](https://github.com/puppetlabs/puppet-lint/blob/main/CHANGELOG.md#v320---2023-02-28) onwards). |
| ruby_versions\\{job}\\**except/only**|Basic `except`/`only` is an hash of `checks` with array of references of conditions for the `checks`:<br><br><pre>ruby_versions:<br>&nbsp;&nbsp;2.4.9:<br>&nbsp;&nbsp;&nbsp;&nbsp;except:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;unit:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- tags<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- main</pre><br><br>Advanced `except`/`only` is an hash of `checks` with hash using 4 keywords `'variables', 'refs', 'changes', 'kubernetes'` each with it's own array of references or conditions for the `checks`:<br><br><pre>ruby_versions:<br>&nbsp;&nbsp;2.4.9:<br>&nbsp;&nbsp;&nbsp;&nbsp;except:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;unit:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;refs:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- tags<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- main<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;variables:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- $CI_COMMIT_MESSAGE =~ /\[skip[ _-]tests?\]/i</pre> https://docs.gitlab.com/ce/ci/yaml/README.html#onlyexcept-advanced |
| custom_jobs |Define custom Gitlab CI jobs that will be executed. It is recommended that you use this option if you need customized Gitlab CI jobs. Please see the [.gitlab-ci.yml](https://docs.gitlab.com/ce/ci/yaml/README.html) docs for specifics.|
| rubygems_mirror | Use a custom rubygems mirror url |
| image |Define the Docker image to use, when using the Docker runner. Please see the [Using Docker images](https://docs.gitlab.com/ee/ci/docker/using_docker_images.html) docs for specifics.|
| custom_before_steps |Allows you to pass additional steps to the GitLab CI before_script. Please see the [.gitlab-ci.yml](https://docs.gitlab.com/ce/ci/yaml/#before_script-and-after_script) docs for specifics. If given as an array, the steps are executed _before_ the default steps of the before_script. If you want to have more control over the execution order of the steps, you can define a hash with a `before` and/or `after` key holding an array of steps to be executed before and after the default_script respectively.|
| default_before_script |If false, removes the default `before_script` section. Useful if you need a customised Bundler install, or to remove Bundler entirely. If the key is unset the default behaviour is to add `before_script`.|
|use_litmus| By default it is disabled. Set to `true` to configure travis to use Litmus testing tool for acceptance testing jobs with default values.|
|litmus|Allows you to update default config values. Its sub keys are `provision_list`, `puppet_collection`, `ruby_version`, `install_wget` which are detailed below.|
|litmus\\**puppet_collection**|Allows you to specify the puppet version under test. Default test are ran on _puppet6_.|
|litmus\\**provision_list**|Allows you to specify the platforms list under test. Default test are ran on platformes defined in provision.yaml file under _travis_deb_ and _travis_el_|
|litmus\\**ruby_version**|Allows you to specify the ruby version under test. Default it is set to _2.5.7_|
|litmus\\**install_wget**|Allows you to enable automatic installation of wget on the platform under test. We need this when installing agent on travis_deb platforms. Default it is disabled. |
|litmus\\**complex\\collection**|Allows you to specify multiple collections of `puppet_collection` and `provision_list`, allowing you to set certain OS to only run on certain Puppet versions. |

### Gitpod configuration
If you are using Gitpod you will need to opt-in and enable gitpod support for pdk-templates. To do this simple set the following configurations.

Expand Down Expand Up @@ -133,13 +103,12 @@ In this example the automated release prep workflow is triggered every Saturday
|changelog\_version\_tag\_pattern|Template how the version tag is to be generated. Defaults to `'v%s'` which eventually align with tag\_pattern property of puppet-blacksmith, thus changelog is referring to the correct version tags and compare URLs. |
|github_site|Override built-in default for public GitHub. Useful for GitHub Enterprise and other. (Example: `github_site = https://git.domain.tld`) |
|github_endpoint|Override built-in default for public GitHub. Useful for GitHub Enterprise and other. (Example: `github_endpoint = https://git.domain.tld/api/v4`) |
|gitlab|Allows to work with GitLab (Pending ![GitLab support](https://github.com/github-changelog-generator/github-changelog-generator/pull/657)). (Example: `gitlab = true` # Boolean default is false)|
|default\_disabled\_lint\_checks| Defines any checks that are to be disabled by default when running lint checks. As default we disable the `--relative` lint check, which compares the module layout relative to the module root. _Does affect **.puppet-lint.rc**._ |
|extra\_disabled\_lint\_checks| Defines any checks that are to be disabled as extras when running lint checks. No defaults are defined for this configuration. _Does affect **.puppet-lint.rc**._ |
|extras|An array of extra lines to add into your Rakefile. As an alternative you can add a directory named `rakelib` to your module and files in that directory that end in `.rake` would be loaded by the Rakefile. Example, to add syntax check exclusion paths for plan directories:<pre><br>Rakefile:<br> extras:<br> - \'PuppetSyntax.exclude_paths = ["plans/\*\*/*.pp","central/modules/deployments/plans/\*\*/*.pp"]\'</pre>
|linter\_options| An array of options to be passed into linter config. _Does affect **.puppet-lint.rc**._ |
|linter\_fail\_on\_warnings| A boolean indicating if the linter should exit non-zero on warnings as well as failures. _Does affect **.puppet-lint.rc**._ |
| linter_exclusions | An array of paths that the linter should exclude from running against. |
|linter_exclusions | An array of paths that the linter should exclude from running against. |

### .rubocop.yml

Expand Down
26 changes: 0 additions & 26 deletions config_defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ common:
- '/Gemfile'
- '/.gitattributes'
- '/.gitignore'
- '/.gitlab-ci.yml'
- '/.pdkignore'
- '/.puppet-lint.rc'
- '/Rakefile'
Expand Down Expand Up @@ -548,31 +547,6 @@ Gemfile:
- x64_mingw
- gem: 'serverspec'
version: '~> 2.41'
.gitlab-ci.yml:
defaults:
cache:
paths:
- 'vendor/bundle'
bundler_args: '--without system_tests --path vendor/bundle --jobs $(nproc)'
ruby_versions:
'2.5.7':
checks:
- 'validate lint check rubocop'
- parallel_spec
puppet_version: '~> 6'
'2.7.2':
checks:
- 'validate lint check rubocop'
- parallel_spec
puppet_version: '~> 7'
# beaker: true
use_litmus: false
litmus:
provision_list: [centos7]
puppet_collection: [puppet6]
ruby_version: '2.5.7'
install_wget: "no"
default_before_script: true
.gitpod.Dockerfile:
unmanaged: true
.gitpod.yml:
Expand Down
235 changes: 0 additions & 235 deletions moduleroot/.gitlab-ci.yml.erb

This file was deleted.

3 changes: 0 additions & 3 deletions moduleroot/Rakefile.erb
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,6 @@ if Bundler.rubygems.find_name('github_changelog_generator').any?
<% end -%>
<% if @configs['github_endpoint'] -%>
config.github_endpoint = <%= @configs['github_endpoint'].inspect %>
<% end -%>
<% if @configs['gitlab'] -%>
config.gitlab = <%= @configs['gitlab'].inspect %>
<% end -%>
config.user = "#{changelog_user}"
config.project = "#{changelog_project}"
Expand Down

1 comment on commit 89b3a9a

@kenyon
Copy link

@kenyon kenyon commented on 89b3a9a Aug 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.