Skip to content

nemoinho/gitlab-variables-resource

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gitlab-Variables Resource

Source configuration

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

Behavior

check: Check for changes of variables

Checks for new versions of variables within gitlab by fetching them via Gitlab-API and form a hash over them.

in: Fetch variables from Gitlab-CI

Download the variables from gitlab via Gitlab-API and make them available as files.

out: Update variables within Gitlab-CI

Set or update variables within gitlab via Gitlab-API.

Parameters

origin

Required. The directory which contains the files which should be saved as variables

Examples

Retrieve and update variables
---
# 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

About

A resource for Concourse-CI to access variables from gitlab-CI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published