0

I am having troubles to manage secret password on Jenkins. I want that the password is not showed on the log but i tried in two ways without success:

First attempt

I tried setting up with user and pwd with Global credentials (unrestricted) like this :

enter image description here

and i executed :

docker run -u root -v $(pwd)/:/usr/src/app deploy npm run application -- --params.login.user=$USER --params.login.password=$PWD 

but i can see in the log that the user is wrote correctly but the pwd is being written like its path:

[email protected] e2: `protractor dist/out-tsc/e2e/cucumberconfig.js "--params.login.user=user" "--**params.login.password=/var/lib/jenkins/workspace/application/app/e2e_test**" 

And in my automatic test is also by entering the full path instead of the value of the variable.

Second attempt

I tried using a secret text like this:

enter image description here

 docker run -u root -v $(pwd)/:/usr/src/app deploy npm run application -- --params.login.user=$USER --params.login.password=$PASS 

But on the console log is being displayed the password as it is.

Someone can help me?

Thank you in advance.

2 Answers 2

1

But on the console log is being displayed the password as it is.

is it mean in clear text?

If so - use mask password plugin to solve the issue.

Sign up to request clarification or add additional context in comments.

1 Comment

I know that it works but i dont want to install anything, i used :set +x at the beginning and set -x at the end and it is worked
0

i used : set +x docker run -u root -v $(pwd)/:/usr/src/app deploy npm run application -- -params.login.user=$USER --params.login.password=$PWD set -x

and that worked.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.