Commit 40335062 authored by Clement Bois's avatar Clement Bois
Browse files

feat: add ci component support

parent 401972bc
Loading
Loading
Loading
Loading
+116 −89
Original line number Diff line number Diff line
@@ -42,31 +42,58 @@ You're free to enable whichever or both, and you can also choose your deployment

### Include

In order to include this template in your project, Add the following to your `.gitlab-ci.yml`:
This template can be used both as a [CI/CD component](https://docs.gitlab.com/ee/ci/components/#use-a-component-in-a-cicd-configuration) 
or using the legacy [`include:project`](https://docs.gitlab.com/ee/ci/yaml/index.html#includeproject) syntax.

#### Use as a CI/CD component

Add the following to your `.gitlab-ci.yml`:

```yaml
include:
  # 1: include the component
  - component: 'gitlab.com/to-be-continuous/cloud-foundry/gitlab-ci-cf@4.3.6'
    # 2: set/override component inputs
    inputs:
      # ⚠ this is only an example
      url: https://api.cloud-foundry.acme.host
      org: MyProject
```

#### Use as a CI/CD template (legacy)

Add the following to your `gitlab-ci.yml`:

```yaml
include:
  # 1: include the template
  - project: 'to-be-continuous/cloud-foundry'
    ref: '4.3.6'
    file: '/templates/gitlab-ci-cf.yml'

variables:
  # 2: set/override template variables
  # ⚠ this is only an example
  CF_URL: "https://api.cloud-foundry.acme.host"
  CF_ORG: "MyProject"
```

### Global configuration

The Cloud Foundry template uses some global configuration used throughout all jobs.

| Name                   | Description                            | Default Value     |
| ---------------------- | -------------------------------------- | ----------------- |
| `CF_CLI_IMAGE`         | The Docker image used to run CF CLI commands <br/>:warning: **set the version required by your Cloud Foundry server** | `registry.hub.docker.com/governmentpaas/cf-cli` |
| `CF_MANIFEST_BASENAME` | CF manifest file basename (without extension nor env suffix) | `manifest`            |
| `CF_URL`               | Default CF API url                     | **has to be defined** |
| Input / Variable                               | Description                            | Default Value     |
| ---------------------------------------------- | -------------------------------------- | ----------------- |
| `cli-image` / `CF_CLI_IMAGE`                   | The Docker image used to run CF CLI commands <br/>:warning: **set the version required by your Cloud Foundry server** | `registry.hub.docker.com/governmentpaas/cf-cli` |
| `manifest-basename` / `CF_MANIFEST_BASENAME`   | CF manifest file basename (without extension nor env suffix) | `manifest`            |
| `url`/ `CF_URL`                                | Default CF API url                     | **has to be defined** |
| :lock: `CF_USER`                               | Default CF user name                   | **has to be defined** |
| :lock: `CF_PASSWORD`                           | Default CF user password               | **has to be defined** |
| `CF_ORG`               | Default CF organization for project    | **has to be defined** |
| `CF_BASE_APP_NAME`     | Base application name                  | `$CI_PROJECT_NAME` ([see GitLab doc](https://docs.gitlab.com/ee/ci/variables/predefined_variables.html)) |
| `CF_DEFAULT_DOMAIN`    | Default CF domain _(only define if you want to use a different domain from CF default)_ | _none_ |
| `CF_DEFAULT_ROUTE_PATH`     | Default CF route path                  | _none_ |
| `CF_SCRIPTS_DIR`       | Directory where CF scripts (manifest, hook scripts) are located| `.` _(root project dir)_ |
| `org`/ `CF_ORG`                                | Default CF organization for project    | **has to be defined** |
| `base-app-name` / `CF_BASE_APP_NAME`           | Base application name                  | `$CI_PROJECT_NAME` ([see GitLab doc](https://docs.gitlab.com/ee/ci/variables/predefined_variables.html)) |
| `default-domain` / `CF_DEFAULT_DOMAIN`         | Default CF domain _(only define if you want to use a different domain from CF default)_ | _none_ |
| `default-route-path` / `CF_DEFAULT_ROUTE_PATH` | Default CF route path                  | _none_ |
| `scripts-dir` / `CF_SCRIPTS_DIR`               | Directory where CF scripts (manifest, hook scripts) are located| `.` _(root project dir)_ |

### Secrets management

@@ -85,7 +112,7 @@ Here are some advices about your **secrets** (variables marked with a :lock:):

As seen above, the Cloud Foundry template may support up to 4 environments (`review`, `integration`, `staging` and `production`).

Each deployment job produces _output variables_ that are propagated to downstream jobs (using [dotenv artifacts](https://docs.gitlab.com/ee/ci/pipelines/job_artifacts.html#artifactsreportsdotenv)):
Each deployment job produces _output variables_ that are propagated to downstream jobs (using [dotenv artifacts](https://docs.gitlab.com/ee/ci/yaml/artifacts_reports.html#artifactsreportsdotenv)):

* `environment_type`: set to the type of environment (`review`, `integration`, `staging` or `production`),
* `environment_name`: the application name (see below),
@@ -100,25 +127,25 @@ Here are configuration details for each environment.
Review environments are dynamic and ephemeral environments to deploy your _ongoing developments_ (a.k.a. _feature_ or 
_topic_ branches).

They are **disabled by default** and can be enabled by setting the `CF_REVIEW_SPACE` variable (see below).
They are **disabled by default** and can be enabled by setting the `review-space` input or `CF_REVIEW_SPACE` variable (see below).

Here are variables supported to configure review environments:

| Name                     | Description                            | Default value     |
| ------------------------ | -------------------------------------- | ----------------- |
| `CF_REVIEW_SPACE`     | CF space for `review` env              | _none_ (disabled) |
| `CF_REVIEW_URL`       | CF API url for `review` env _(only define if different from default)_    | `$CF_URL` |
| Input / Variable                                             | Description                            | Default value     |
| ------------------------------------------------------------ | -------------------------------------- | ----------------- |
| `review-space` / `CF_REVIEW_SPACE`                           | CF space for `review` env              | _none_ (disabled) |
| `review-url`/ `CF_REVIEW_URL`                                | CF API url for `review` env _(only define if different from default)_    | `$CF_URL` |
| :lock: `CF_REVIEW_USER`                                      | CF user name for `review` env _(only define if different from default)_    | `$CF_USER` |
| :lock: `CF_REVIEW_PASSWORD`                                  | CF user password for `review` env _(only define if different from default)_    | `$CF_PASSWORD` |
| `CF_REVIEW_ORG`       | CF organization for `review` env _(only define if different from default)_    | `$CF_ORG` |
| `CF_REVIEW_APP_NAME`  | Application name for `review` env      | `"${CF_BASE_APP_NAME}-${CI_ENVIRONMENT_SLUG}"` |
| `CF_REVIEW_DOMAIN`    | CF domain for `review` env             | `$CF_DEFAULT_DOMAIN` |
| `CF_REVIEW_HOST_NAME` | Application host name for `review` env | `"${CF_BASE_APP_NAME}-${CI_ENVIRONMENT_SLUG}"` (ex: `myproject-review-fix-bug-12`) |
| `CF_REVIEW_ZERODOWNTIME` | Enables zero-downtime deployment on `review` env| `false` |
| `CF_REVIEW_ENVIRONMENT_SCHEME` | The review environment protocol scheme | `https` |
| `CF_REVIEW_ENVIRONMENT_DOMAIN` | The review environment domain | _none_ |
| `CF_REVIEW_ROUTE_PATH` | CF route path for `review` env | `$CF_DEFAULT_ROUTE_PATH` |
| `CF_REVIEW_RETIRED_APP_SUFFIX` | If set, the app old version is not deleted/overriden but renamed with this suffix | _none_ |
| `review-org` / `CF_REVIEW_ORG`                               | CF organization for `review` env _(only define if different from default)_    | `$CF_ORG` |
| `review-app-name` / `CF_REVIEW_APP_NAME`                     | Application name for `review` env      | `"${CF_BASE_APP_NAME}-${CI_ENVIRONMENT_SLUG}"` |
| `review-domain` / `CF_REVIEW_DOMAIN`                         | CF domain for `review` env             | `$CF_DEFAULT_DOMAIN` |
| `review-host-name` / `CF_REVIEW_HOST_NAME`                   | Application host name for `review` env | `"${CF_BASE_APP_NAME}-${CI_ENVIRONMENT_SLUG}"` (ex: `myproject-review-fix-bug-12`) |
| `review-zerodowntime` / `CF_REVIEW_ZERODOWNTIME`             | Enables zero-downtime deployment on `review` env | `false` |
| `review-environment-scheme` / `CF_REVIEW_ENVIRONMENT_SCHEME` | The review environment protocol scheme | `https` |
| `review-environment-domain` / `CF_REVIEW_ENVIRONMENT_DOMAIN` | The review environment domain          | _none_ |
| `review-route-path` / `CF_REVIEW_ROUTE_PATH`                 | CF route path for `review` env         | `$CF_DEFAULT_ROUTE_PATH` |
| `review-retired-app-suffix` / `CF_REVIEW_RETIRED_APP_SUFFIX` | If set, the app old version is not deleted/overriden but renamed with this suffix | _none_ |

Note: By default review `environment.url` will be built as `${CF_REVIEW_ENVIRONMENT_SCHEME}://${$CI_PROJECT_NAME}-${CI_ENVIRONMENT_SLUG}.${CF_REVIEW_ENVIRONMENT_DOMAIN}/${CF_REVIEW_ROUTE_PATH}`

@@ -126,72 +153,72 @@ Note: By default review `environment.url` will be built as `${CF_REVIEW_ENVIRONM

The integration environment is the environment associated to your integration branch (`develop` by default).

It is **disabled by default** and can be enabled by setting the `CF_INTEG_SPACE` variable (see below).
It is **disabled by default** and can be enabled by setting the `integ-space`input or `CF_INTEG_SPACE` variable (see below).

Here are variables supported to configure the integration environment:

| Name                     | Description                            | Default value     |
| ------------------------ | -------------------------------------- | ----------------- |
| `CF_INTEG_SPACE`      | CF space for `integration` env         | _none_ (disabled) |
| `CF_INTEG_URL`        | CF API url for `integration` env _(only define if different from default)_   | `$CF_URL` |
| Input / Variable                                           | Description                            | Default value     |
| ---------------------------------------------------------- | -------------------------------------- | ----------------- |
| `integ-space` / `CF_INTEG_SPACE`                           | CF space for `integration` env         | _none_ (disabled) |
| `integ-url` / `CF_INTEG_URL`                               | CF API url for `integration` env _(only define if different from default)_   | `$CF_URL` |
| :lock: `CF_INTEG_USER`                                     | CF user name for `integration` env  _(only define if different from default)_   | `$CF_USER` |
| :lock: `CF_INTEG_PASSWORD`                                 | CF user password for `integration` env _(only define if different from default)_   | `$CF_PASSWORD` |
| `CF_INTEG_ORG`        | CF organization for `integration` env _(only define if different from default)_   | `$CF_ORG` |
| `CF_INTEG_APP_NAME`   | Application name for `integration` env | `"${CF_BASE_APP_NAME}-integration"` |
| `CF_INTEG_DOMAIN`     | CF domain for `integration` env        | `$CF_DEFAULT_DOMAIN` |
| `CF_INTEG_ROUTE_PATH`     | CF route path for `integration` env | `$CF_DEFAULT_ROUTE_PATH` |
| `CF_INTEG_HOST_NAME`  | Application host name for `integration` env| `"${CF_BASE_APP_NAME}-integration"` |
| `CF_INTEG_ZERODOWNTIME`  | Enables zero-downtime deployment on `integration` env| `false` |
| `CF_INTEG_ENVIRONMENT_URL`     | The integration environment url **including scheme** (ex: `https://my-application-integration.nonpublic.domain.com`). Do not use variable inside variable definition as it will result in a two level cascade variable and gitlab does not allow that. | _none_ |
| `CF_INTEG_RETIRED_APP_SUFFIX` | If set, the app old version is not deleted/overriden but renamed with this suffix | _none_ |
| `integ-org` / `CF_INTEG_ORG`                               | CF organization for `integration` env _(only define if different from default)_   | `$CF_ORG` |
| `integ-app-name` / `CF_INTEG_APP_NAME`                     | Application name for `integration` env | `"${CF_BASE_APP_NAME}-integration"` |
| `integ-domain` / `CF_INTEG_DOMAIN`                         | CF domain for `integration` env        | `$CF_DEFAULT_DOMAIN` |
| `integ-route-path` / `CF_INTEG_ROUTE_PATH`                 | CF route path for `integration` env    | `$CF_DEFAULT_ROUTE_PATH` |
| `integ-host-name` / `CF_INTEG_HOST_NAME`                   | Application host name for `integration` env | `"${CF_BASE_APP_NAME}-integration"` |
| `integ-zerodowntime` / `CF_INTEG_ZERODOWNTIME`             | Enables zero-downtime deployment on `integration` env | `false` |
| `integ-environment-url` / `CF_INTEG_ENVIRONMENT_URL`       | The integration environment url **including scheme** (ex: `https://my-application-integration.nonpublic.domain.com`). Do not use variable inside variable definition as it will result in a two level cascade variable and gitlab does not allow that. | _none_ |
| `integ-retired-app-suffix` / `CF_INTEG_RETIRED_APP_SUFFIX` | If set, the app old version is not deleted/overriden but renamed with this suffix | _none_ |

#### Staging environment

The staging environment is an iso-prod environment meant for testing and validation purpose associated to your production 
branch (`main` or `master` by default).

It is **disabled by default** and can be enabled by setting the `CF_STAGING_SPACE` variable (see below).
It is **disabled by default** and can be enabled by setting the `staging-space`input or `CF_STAGING_SPACE` variable (see below).

Here are variables supported to configure the staging environment:

| Name                     | Description                            | Default value     |
| ------------------------ | -------------------------------------- | ----------------- |
| `CF_STAGING_SPACE`    | CF space for `staging` env             | _none_ (disabled) |
| `CF_STAGING_URL`      | CF API url for `staging` env _(only define if different from default)_   | `$CF_URL` |
| Input / Variable                                               | Description                            | Default value     |
| -------------------------------------------------------------- | -------------------------------------- | ----------------- |
| `staging-space` / `CF_STAGING_SPACE`                           | CF space for `staging` env             | _none_ (disabled) |
| `staging-url` / `CF_STAGING_URL`                               | CF API url for `staging` env _(only define if different from default)_   | `$CF_URL` |
| :lock: `CF_STAGING_USER`                                       | CF user name for `staging` env  _(only define if different from default)_   | `$CF_USER` |
| :lock: `CF_STAGING_PASSWORD`                                   | CF user password for `staging` env _(only define if different from default)_   | `$CF_PASSWORD` |
| `CF_STAGING_ORG`      | CF organization for `staging` env _(only define if different from default)_   | `$CF_ORG` |
| `CF_STAGING_APP_NAME` | Application name for `staging` env     | `"${CF_BASE_APP_NAME}-staging"` |
| `CF_STAGING_DOMAIN`   | CF domain for `staging` env            | `$CF_DEFAULT_DOMAIN` |
| `CF_STAGING_ROUTE_PATH`   | CF route path for `integration` env | `$CF_DEFAULT_ROUTE_PATH` |
| `CF_STAGING_HOST_NAME`| Application host name for `staging` env| `"${CF_BASE_APP_NAME}-staging"` |
| `CF_STAGING_ZERODOWNTIME` | Enables zero-downtime deployment on `staging` env| `false` |
| `CF_STAGING_ENVIRONMENT_URL`   | The staging environment url **including scheme** (ex: `https://my-application-staging.nonpublic.domain.com`). Do not use variable inside variable definition as it will result in a two level cascade variable and gitlab does not allow that. | _none_ |
| `CF_STAGING_RETIRED_APP_SUFFIX` | If set, the app old version is not deleted/overriden but renamed with this suffix | _none_ |
| `staging-org` / `CF_STAGING_ORG`                               | CF organization for `staging` env _(only define if different from default)_   | `$CF_ORG` |
| `staging-app-name` / `CF_STAGING_APP_NAME`                     | Application name for `staging` env     | `"${CF_BASE_APP_NAME}-staging"` |
| `staging-domain` / `CF_STAGING_DOMAIN`                         | CF domain for `staging` env            | `$CF_DEFAULT_DOMAIN` |
| `staging-route-path` / `CF_STAGING_ROUTE_PATH`                 | CF route path for `integration` env    | `$CF_DEFAULT_ROUTE_PATH` |
| `staging-host-name` / `CF_STAGING_HOST_NAME`                   | Application host name for `staging` env | `"${CF_BASE_APP_NAME}-staging"` |
| `staging-zerodowntime` / `CF_STAGING_ZERODOWNTIME`             | Enables zero-downtime deployment on `staging` env | `false` |
| `staging-environment-url` / `CF_STAGING_ENVIRONMENT_URL`       | The staging environment url **including scheme** (ex: `https://my-application-staging.nonpublic.domain.com`). Do not use variable inside variable definition as it will result in a two level cascade variable and gitlab does not allow that. | _none_ |
| `staging-retired-app-suffix` / `CF_STAGING_RETIRED_APP_SUFFIX` | If set, the app old version is not deleted/overriden but renamed with this suffix | _none_ |

#### Production environment

The production environment is the final deployment environment associated with your production branch (`main` or `master` by default).

It is **disabled by default** and can be enabled by setting the `CF_PROD_SPACE` variable (see below).
It is **disabled by default** and can be enabled by setting the `prod-space`input or `CF_PROD_SPACE` variable (see below).

Here are variables supported to configure the production environment:

| Name                     | Description                            | Default value     |
| ------------------------ | -------------------------------------- | ----------------- |
| `CF_PROD_SPACE`       | CF space for `production` env          | _none_ (disabled) |
| `CF_PROD_URL`         | CF API url for `production` env _(only define if different from default)_| `$CF_URL` |
| Input / Variable                                         | Description                            | Default value     |
| -------------------------------------------------------- | -------------------------------------- | ----------------- |
| `prod-space` / `CF_PROD_SPACE`                           | CF space for `production` env          | _none_ (disabled) |
| `prod-url` / `CF_PROD_URL`                               | CF API url for `production` env _(only define if different from default)_| `$CF_URL` |
| :lock: `CF_PROD_USER`                                    | CF user name for `production` env _(only define if different from default)_| `$CF_USER` |
| :lock: `CF_PROD_PASSWORD`                                | CF user password for `production` env _(only define if different from default)_| `$CF_PASSWORD` |
| `CF_PROD_ORG`         | CF organization for `production` env _(only define if different from default)_| `$CF_ORG` |
| `CF_PROD_APP_NAME`    | Application name for `production` env  | `$CF_BASE_APP_NAME` |
| `CF_PROD_DOMAIN`      | CF domain for `production` env         | `$CF_DEFAULT_DOMAIN` |
| `CF_PROD_ROUTE_PATH` | CF domain for `production` env | `$CF_DEFAULT_DOMAIN` |
| `CF_PROD_HOST_NAME`   | Application host name for `production` env| `$CF_DEFAULT_ROUTE_PATH` |
| `CF_PROD_DEPLOY_STRATEGY`| Defines the deployment to production strategy. One of `manual` (i.e. _one-click_) or `auto`. | `manual` |
| `CF_PROD_ZERODOWNTIME`| Enables zero-downtime deployment on `production` env | `true` |
| `CF_PROD_ENVIRONMENT_URL`      | The production environment url **including scheme** (ex: `https://my-application.public.domain.com`) Do not use variable inside variable definition as it will result in a two level cascade variable and gitlab does not allow that. | _none_ |
| `CF_PROD_RETIRED_APP_SUFFIX` | If set, the app old version is not deleted/overriden but renamed with this suffix | _none_ |
| `prod-org` / `CF_PROD_ORG`                               | CF organization for `production` env _(only define if different from default)_| `$CF_ORG` |
| `prod-app-name` / `CF_PROD_APP_NAME`                     | Application name for `production` env  | `$CF_BASE_APP_NAME` |
| `prod-domain` / `CF_PROD_DOMAIN`                         | CF domain for `production` env         | `$CF_DEFAULT_DOMAIN` |
| `prod-route-path` / `CF_PROD_ROUTE_PATH`                 | CF domain for `production` env | `$CF_DEFAULT_DOMAIN` |
| `prod-host-name` / `CF_PROD_HOST_NAME`                   | Application host name for `production` env | `$CF_DEFAULT_ROUTE_PATH` |
| `prod-deploy-strategy` / `CF_PROD_DEPLOY_STRATEGY`       | Defines the deployment to production strategy. One of `manual` (i.e. _one-click_) or `auto`. | `manual` |
| `prod-zerodowntime` / `CF_PROD_ZERODOWNTIME`             | Enables zero-downtime deployment on `production` env | `true` |
| `prod-environment-url` / `CF_PROD_ENVIRONMENT_URL`       | The production environment url **including scheme** (ex: `https://my-application.public.domain.com`) Do not use variable inside variable definition as it will result in a two level cascade variable and gitlab does not allow that. | _none_ |
| `prod-retired-app-suffix` / `CF_PROD_RETIRED_APP_SUFFIX` | If set, the app old version is not deleted/overriden but renamed with this suffix | _none_ |

### Hook scripts

@@ -292,23 +319,23 @@ Here is the general recommendation (for each one of your environments):

* if the application is mapped to **one single route**: 
    * do not declare any route in the manifest,
    * set the `$CF_xxx_HOST_NAME` variable to override the hostname to use (or leave unset to use default),
    * set the `$CF_DEFAULT_DOMAIN` or `$CF_xxx_DOMAIN` variable to define the domain to use (or leave unset if you wish 
    * set the `xxx-host-name` input or `$CF_xxx_HOST_NAME` variable to override the hostname to use (or leave unset to use default),
    * set the `xxx-domain` input or `$CF_xxx_DOMAIN` variable to define the domain to use (or leave unset if you wish 
      to use the default CF domain),
    * set the `$CF_DEFAULT_ROUTE_PATH` or `$CF_xxx_ROUTE_PATH` variable to define the route path to use (or leave unset if you wish 
    * set the `xxx-route-path` input or `$CF_xxx_ROUTE_PATH` variable to define the route path to use (or leave unset if you wish 
      to use none).
* if the application is mapped to **several routes**:
    * declare the [routes in your manifest](https://docs.cloudfoundry.org/devguide/deploy-apps/manifest-attributes.html#routes),
      possibly using `((appname))` and `((hostname))` variables,
    * set the `$CF_xxx_HOST_NAME` variable to override the hostname to use (or leave unset to use default),
    * `$CF_DEFAULT_DOMAIN` or `$CF_xxx_DOMAIN` variables won't be used,
    * `$CF_DEFAULT_ROUTE_PATH` or `$CF_xxx_ROUTE_PATH` variables won't be used. 
    * `xxx-domain` input or `$CF_xxx_DOMAIN` variables won't be used,
    * `xxx-route-path` input or `$CF_xxx_ROUTE_PATH` variables won't be used. 

### `cf-cleanup-all-review` job

This job allows destroying all review environments at once (in order to save cloud resources).

It is **disabled by default** and can be controlled using the `$CLEANUP_ALL_REVIEW` variable:
It is **disabled by default** and can be controlled using the `cleanup-all-review` input or `$CLEANUP_ALL_REVIEW` variable:

1. automatically executed if `$CLEANUP_ALL_REVIEW` set to `force`,
2. manual job enabled from any `master` branch pipeline if `$CLEANUP_ALL_REVIEW` set to `true` (or any other value),
@@ -401,11 +428,11 @@ This variant allows delegating your secrets management to a [Vault](https://www.

In order to be able to communicate with the Vault server, the variant requires the additional configuration parameters:

| Name              | Description                            | Default value     |
| ----------------- | -------------------------------------- | ----------------- |
| INPUT / Variable                     | Description                            | Default value     |
| ------------------------------------ | -------------------------------------- | ----------------- |
| `TBC_VAULT_IMAGE`                    | The [Vault Secrets Provider](https://gitlab.com/to-be-continuous/tools/vault-secrets-provider) image to use (can be overridden) | `registry.gitlab.com/to-be-continuous/tools/vault-secrets-provider:master` |
| `VAULT_BASE_URL`  | The Vault server base API url          | _none_ |
| `VAULT_OIDC_AUD`  | The `aud` claim for the JWT | `$CI_SERVER_URL` |
| `vault-base-url` / `VAULT_BASE_URL`  | The Vault server base API url          | _none_ |
| `vault-oidc-aud` / `VAULT_OIDC_AUD`  | The `aud` claim for the JWT            | `$CI_SERVER_URL` |
| :lock: `VAULT_ROLE_ID`               | The [AppRole](https://www.vaultproject.io/docs/auth/approle) RoleID | **must be defined** |
| :lock: `VAULT_SECRET_ID`             | The [AppRole](https://www.vaultproject.io/docs/auth/approle) SecretID | **must be defined** |

+2 −2
Original line number Diff line number Diff line
@@ -27,13 +27,13 @@ if [[ "$curVer" ]]; then
  log_info "Bump version from \\e[33;1m${curVer}\\e[0m to \\e[33;1m${nextVer}\\e[0m (release type: $relType)..."

  # replace in README
  sed -e "s/ref: '$curVer'/ref: '$nextVer'/" README.md > README.md.next
  sed -e "s/ref: *'$curVer'/ref: '$nextVer'/" -e "s/ref: *\"$curVer\”/ref: \”$nextVer\”/" -e "s/component: *\(.*\)@$curVer/component: \1@$nextVer/" README.md > README.md.next
  mv -f README.md.next README.md

  # replace in template and variants
  for tmpl in templates/*.yml
  do
    sed -e "s/\"$curVer\"/\"$nextVer\"/" "$tmpl" > "$tmpl.next"
    sed -e "s/command: *\[\"--service\", \"\(.*\)\", \"$curVer\"\]/command: [\"--service\", \"\1\", \"$nextVer\"]/" "$tmpl" > "$tmpl.next"
    mv -f "$tmpl.next" "$tmpl"
  done
else
+50 −5

File changed.

Preview size limit exceeded, changes collapsed.

+14 −4

File changed.

Preview size limit exceeded, changes collapsed.

+237 −47

File changed.

Preview size limit exceeded, changes collapsed.