How can I set environment variables in a GitLab CI docker runner?Root set environment variableshow to...
If the Dominion rule using their Jem'Hadar troops, why is their life expectancy so low?
Should a narrator ever describe things based on a character's view instead of facts?
Make a Bowl of Alphabet Soup
Why can't I get pgrep output right to variable on bash script?
Using an older 200A breaker panel on a 60A feeder circuit from house?
Weird lines in Microsoft Word
Writing in a Christian voice
Travelling in US for more than 90 days
What (if any) is the reason to buy in small local stores?
Extract substring according to regexp with sed or grep
Checking @@ROWCOUNT failing
How to split IPA spelling into syllables
Did I make a mistake by ccing email to boss to others?
Would this string work as string?
Output visual diagram of picture
What is it called when someone votes for an option that's not their first choice?
Why would five hundred and five same as one?
What is the meaning of "You've never met a graph you didn't like?"
Reason why a kingside attack is not justified
Mortal danger in mid-grade literature
Has the laser at Magurele, Romania reached a tenth of the Sun's power?
How to test the sharpness of a knife?
Is divisi notation needed for brass or woodwind in an orchestra?
How can I, as DM, avoid the Conga Line of Death occurring when implementing some form of flanking rule?
How can I set environment variables in a GitLab CI docker runner?
Root set environment variableshow to properly set environment variablesHow to set environment variables in /etc/environment?gitlab-runner has not yet connected errorHow to configure gitlab-runnergitlab-runner not using local imagegitlab runner errors occasionallyUnable to Register Gitlab Runner (Certificate Failed)Change Gitlab CI Runner user in subprocess
We need to set a company proxy to reach the internet from within our network. This is needed for the build-process (to fetch dependencies).
I have added the appropriate lines into /etc/bash.bashrc
in our docker image.
When manually running the image with:
docker run --rm -ti bboss/python:3 /bin/bash
and then executing
export
I can see the variables.
However, when I define a GitLab CI task based on that image and add a section like:
test-job:
script:
- export
I don't see any variables.
It seems like the entries in /etc/bash.bashrc
are not taken into consideration.
How can I make that work?
bash environment-variables gitlab
bumped to the homepage by Community♦ 5 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
We need to set a company proxy to reach the internet from within our network. This is needed for the build-process (to fetch dependencies).
I have added the appropriate lines into /etc/bash.bashrc
in our docker image.
When manually running the image with:
docker run --rm -ti bboss/python:3 /bin/bash
and then executing
export
I can see the variables.
However, when I define a GitLab CI task based on that image and add a section like:
test-job:
script:
- export
I don't see any variables.
It seems like the entries in /etc/bash.bashrc
are not taken into consideration.
How can I make that work?
bash environment-variables gitlab
bumped to the homepage by Community♦ 5 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
We need to set a company proxy to reach the internet from within our network. This is needed for the build-process (to fetch dependencies).
I have added the appropriate lines into /etc/bash.bashrc
in our docker image.
When manually running the image with:
docker run --rm -ti bboss/python:3 /bin/bash
and then executing
export
I can see the variables.
However, when I define a GitLab CI task based on that image and add a section like:
test-job:
script:
- export
I don't see any variables.
It seems like the entries in /etc/bash.bashrc
are not taken into consideration.
How can I make that work?
bash environment-variables gitlab
We need to set a company proxy to reach the internet from within our network. This is needed for the build-process (to fetch dependencies).
I have added the appropriate lines into /etc/bash.bashrc
in our docker image.
When manually running the image with:
docker run --rm -ti bboss/python:3 /bin/bash
and then executing
export
I can see the variables.
However, when I define a GitLab CI task based on that image and add a section like:
test-job:
script:
- export
I don't see any variables.
It seems like the entries in /etc/bash.bashrc
are not taken into consideration.
How can I make that work?
bash environment-variables gitlab
bash environment-variables gitlab
asked Dec 22 '17 at 14:20
exhumaexhuma
5321420
5321420
bumped to the homepage by Community♦ 5 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
bumped to the homepage by Community♦ 5 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
try
test-job:
script:
- env
2
Thank you for your contribution? Can you provide an explanation?
– bertieb
Apr 17 '18 at 22:30
Items listed after the 'script:' tag are executed in the default underlying shell. 'env' is a utility (typically found in sh, bsh, zsh, etc... ) that prints the current environment variables. 'export' is a command that is built in to the shell. It is possible that gitlab is not handling the 'export' command correctly. I recently used 'env' command in this way, so I know it works as expected. See 'man export' and 'man env' for more details.
– mmccabe
Apr 18 '18 at 5:32
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1279394%2fhow-can-i-set-environment-variables-in-a-gitlab-ci-docker-runner%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
try
test-job:
script:
- env
2
Thank you for your contribution? Can you provide an explanation?
– bertieb
Apr 17 '18 at 22:30
Items listed after the 'script:' tag are executed in the default underlying shell. 'env' is a utility (typically found in sh, bsh, zsh, etc... ) that prints the current environment variables. 'export' is a command that is built in to the shell. It is possible that gitlab is not handling the 'export' command correctly. I recently used 'env' command in this way, so I know it works as expected. See 'man export' and 'man env' for more details.
– mmccabe
Apr 18 '18 at 5:32
add a comment |
try
test-job:
script:
- env
2
Thank you for your contribution? Can you provide an explanation?
– bertieb
Apr 17 '18 at 22:30
Items listed after the 'script:' tag are executed in the default underlying shell. 'env' is a utility (typically found in sh, bsh, zsh, etc... ) that prints the current environment variables. 'export' is a command that is built in to the shell. It is possible that gitlab is not handling the 'export' command correctly. I recently used 'env' command in this way, so I know it works as expected. See 'man export' and 'man env' for more details.
– mmccabe
Apr 18 '18 at 5:32
add a comment |
try
test-job:
script:
- env
try
test-job:
script:
- env
answered Apr 17 '18 at 21:50
mmccabemmccabe
1011
1011
2
Thank you for your contribution? Can you provide an explanation?
– bertieb
Apr 17 '18 at 22:30
Items listed after the 'script:' tag are executed in the default underlying shell. 'env' is a utility (typically found in sh, bsh, zsh, etc... ) that prints the current environment variables. 'export' is a command that is built in to the shell. It is possible that gitlab is not handling the 'export' command correctly. I recently used 'env' command in this way, so I know it works as expected. See 'man export' and 'man env' for more details.
– mmccabe
Apr 18 '18 at 5:32
add a comment |
2
Thank you for your contribution? Can you provide an explanation?
– bertieb
Apr 17 '18 at 22:30
Items listed after the 'script:' tag are executed in the default underlying shell. 'env' is a utility (typically found in sh, bsh, zsh, etc... ) that prints the current environment variables. 'export' is a command that is built in to the shell. It is possible that gitlab is not handling the 'export' command correctly. I recently used 'env' command in this way, so I know it works as expected. See 'man export' and 'man env' for more details.
– mmccabe
Apr 18 '18 at 5:32
2
2
Thank you for your contribution? Can you provide an explanation?
– bertieb
Apr 17 '18 at 22:30
Thank you for your contribution? Can you provide an explanation?
– bertieb
Apr 17 '18 at 22:30
Items listed after the 'script:' tag are executed in the default underlying shell. 'env' is a utility (typically found in sh, bsh, zsh, etc... ) that prints the current environment variables. 'export' is a command that is built in to the shell. It is possible that gitlab is not handling the 'export' command correctly. I recently used 'env' command in this way, so I know it works as expected. See 'man export' and 'man env' for more details.
– mmccabe
Apr 18 '18 at 5:32
Items listed after the 'script:' tag are executed in the default underlying shell. 'env' is a utility (typically found in sh, bsh, zsh, etc... ) that prints the current environment variables. 'export' is a command that is built in to the shell. It is possible that gitlab is not handling the 'export' command correctly. I recently used 'env' command in this way, so I know it works as expected. See 'man export' and 'man env' for more details.
– mmccabe
Apr 18 '18 at 5:32
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1279394%2fhow-can-i-set-environment-variables-in-a-gitlab-ci-docker-runner%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown