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

Setup travis for snapshot publishing #1744

Closed
wants to merge 1 commit into from

Conversation

2m
Copy link
Contributor

@2m 2m commented Jan 3, 2018

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

resolvers += Resolver.bintrayRepo("akka", "snapshots")

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

@akka-ci akka-ci added validating PR that is currently being validated by Jenkins tested PR that was successfully built and tested by Jenkins and removed validating PR that is currently being validated by Jenkins labels Jan 3, 2018
@akka-ci
Copy link

akka-ci commented Jan 3, 2018

Test PASSed.

import extracted._

if (sys.env.getOrElse("TRAVIS_EVENT_TYPE", "") == "cron") {
runAggregated(ThisBuild / publish, state)
Copy link
Contributor

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?

Copy link
Contributor Author

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(
Copy link
Contributor

@jrudolph jrudolph Jan 4, 2018

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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)
Copy link
Contributor

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?

Copy link
Contributor Author

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?

Copy link
Contributor

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)

@2m
Copy link
Contributor Author

2m commented Jan 7, 2018

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.

@raboof
Copy link
Contributor

raboof commented Feb 20, 2018

This is pending finding a nice way to periodically clean up bintray

@raboof
Copy link
Contributor

raboof commented Apr 3, 2018

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?

@2m
Copy link
Contributor Author

2m commented Apr 3, 2018

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.

@raboof
Copy link
Contributor

raboof commented Apr 3, 2018

Added sbt/sbt-bintray#154

@akka-ci akka-ci added validating PR that is currently being validated by Jenkins needs-attention Indicates a PR validation failure (set by CI infrastructure) and removed tested PR that was successfully built and tested by Jenkins validating PR that is currently being validated by Jenkins labels Apr 9, 2018
@akka-ci
Copy link

akka-ci commented Apr 9, 2018

Test FAILed.

Copy link
Contributor

@raboof raboof left a 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)
Copy link
Contributor

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

@2m
Copy link
Contributor Author

2m commented Jan 3, 2019

Superseded by #2365

@2m 2m closed this Jan 3, 2019
@2m 2m deleted the wip-travis-to-sbt-no-append-2m branch January 3, 2019 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-attention Indicates a PR validation failure (set by CI infrastructure)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Publish nightly snapshots
5 participants