Commit 6bd0e4df authored by Cédric OLIVIER's avatar Cédric OLIVIER Committed by Pierre Smeyers
Browse files

feat: overridable semrel config dir

parent 6ab89360
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ The semantic-release template uses some global configuration used throughout all
| --------------------- | --------------------------------------------- | ----------------- |
| `SEMREL_IMAGE`        | The Docker image used to run semantic-release | `node:lts` |
| :lock: `GITLAB_TOKEN` | A GitLab [project access token](https://docs.gitlab.com/ee/user/project/settings/project_access_tokens.html) or [personal access token](https://docs.gitlab.com/ce/user/profile/personal_access_tokens.html) with `api`, `read_repository` and `write repository` scopes. :warning: This variable is **mandatory** and [defined by `semantic-release`](https://github.com/semantic-release/semantic-release/blob/master/docs/usage/ci-configuration.md#push-access-to-the-remote-repository) itself. | _none_ |
| `SEMREL_CONFIG_DIR`        |  directory containing your [semantic-release configuration](https://semantic-release.gitbook.io/semantic-release/usage/configuration#configuration-file) | `.` |
| `SEMREL_REQUIRED_PLUGINS_FILE`        | An optional file for additional npm packages to install | `semrel-required-plugins.txt` |

Jobs will extract required plugin packages from discovered configuration. If your configuration needs additional packages, add them, one per line, to `SEMREL_REQUIRED_PLUGINS_FILE` file. Each line must be a valid `npm install` package argument.
+6 −0
Original line number Diff line number Diff line
@@ -15,6 +15,12 @@
      "mandatory": true,
      "secret": true
    },
    {
      "name": "SEMREL_CONFIG_DIR",
      "description": "directory containing your [semantic-release configuration](https://semantic-release.gitbook.io/semantic-release/usage/configuration#configuration-file)",
      "default": ".",
      "advanced": true
    },
    {
      "name": "SEMREL_TAG_FORMAT",
      "description": "For generated `.releaserc` file only. [tagFormat semantic-release option](https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#tagformat)e. :warning: don't forget to double the `$` character so it is not interpreted by GitLab.",
+3 −1
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@ variables:
  SEMREL_SUCCESS_CMD: "success.sh"
  SEMREL_FAIL_CMD: "fail.sh"
  
  SEMREL_CONFIG_DIR: "."

stages:
  - publish
@@ -549,6 +550,7 @@ stages:
  before_script:
    - *semrel-scripts
    - install_ca_certs "${CUSTOM_CA_CERTS:-$DEFAULT_CA_CERTS}"
    - cd "${SEMREL_CONFIG_DIR}"
  cache:
    # cache shall be per branch per template
    key: "$CI_COMMIT_REF_SLUG-SEMREL"
@@ -562,7 +564,7 @@ semantic-release-info:
    - dotenv_semrel_info
  artifacts:
    reports:
      dotenv: "$SEMREL_INFO_FILE"
      dotenv: "${SEMREL_CONFIG_DIR}/$SEMREL_INFO_FILE"
  rules:
    - if: $CI_COMMIT_TAG
      when: never