Closure-compiler: Publish nightly build to maven snapshot

Created on 25 Mar 2016  Â·  25Comments  Â·  Source: google/closure-compiler

This would help downstream projects like angular/clutz to detect breakages sooner, or to pick up bugfixes before they are released as stable.

P3 Work In Progress

Most helpful comment

I have bumped into this also, particularly around #2336 - it is pretty common over in the Angular world to name something async. In fact Angular itself has an important testing export with that name.

(I also occasionally work in ClojureScript, where that one causes widespread breakage, I'm sure they would love to have more frequent interim builds available for testing and faster feedback also.)

All 25 comments

cc @rkirov

Can't you use "top of tree"?

top of tree doesn't have compiled artifacts, so our build system would have
to compile closure compiler as well

On Fri, Mar 25, 2016 at 5:14 PM John Lenz [email protected] wrote:

Can't you use "top of tree"?

—
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
https://github.com/google/closure-compiler/issues/1689#issuecomment-201607035

Yes, that is what I meant.

I have bumped into this also, particularly around #2336 - it is pretty common over in the Angular world to name something async. In fact Angular itself has an important testing export with that name.

(I also occasionally work in ClojureScript, where that one causes widespread breakage, I'm sure they would love to have more frequent interim builds available for testing and faster feedback also.)

I think we should have travis auto publish the latest snapshot

@ChadKillingsworth you mentioned you've done or seen a setup in which Travis has an encrypted copy of a password so it can push changes to Maven. Could you post a link to an example or instructions on this issue?

Actually - here's a better script: https://gist.github.com/letmaik/4060735

I've found that the Guava team uses a setup based on this.
https://coderwall.com/p/9b_lfq/deploying-maven-artifacts-from-travis

I'm working toward doing the same.

Now getting

$ travis_util/deploy_snapshot.sh
/home/travis/.travis/job_stages: line 661: travis_util/deploy_snapshot.sh: Permission denied

That file is already executable in our internal repo but not on Github. It seems that MOE is not keeping the executable bit when translating. https://github.com/MatrixFrog/closure-compiler/commit/5bd827c853c7a54f192632e80366b768904b2044 would fix it, I suppose.

It looks like it worked: https://api.travis-ci.org/jobs/232667108/log.txt?deansi=true but I'm afraid MOE may get confused, or unset the executable bit on the next push. Will try it tomorrow.

Getting closer! https://api.travis-ci.org/jobs/232959212/log.txt?deansi=true

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project [secure]-parent: Failed to deploy artifacts: Could not transfer artifact com.google.javascript:[secure]-parent:pom:1.0-20170516.193526-8 from/to sonatype-nexus-snapshots (https://oss.sonatype.org/content/repositories/snapshots/): Failed to transfer file: https://oss.sonatype.org/content/repositories/snapshots/com/google/javascript/[secure]-parent/1.0-SNAPSHOT/[secure]-parent-1.0-20170516.193526-8.pom. Return code is: 401, ReasonPhrase: Unauthorized. -> [Help 1]

I'm experimenting with this now.

Can I set environment username/password environment variables and use the travis_util/settings.xml file to deploy a snapshot manually from my own git repo?

cd ~/git/closure-compiler
git pull
export CI_DEPLOY_USERNAME=brad4d
export CI_DEPLOY_PASSWORD=<REDACTED>
mvn clean source:jar deploy --settings=travis_util/settings.xml -DskipTests=true

Yep, that worked.

Now try the same thing using the closure-compiler account info.

Yep, that worked, too.

By "worked" I mean that the mvn command reports all successes.

Just for sanity's sake I'm going to try with a bogus password.

OK, bogus password caused immediate failure.

So, the problem appears to be that travis isn't setting the environment variables correctly.

Possibility 1: I messed up the encryption.
Possibility 2: There's some other travis config option we need to set to make it use the environment variables.

Looks like it's Possibility 1: I messed up the encryption.
Looking more closely at the logs I see it reports exporting CI_DEPLOY_USERNAME twice and never mentions the password.

I'm regenerating both of them just to be safe.

Just did the daily push including my fix.
Now we wait to see how Travis handles it.

https://s3.amazonaws.com/archive.travis-ci.org/jobs/233795162/log.txt?X-Amz-Expires=30&X-Amz-Date=20170518T214347Z&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAJRYRXRSVGNKPKO5A/20170518/us-east-1/s3/aws4_request&X-Amz-SignedHeaders=host&X-Amz-Signature=e3ba9752c9ed23aa6d55e21fbd8fdac5ef6c55c25afeb3a991f103efd6b312e5

Travis successfully deployed a snapshot after it verified today's push to github.

Don't forget to add a doc somewhere saying how to switch to snapshots

and thanks!!

@alexeagle you're welcome.
Sorry, but I don't know how to write such a doc, since I never use the compiler that way.
Maybe if you file an issue someone who does know will volunteer.

I updated https://github.com/google/closure-compiler/wiki/Maven but I think there's probably another step needed because the snapshots are published to https://oss.sonatype.org/content/repositories/snapshots/com/google/javascript/closure-compiler/1.0-SNAPSHOT/ and not to Maven Central.

Thanks for publishing this. We are going to consume the nightly builds with - https://github.com/angular/clutz/pull/521

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sam6321 picture sam6321  Â·  3Comments

ChadKillingsworth picture ChadKillingsworth  Â·  5Comments

jart picture jart  Â·  7Comments

shicks picture shicks  Â·  4Comments

zzo picture zzo  Â·  6Comments