question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Setting auth credentials from command line or environment variable

See original GitHub issue

In the case jib-maven-plugin is used in a CI environment, it can be useful to pass the authentication credentials directly via the command line or via environment variable.

For example with Gitlab CI, it is the case that CI jobs have environment variables with temporary tokens to push images to the Gitlab Registry.

Currently, it seems to me that the only way to take advantage of these is either via docker login (which means I need docker installed now) or via some hack by generating a custom settings.xml.

It would be great either to have jib-maven-plugin accept credentials via command line or to document what is the preferred way to achieve the requirement.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

5reactions
coollogcommented, Jul 23, 2018

We could also consider adding auth to the image configurations for jib-maven-plugin as well (like we have in jib-gradle-plugin), so people could do:

<configuration>
    <to>
        <image>imagename</image>
        <auth>
            <username>${env.REGISTRY_USERNAME}</username>
            <password>${env.REGISTRY_PASSWORD}</password>
        </auth>
    </to>
</configuration>

and be able to use REGISTRY_USERNAME and REGISTRY_PASSWORD environment variables as the credentials.

1reaction
victornoelcommented, Aug 2, 2018

@coollog @TadCordle thanks, it works well, I just tested it.

For the record, the README wasn’t updated with the new options.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using Environment Variables for Authentication Credentials
Start a new shell or a new terminal. Confirm that your environment variables have been set by typing echo $SAUCE_USERNAME in your terminal....
Read more >
Using credentials from environment variables - AWS SDK for ...
To authenticate to Amazon Web Services, the SDK first checks for credentials in your environment variables. The SDK uses the getenv() function to...
Read more >
Using Environment Variables For Authentication Credentials
Step 1: Open your terminal mode, and provide the command vi ~/.bash_profile & hit Enter. Step 2: To perform text-insertion into your profile, ......
Read more >
How to separate your credentials, secrets, and configurations ...
The twelve-factor app stores config in environment variables (often ... (aka universe) via a command line argument instead of a .env file.
Read more >
Authenticating to AWS with Environment Variables
Important note: Setting environment variables as shown above, at least on Linux/Unix/Mac, will store your credentials in your bash history. That means your ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found