Supply variables in the build

Issue #14503 duplicate
Andrew howden created an issue

Currently, we're using the pipelines system as a task runner to run deployments. However, particularly in the case of test systems, it'd be useful to supply variables to the build -- deploy version ${x} with the ansible configuration at HEAD, for example.

Official response

Comments (7)

  1. Andrew howden reporter

    Hi @xtjhin;

    Currently, we use the environment variables to store a PGP key, later used to decrypt secrets. This is not what I'm talking about; rather instead, a variable that can be supplied to a custom task on a per invocation basis -- such as "this refspec" or "this ip".

  2. Joshua Tjhin Account Deactivated

    Hi Andrew,

    I'm not quite sure I follow. Is it a variable that is incremented each time it has been invoked? Could you show me how you would use this in your yml?

  3. Andrew howden reporter

    Hi Joshua;

    You wouldn't. There is already this notion of supplying environment variables outside version control to be used arbitrarily. This would be an extension of that, such that you could specify an environment variable per build.

    This would appear in that popup window in the form used for custom jobs.

    The specification could be in the yaml. Something like:

    definitions:
      fields:
        - name: "deploy_spec"
          input: "text"
          default: "refs/heads/master"
       - name: "deploy_environment"
         input: "text"
         default: "testing"
         select:
            - "testing"
            - "staging"
            - "production"  
    

    Consumed in the pipeline as the the envvar deploy_environment.

  4. Matt Ryall

    Thanks for the clarification, Andrew. We're tracking this request as #13737, called "parameterised builds". It already has a few votes there.

  5. Log in to comment