private_token-
Required. A private token which provides access to the project-variables.
project_id-
Required. The project-ID within gitlab
base_url-
Optional. The url to the gitlab-api, defaults to
https://gitlab.com/api/v4 not_base64_encoded-
Optional. The resource assumes base64 encoded variables by default, so you can define a list of exceptions here
not_masked-
Optional. The resource assumes masked variables by default, so you can define a list of exceptions here
Checks for new versions of variables within gitlab by fetching them via Gitlab-API and form a hash over them.
Download the variables from gitlab via Gitlab-API and make them available as files.
---
# Resource configuration
resource_types:
- name: gitlab-variables-resource
type: registry-image
source:
repository: nemoinho/gitlab-variables-resource
tag: 1.0.0
resources:
- name: gitlab-vars
type: gitlab-variables-resource
source:
private_token: ((gitlab_private_token))
project_id: ((gitlab_project_id))
not_base64_encoded:
- NON_BASE64_ENCODED_VARIABLE
# update job
jobs:
- name: update-vars
plan:
- get: gitlab-vars
- task: update-vars
config:
platform: linux
image_resource:
type: registry-image
source: { repository: busybox }
inputs:
- name: gitlab-vars
outputs:
- name: gitlab-vars
run:
path: /bin/bash
args:
- -c
- echo HARD-CODED-VALUE > gitlab-vars/UPDATED_VARIABLE
- put: gitlab-vars
params:
origin: gitlab-vars