13
votes
docker-compose.yml - make network name configurable via environment variable
It is possible via network name:
networks:
mynetwork:
name: ${STAGE_NAME}
where mynetwork - name "inside" stack
${STAGE_NAME} -name for other stacks/services/containers
See comment from ...
13
votes
How should I store my environment variables?
I've had two runs at doing environment variables in a scalable way and neither has ended up perfect because, as I've discovered, is a very tricky thing to get right. I'll give a summary of both of my ...
10
votes
Accepted
Docker compose volume syntax valid for Windows and Linux
Yes. Just use ./ for you current directory that the Docker-compose file is in. Your "working directory" for the compose file is just "./". If you are trying to set a directory ...
4
votes
Accepted
What approach should I take to store environment variables for a repo?
General Notes
I don't really understand this one:
However, this seems clunky, as I have to create the logic to read this
file in every script that is made.
You can source all variables from a ...
4
votes
Accepted
How to pass Gitlab env var with sensitive characters to bash script?
Surprisingly indeed GitLab works weirdly with the env vars.
It evaluates them internally, though it shouldn't in my view.
Value set as (in project Settings > CI/CD > Variables): 'aaa$bbb*%'
becomes '...
4
votes
Accepted
docker-compose.yml - make network name configurable via environment variable
If you have envsubst installed (part or gnu gettext) you can use something like that:
export STAGE_NAME="xyz"
export STAGE_NETWORK_PREFIX="1.2.3.4"
docker-compose -f <(envsubst docker-compose.yml) ...
4
votes
Accessing the committer's name as a Jenkinsfile environment variable
I'm not entirely sure what you're trying to ask in your question, so I'm answering the question I believe you're trying to ask.
A build does not necessarily have a single commit author. It has a ...
3
votes
Azure Devops Pipeline variables in Powershell
Pipeline Variables are handed to PowerShell as environment variables, which means that $ip exists only with the script while you want to use $env:ip to pick the environment variable value.
Note Secret ...
3
votes
Docker compose volume syntax valid for Windows and Linux
PS C:\Users\gaius> Write-Output $PSVersionTable.PSVersion
Major Minor Build Revision
----- ----- ----- --------
5 1 17763 592
PS C:\Users\gaius> Write-Output $pwd
Path ...
3
votes
How should I store my environment variables?
If your environments are per customer, I would suggest in your specific case to have a repository per customer. (In general it is repository per environment.) This repository would have a standard ...
3
votes
Accepted
Is there a php (or composer) command to change upload_max_filesize && post_max_size from terminal?
The reason; having a more a version-agnostic and more
backward-compatible directive in my server-environment-establishment
script, to change the values of these two variables.
If you're trying to ...
2
votes
How to pass Gitlab env var with sensitive characters to bash script?
This is not answering only the question but also a bit more (I put this here for reference):
I found out a decent way to tackle this and some complications coming afterwards... (after hours and hours ...
2
votes
Docker compose volume syntax valid for Windows and Linux
I think my case may be related as I also tried to configure environment for both Windows and Linux. I only have to mention that I am using docker-compose on WSL1 (Windows Subsystem for Linux) ...
2
votes
Accepted
Azure Devops Pipeline variables in Powershell
The issue is that you can't reference the changed value in the same task.
I created a new Powershell task and just called Write-Host "env:IP environment variable set to ($env:IP)" which ...
2
votes
How to access a fully qualified domain name through "localhost"?
According to your screen dump you have your port 80 mapped to the Traefik container
58cd5b59579c traefik:v2.2 "/entrypoint.sh --lo…" 16 minutes ago Up 15 ...
2
votes
Pass environment variables from pipeline job A to pipeline job B
The issue was missing comma between build job and parameters. Below is the correct syntax:
...
build job: 'run-on-single-repo',
parameters:
...
1
vote
How to get all the env variables of any docker image?
@goulashsoup has good advice...
so, if you mean, how to inspect environment variables in a running container, then do:
docker exec -u root $CONTAINER_ID sh -c "env | sort"
1
vote
How many deployment environments are appropriate for SPA + API architecture?
My first thought when I see two components that depend on each other during a deployment - often the app and the database - I try to come up with a way to decouple them.
If you can deploy your UI and ...
1
vote
Deploying environment secrets to services
You can achieve this in multiple ways.
You can set your credentials as secrets if you use a CI/CD system such as Jenkins or Gitlab pipelines. Then reference them within your pipeline script as ...
1
vote
Is there a safe way to archive Azure App Services application settings?
Ideally, you would be injecting these via an appsettings.json, Key Vault reference or something and not manually setting these in the Configuration panel itself. In terms of archiving the actual ...
1
vote
How to handle different credentials in continuous integration?
I'm not familiar with teamcity, but you can :
add a config folder in your repo, and inside this repo
create three files (staging.yml, preprod.yml, prod.yml).
on each file you will write down ...
1
vote
Jenkins won't substitute variables when trying to check out from perforce
Your string isn't being interpolated at the correct time because it's in single quotes. Instead it's being passed to the checkout method as an un-interpolated string. By the time the checkout method ...
1
vote
Accepted
Can we reuse Variables across variable groups in Azure DevOps?
My understanding of the variable groups is that you would create this to leverage the same variables across multiple pipelines. If you needed to update the value, you'd only have to update it on the ...
1
vote
How to get list of env variables from the root folder to jenkins job?
I recommend that you use the printenv command for list system Variable:
printenv
and also An easy way to obtain the Jenkins environment variables list from your local installation is to append env-...
1
vote
Is there a php (or composer) command to change upload_max_filesize && post_max_size from terminal?
PHP has supported conf.d configuration subdirectories for ages now (cf. PHP_INI_SCAN_DIR in its documentation, this stuff is as old as PHP 5 basically) - allowing you to simply add a small file ...
1
vote
Environment variable names, when my development environment has multiple projects
check out https://direnv.net/ it sets environment variables based on the directory you are in.
other options are:
1.docker-compose
2.plain bash to set the variables.
3. bash source .env
4. use ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
environment-variables × 27jenkins × 5
jenkins-pipeline × 4
docker-compose × 4
jenkinsfile × 3
shell-script × 3
environments × 3
docker × 2
kubernetes × 2
ansible × 2
azure-devops × 2
azure × 2
azure-pipelines × 2
nginx × 2
configuration × 2
groovy × 2
github-actions × 2
continuous-integration × 1
git × 1
deployment × 1
linux × 1
continuous-deployment × 1
windows × 1
gitlab-ci-runner × 1
configuration-management × 1