-
Notifications
You must be signed in to change notification settings - Fork 27
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
feature: print version on the start of execution and always pull docker image (always update stable) #417
Conversation
8f0550a
to
8413adf
Compare
7f415f9
to
9fa75eb
Compare
e8fce90
to
45bb1b7
Compare
e1cfdaf
to
cd3eb1f
Compare
b3d7412
to
2e323bf
Compare
2e323bf
to
a140329
Compare
still needs some testing locally |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code itself seems ok, it compile and I verified that locally passing: "set codacyAnalysisCli / version := "magic version" and doing compile and then "codacyAnalysisCli / run --version", seems to all be working.
The script itself I already left comments inline.
The only issue I'm not sure is if this will really change the version for the released binary, as is I believe it stays the same, since looking at the circle ci file I only see one single place changing the version with sbt. It has the following at line 178 - sbt "set codacyAnalysisCli / version := \"dev-snapshot\";
, so please confirm if this also needs to change.
If that verification comes afterwards or the change itself, we can still approve and go on with the PR as is.
@@ -31,6 +31,7 @@ run() { | |||
output_volume="--volume ${OUTPUT_DIRECTORY}:${OUTPUT_DIRECTORY}"; | |||
fi | |||
local CODACY_ANALYSIS_CLI_VERSION="${CODACY_ANALYSIS_CLI_VERSION:-stable}" | |||
docker pull codacy/codacy-analysis-cli:${CODACY_ANALYSIS_CLI_VERSION} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to work as I tried locally with the changed script to fetch a latest stable version or other version.
I'd reccomened the change that machado said to add quotes, I tried with things like env CODACY_ANALYSIS_CLI_VERSION="stuff stuff"
and it really gets a little better UX with the quotes.
Also It seems better to have the commands connected with a &&, I just checked locally and seems to behave better in case of a bad tag passed since it doesn't try to run something invalid after already tried to pull something invalid and failling. So:
docker pull codacy/codacy-analysis-cli:${CODACY_ANALYSIS_CLI_VERSION} | |
docker pull codacy/codacy-analysis-cli:"${CODACY_ANALYSIS_CLI_VERSION}" && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also bellow on line 45:
codacy/codacy-analysis-cli:${CODACY_ANALYSIS_CLI_VERSION}
should be codacy/codacy-analysis-cli:"${CODACY_ANALYSIS_CLI_VERSION}"
So it's consistent.
closing since this is stale, we can consider having these changes later |
did this one on the side while fixing tests in worker
I havent tested it yet, but its ready for review of the approach (actually I tested that the env of the docker contains the version, so further testing should be a quick thing)