How to change default variables

We set default variables in all Building Blocks but there might be use cases where you do want to customize them. For example if you want to use another namespace or the configuration has to be in another directory than the default one.
This tutorial will show you how you can change these default variables of a Building Block.

Set a custom basedir

Let's assume you have an application which needs a Redis service and you want to have all configuration for this application in the same directory. You can add the Redis-HA Building Block in the same directory, but you have to overwrite the BASEDIR variable.

example-application/.gitlab-ci.yml

include:
  - project: syseleven/building-blocks/helmfiles/redis-ha
    file: JobDevelopment.yaml
    ref: 1.5.0

variables:
  BASEDIR: $CI_PROJECT_DIR/example-application

Now you can place your values-redis-ha.yaml in the example-application directory. To also deploy it in the same namespace, see below.

Set a custom namespace

Another use case could be, to deploy a Building Block into the same namespace together with your application. You can do so by overwriting the default namespace variable.

syseleven-redis-ha/.gitlab-ci.yml

include:
  - project: syseleven/building-blocks/helmfiles/redis-ha
    file: JobDevelopment.yaml
    ref: 1.5.0

variables:
  NAMESPACE_REDIS_HA: example-application-namespace

You can find the namespace variable for a Building Block in the Building Blocks repository.

Set a custom release name

If you want to set a custom release name you can do so by overwriting the release name variable.

syseleven-redis-ha/.gitlab-ci.yml

include:
  - project: syseleven/building-blocks/helmfiles/redis-ha
    file: JobDevelopment.yaml
    ref: 1.5.0

variables:
  RELEASE_NAME_REDIS_HA: example-application-redis-ha

You can find the release name variable for a Building Block in the Building Blocks repository.