google / closure-compiler

A JavaScript checker and optimizer.
https://developers.google.com/closure/compiler/
Apache License 2.0
7.35k stars 1.14k forks source link

Publish nightly build to maven snapshot #1689

Closed alexeagle closed 7 years ago

alexeagle commented 8 years ago

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

alexeagle commented 8 years ago

cc @rkirov

concavelenz commented 8 years ago

Can't you use "top of tree"?

alexeagle commented 8 years ago

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 notifications@github.com 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

concavelenz commented 8 years ago

Yes, that is what I meant.

kylecordes commented 7 years ago

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.)

ChadKillingsworth commented 7 years ago

I think we should have travis auto publish the latest snapshot

brad4d commented 7 years ago

@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?

ChadKillingsworth commented 7 years ago

Here's a good article: https://coderwall.com/p/9b_lfq/deploying-maven-artifacts-from-travis

ChadKillingsworth commented 7 years ago

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

brad4d commented 7 years ago

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.

MatrixFrog commented 7 years ago

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.

MatrixFrog commented 7 years ago

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.

MatrixFrog commented 7 years ago

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]

brad4d commented 7 years ago

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
brad4d commented 7 years ago

Yep, that worked.

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

brad4d commented 7 years ago

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.

brad4d commented 7 years ago

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.

brad4d commented 7 years ago

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.

brad4d commented 7 years ago

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

brad4d commented 7 years ago

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.

alexeagle commented 7 years ago

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

alexeagle commented 7 years ago

and thanks!!

brad4d commented 7 years ago

@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.

MatrixFrog commented 7 years ago

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.

rkirov commented 7 years ago

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