Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check KBASE_TEST_TOKEN env var if no dev token is found #346

Merged
merged 3 commits into from
Feb 27, 2020

Conversation

ialarmedalien
Copy link
Collaborator

@ialarmedalien ialarmedalien commented Jan 29, 2020

Two changes in this PR:

  • Check for the presence of the environment variable KBASE_TEST_TOKEN if there is no developer token specified in test_local/test.cfg
  • Specify the JDK version in the travis file config so that the sdk will build successfully on Travis

Comment on lines +6 to +7
jdk:
- openjdk8
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensure that the appropriate JDK is used.

Comment on lines +50 to +53
String test_token = System.getenv("KBASE_TEST_TOKEN");
if (test_token != null && !test_token.trim().isEmpty()) {
tokenString = test_token;
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Default to using the value in test.cfg, and check the env var KBASE_TEST_TOKEN if that value is not set.

@ialarmedalien ialarmedalien changed the title Allow KBASE_TEST_TOKEN env var to be used as well as hardcoding the t… Check KBASE_TEST_TOKEN env var if no dev token is found Jan 29, 2020
@scanon
Copy link
Contributor

scanon commented Jan 29, 2020

I think you will also need to modify the generated kb-sdk scripts that use Docker so that the variable makes it into the container where the sdk tool runs.

https://github.com/kbase/kb_sdk/blob/master/entrypoint

@MrCreosote
Copy link
Member

I don't think so, all this happens prior the the entrypoint being called. The token read here winds up in the token file prior to docker being started.

@scanon
Copy link
Contributor

scanon commented Jan 29, 2020

What I mean is ...

I set the token variable in my current (non-docker sdk) shell
I envoke kb-sdk which is a script that call docker run .... kb-sdk
the environment variable in my shell will not be passed into that unless the entrypoint (for the sdk tool) is modified.

@MrCreosote
Copy link
Member

Oh, right, you're talking about the dockerized version of the SDK. I was thinking of the local version, where this would work as is.

@ialarmedalien
Copy link
Collaborator Author

I was intending this for local use, but if you want to add in something to allow it to be used for the dockerised version, go for it.

@sychan sychan merged commit 2ea5555 into kbase:develop Feb 27, 2020
@ialarmedalien ialarmedalien deleted the kbase_test_token_env_var branch February 27, 2020 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants