Questions tagged [environment-variables]
27 questions
11
votes
4 answers
docker-compose.yml - make network name configurable via environment variable
I have a docker compose file with env variables for stage specific configurations. As long as env variables are used in values in docker-compose.yml everything is fine, but the problem is with the network name, since it's specified in the…
ivicaa
- 260
- 2
- 8
11
votes
2 answers
How should I store my environment variables?
This is a very broad question about methods and advice regarding environment variables / structure. But ultimately I'm looking for answers for the very specific question of 'How should I store my environment variables?'
Firstly some…
Naphta
- 627
- 6
- 9
10
votes
5 answers
Docker compose volume syntax valid for Windows and Linux
We have developers working on an app using both Windows and Linux. The application is built within a Docker container, and ships a docker-compose specification for the build environment.
The local directory is mounted as a volume:
volumes:
…
Bruce Becker
- 3,783
- 4
- 20
- 41
5
votes
3 answers
How to pass Gitlab env var with sensitive characters to bash script?
I have the following situation:
I'm storing sensitive data in Gitlab's environment and then passing these variables to a deployment script in bash.
Gitlab's env var:
Key: sensitive_var
Value: aaa$bbb*%
Then in the .gitlab-ci.yml file the env vars…
JJ Yong
- 53
- 1
- 1
- 4
5
votes
2 answers
Azure Devops Pipeline variables in Powershell
I've tried to figure this out and I can't see why my ipaddress is not getting set.
I've checked code samples and they all suggest I am doing everything correct.
ip variable defined here:
This is my powershell script:
# Write your PowerShell…
cdsln
- 171
- 1
- 1
- 4
4
votes
1 answer
Accessing the committer's name as a Jenkinsfile environment variable
Using the env.BRANCH_NAME variable accessible in the Jenkinsfile outside of the pipeline{} block, I have set up a variable used to conditionally set the node used to build the git branch. I would like to also access the name of the developer who…
Michael Ficocelli
- 41
- 1
- 2
3
votes
0 answers
Substitute env_file values with .env values on docker compose
Is it possible to substitute (without the use of external tools like envsubst) values in an environment file used in docker-compose (using env_file) with values on a .env file in the folder?
Say I have this .env…
Jcl
- 131
- 3
3
votes
1 answer
Pass environment variables from pipeline job A to pipeline job B
I passed params to pipeline B and set the environment variables from parameters. However, "${params.URL}" is evaluated as null.
Pipeline A is declared in Jenkinsfile:
pipeline {
agent any
stages {
stage('Run on all repos') {
…
rokpoto.com
- 266
- 3
- 9
3
votes
1 answer
What approach should I take to store environment variables for a repo?
I am setting up a new infrastructure as code repository for a small to medium size project. The problem I am currently trying to solve is how to store my environment variables such that they can be read and used by all services and scripts within…
Savvly
- 33
- 4
2
votes
1 answer
Can we reuse Variables across variable groups in Azure DevOps?
I'm using DevOps to deploy Azure Data Factory ARM template
I'm using a deployment pipeline to take artifacts from a prior build pipeline and deploy to various environments (TEST, PROD)
I've created two variable groups: TEST and PROD. I've created…
Nick.Mc
- 123
- 6
2
votes
3 answers
How to define global variables in groovy file, which I want to load and consume?
I have a Jenkins parent groovy file which consumes the child groovy file
Parent grooy file:
...
def child = load 'child-groovy-file';
child.execute();
Child groovy file:
a = "first letter";
b = "second letter;
def execute
{
echo "a is…
omkar sirra
- 163
- 1
- 2
- 8
2
votes
2 answers
Environment variable names, when my development environment has multiple projects
The context is that I'm looking at doing staging/testing and production on a kubernetes cluster.
Where I might have some code that looks like this:
doSomething({
username: process.env.DB_USERNAME,
password: process.env.DB_PASSWORD
})
For my…
dwjohnston
- 231
- 3
- 11
1
vote
2 answers
How to handle different credentials in continuous integration?
I am using teamcity to automatically build and test a nodejs application. The problem I am facing is that the application needs to have some environment variables set during the build phase, as well as some secret variables that need to be set…
Cyclonecode
- 111
- 7
1
vote
1 answer
Jenkins won't substitute variables when trying to check out from perforce
I want to generalize my code so that it can pull from perforce for any files marked with a type "perforce" because some files need to downloaded from the artifactory instead. I want to sub in the variable perf[0].ID into the 'view' parameter so that…
Jack Stevens
- 11
- 1
1
vote
1 answer
Set environment variables then run script in Jenkins Scripted Pipeline
I am new to Jenkins, Groovy and pipelines. I have created a simple pipeline stage like so:
//working build but not setting env variables
node('build-01') {
stage('Building') {
echo "[*] Starting build (id: ${env.BUILD_ID}) on…
Perplexabot
- 111
- 1
- 1
- 7