Sign inSign up

computronix/bitbucket-pipe-repovariable

By computronix

•Updated about 4 years ago

Bitbucket Pipelines Pipe: Create and Update Repository variables

Image
0

381

computronix/bitbucket-pipe-repovariable repository overview

⁠Bitbucket Pipelines Pipe: Create and Update Repository variables

This pipe simplifies creating variables within your repository.

⁠YAML Definition

Add the following snippet to the script section of your bitbucket-pipelines.yml file:

# Creatinng Bearer Tokens
- pipe: docker://computronix/bitbucket-pipe-repovariable:0.3.0
variables:
    type: Bearer
    bitbucket_api_oauthconsumer_key: '<string>'
    bitbucket_api_oauthconsumer_secret: '<string>'
    # variable_name: 'string' #Optional
    # action: 'create' or 'delete' defaults to create

#Creating other variables
- pipe: docker://computronix/bitbucket-pipe-repovariable:0.3.0
variables:
    variable_name: '<string>'
    variable_value: '<string>'
    type: 'other'
    sensitive: '<boolean>'
    bitbucket_api_oauthconsumer_key: '<string>'
    bitbucket_api_oauthconsumer_secret: '<string>'
    # action: 'create' or 'delete' defaults to create

⁠Variables

VariableUsage
variable_nameName of the variable to create / update
variable_valueValue of the variable to create / update
actionCreate or Delete a repo variable
typeBearer to create a bearer token Other for any variable name and value
sensitiveIf the variable should be secret. If the type is Bearer the variable will default and can not be overridden to sensitive
bitbucket_api_oauthconsumer_keyOauth consumer key for the workspace
bitbucket_api_oauthconsumer_secretOauth consumer secret for the workspace

⁠Examples

⁠Basic example:

Example creating a BEARER_TOKEN to access and update variables :

script:
  - pipe: docker://computronix/bitbucket-pipe-repovariable:1.0.0
    variables:
      type: Bearer
      bitbucket_api_oauthconsumer_key: '<string>'
      bitbucket_api_oauthconsumer_secret: '<string>'

Or to create a variable with any name and value:

script:
  - pipe: docker://computronix/bitbucket-pipe-repovariable:1.0.0
    variables:
      type: other
      action: create
      variable_name: myNewVar
      variable_name: myNewVarValue
      sensitive: 'true'
      bitbucket_api_oauthconsumer_key: '<string>'
      bitbucket_api_oauthconsumer_secret: '<string>'

If you're reporting an issue, please include:

  • the version of the pipe
  • relevant logs and error messages
  • steps to reproduce

⁠License

Apache 2.0 licensed, see LICENSE.txt⁠ file.

Tag summary

Content type

Image

Digest

sha256:f875c16fb…

Size

5.7 MB

Last updated

about 4 years ago

docker pull computronix/bitbucket-pipe-repovariable:1.0.1