Commit 4ca58058 authored by Thomas Boni's avatar Thomas Boni
Browse files

feat(tempalte_release): release only the latest version by default

parent e0135cd8
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
# Changelog
All notable changes to this job will be documented in this file.

## [0.4.0] - 2024-04-22
* Release only the latest version by default (`RELEASE_ONLY_LATEST_VERSION` variable)

## [0.3.0] - 2024-03-08
* Remove stage list definition in the template

+2 −1
Original line number Diff line number Diff line
@@ -80,9 +80,10 @@ A `CHANGELOG.md` file as explained in the previous example, is required to creat
| Name | Description | Default |
| ---- | ----------- | ------- |
| `IMAGE_TAG` | The default tag for the docker image [alpine/httpie](https://hub.docker.com/r/alpine/httpie) | `3.2.1` |
| `GITLAB_API_URL` | The domain of GitLab instance. ⚠️ It should be changed if you using a self-hosted version | `gitlab.com` |
| `GITLAB_API_URL` | The domain of GitLab instance | `${CI_SERVER_HOST}` |
| `METADATA_FILE_EXTENSION` | The extension of metadata files | `.r2.yml` |
| `RELEASE_PATH` | The path where releases files are exposed as artifacts | `${CI_PROJECT_DIR}/releases` |
| `RELEASE_ONLY_LATEST_VERSION` | Release only the latest version from changelog files | `true`

## Author
This resource is an **[official job](https://docs.r2devops.io/get-started/faq/#use-a-template)** added in [**R2Devops repository**](https://gitlab.com/r2devops/hub) by [@GridexX](https://gitlab.com/GridexX)
+9 −2
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@ template_release:
    GITLAB_API_URL: "${CI_SERVER_HOST}"
    METADATA_FILE_EXTENSION: ".r2.yml"
    RELEASE_PATH: "${CI_PROJECT_DIR}/releases"
    RELEASE_ONLY_LATEST_VERSION: "true"
  before_script:
    - apk update && apk add --no-cache bash
  script:
@@ -98,6 +99,12 @@ template_release:
    -   |
              echo "Processed ${JOB_RELEASE} : ${result}"
    -         fi

          # If we want to release only latest version: break
    -     if [ "${RELEASE_ONLY_LATEST_VERSION}" = "true" ]; then
    -       break
    -     fi

    -   done
    - done
  rules: