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 ...
user avatar
  • 1,634
8 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 ...
user avatar
7 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 ...
user avatar
  • 171
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 ...
user avatar
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 ...
user avatar
  • 2,743
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 ...
user avatar
  • 5,627
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 ...
user avatar
3 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) ...
user avatar
3 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 '...
user avatar
  • 146
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 ...
user avatar
  • 1,076
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 ...
user avatar
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 ...
user avatar
  • 141
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 ...
user avatar
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: ...
user avatar
  • 171
1 vote

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) ...
user avatar
  • 11
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 ...
user avatar
  • 11
1 vote

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 ...
user avatar
  • 111
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 ...
user avatar
  • 2,743
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 ...
user avatar
  • 126
1 vote

How to define global variables in groovy file, which I want to load and consume?

try this one static void main(String[] args) { // Initializing 2 variables def x = 5; def y = 10; //Performing addition of 2 operands println(x+y); } } check ...
user avatar
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-...
user avatar
  • 1,351
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 ...
user avatar
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 ...
user avatar

Only top scored, non community-wiki answers of a minimum length are eligible