-
Notifications
You must be signed in to change notification settings - Fork 596
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
Setup travis for snapshot publishing #1744
Conversation
Test PASSed. |
import extracted._ | ||
|
||
if (sys.env.getOrElse("TRAVIS_EVENT_TYPE", "") == "cron") { | ||
runAggregated(ThisBuild / publish, state) |
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.
Very nice. Does this do the same as +publish
?
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.
runAggregated
runs across all subprojects. The cross +
is still in the .travis.yml
as +publishCi
.
@@ -0,0 +1,32 @@ | |||
commands ++= Seq( |
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.
Why a command and not a task? Wouldn't a task be easier to use and maintain?
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.
At first, I had state changes in both of the commands (adding credentials and changing repo name), therefore I went with a command. Now only the first command does that, therefore the second could be a task. However, having conditional statements would require it to be a DynTask. So I stuck with commands.
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.
What's wrong with dyntask?
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.
Nothing in particular. It would work for the publishCi
but not for the whitesourceCi
which changes the state.
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.
But why does it need to update the state? Why not just add the credentials anyway?
runTask(whitesourceCheckPolicies, stateWithCredentials) | ||
|
||
if (sys.env.getOrElse("TRAVIS_BRANCH", "") == "master" && sys.env.getOrElse("TRAVIS_EVENT_TYPE", "") == "push") { | ||
runTask(whitesourceUpdate, stateWithCredentials) |
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.
Shouldn't that run only on releases?
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.
I am not sure what the policy is. @raboof?
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.
on non-release builds on Master it updates the akka-http-master
project (https://saas.whitesourcesoftware.com/Wss/WSS.html#!project;id=174062)
With the hint from sbt/sbt#3850 I was able to make it work without the system property: https://github.com/2m/akka-http/commits/wip-travis-to-sbt-2m It is cleaner in once sense but uses another not-really-documented SBT api. |
This is pending finding a nice way to periodically clean up bintray |
I guess we could make a script that gets the versions from bintray (https://bintray.com/docs/api/#_get_package), looks at the version naming numbers to see which are 'old' snapshots and deletes (https://bintray.com/docs/api/#url_delete_version) those? |
I would like to have deletion added to sbt-bintray plugin, so it is not an ad-hoc solution. But the logic would be pretty much like the one you described. |
Added sbt/sbt-bintray#154 |
Test FAILed. |
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.
Now that travis has introduced stages, I think that would be a neater solution compared to the new sbt tasks
|
||
if (sys.env.getOrElse("TRAVIS_SECURE_ENV_VARS", "") == "true") { | ||
val stateWithCredentials = | ||
append(credentials += Credentials("whitesource", "whitesourcesoftware.com", "", System.getenv("WHITESOURCE_KEY")), state) |
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.
I think this is no longer needed since lightbend/sbt-whitesource#29
Superseded by #2365 |
We will need to set up a cron job on the master branch to start publishing snapshots. The artifacts will end up here or under a different view here.
They will be possible to be consumed by users by adding
to the build.
I also cleaned up
.travis.yml
a bit and moved the nested bash conditional logic to a separete sbt command for whitesource.If this looks good for an approach, I will ammend documentation.
Fixes #1254