Add a Git token to Velocity
Sometimes, a Dockerfile will include a Git clone operation in which you will need to include a Git token as a build argument. For example, if your Dockerfile includes something like the following, you will need to include GH_TOKEN
and GH_USERNAME
build args.
To do so in Velocity, you can pass the GH_TOKEN
and GH_USERNAME
as a build args in the Velocity Run Configuration Wizard as follows:
NOTE: your Git token is never passed to Velocity, as it remains only in your local machine, and in your Kubernetes cluster during a Velocity build.
Generating a Personal Access Token in GitHub
To generate a Personal Access Token in GitHub, follow the steps shown below:
Storing Git Tokens as Environment Variables
Velocity allows Run Configuration values to be input as environment variables, which are then resolved at runtime. This feature is commonly used to access Git Tokens, which are stored in a developer's local environment.
For example, after generating a Git token, you can store the token as a local environment variable as follows:
Then, you can pass this environment variable when you create a Velocity Run Configuration, as follows:
Last updated