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

[WIP] publishing to scaladex using sbt publish #176

Merged
merged 27 commits into from
Jul 13, 2016

Conversation

Scyks
Copy link
Contributor

@Scyks Scyks commented Jul 9, 2016

  • implementing receiving data from bt publish task
  • verify credentials to github
  • only accept pom file
  • write pom file
  • update index

Todos:

  • verify write access to this repo
  • check for ovverrides
  • cleanup
  • documentation
  • rebase to elastic restructuring
  • scripted test
  • publish plugin to sbt community
  • complete documentation after decision of don't trust scmInfo (Forked repositories) #178

Sbt config

scaladexKeywords in Scaladex := Seq("foo", "bar", "acl")
scaladexDownloadContributors in Scaladex := false
scaladexDownloadInfo in Scaladex := false
scaladexDownloadReadme in Scaladex := false
Credentials in Scaladex := Credentials(Path.userHome / ".ivy2" / ".scaladex.credentials")

@@ -74,7 +74,8 @@ class ApiImplementation(github: Github, userState: Option[UserState])(implicit v
)
)
).limit(1)
}.map(r => r.as[Project].headOption.map(hideId))
// }.map(r => r.as[Project].headOption.map(hideId))
}.map ( r => r.as[Project].headOption)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MasseGuillaume Maybe this will lead to some problems. I guess indexing all data

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about it ?

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 guess it was there for a reason.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep the id was for updating (ProjectDelta)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, then i'll fix that :)

@Scyks Scyks mentioned this pull request Jul 9, 2016
@MasseGuillaume
Copy link
Contributor

really cool!

If I understand well, it's to receive pom from sbt via http and fetch all info to index.

On this branch I remove the link between projects and release:
https://github.com/scalacenter/scaladex/tree/feature/no-artifacts

Therefore adding a new release will be pretty easy :-)

@Scyks
Copy link
Contributor Author

Scyks commented Jul 9, 2016

Can i already rebase to no-artifactsbranch?

@MasseGuillaume
Copy link
Contributor

@Scyks almost, if it's too much work I can do it for you.


object autoImport {

lazy val scaladex = TaskKey[Unit]("scaladex-publish", "Publishes to scaladex")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should create a scaladex scope and reuse the publish task

MasseGuillaume and others added 11 commits July 11, 2016 20:59
- implementing receiving data from bt publish task
- verify credentials to github
- only accept pom file
- write pom file
- update index

Todos:
- [ ] verify write access to this repo
- [ ] check for ovverrides
- [ ] cleanup
- [ ] rebase to elastic restructuring
The url schema is changed to provide some settings for scaldex
- download readme
- download info
- download contributors
- keywords

Lookup a release by mavenReference
- refactoring of `PublishProcess` to ensure the user
have write access to the repo.
- Check the write access
- check for publish settings
- update project keywords
@@ -22,13 +22,15 @@ object ScaladexPlugin extends AutoPlugin {
lazy val scaladexDownloadReadme = settingKey[Boolean]("defines if scaladex should download the readme file from the defined scm tag")
lazy val scaladexDownloadInfo = settingKey[Boolean]("defines if scaladex should download the project info from the defined scm tag")
lazy val scaladexDownloadContributors = settingKey[Boolean]("defines if scaladex should download the contributors from the defined scm tag")
lazy val scaladexBaseUrl = settingKey[String]("scaladex server location and path")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, i wanted to add that also 👍


## How to run:
## Hot to publish on scaladex
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@heathermiller @MasseGuillaume Could one of you maybe check the description of errors / miss understanding / mistakes.

@Scyks Scyks changed the title [WIP] test for publishing to scaladex using sbt publish [WIP] publishing to scaladex using sbt publish Jul 12, 2016
import play.api.libs.ws.ahc.AhcWSClient

import scala.util._
import java.nio.charset.StandardCharsets
import java.nio.file.{Files, Path}

class GithubDownload(implicit val system: ActorSystem, implicit val materializer: ActorMaterializer) extends PlayWsDownloader {
class GithubDownload(privateCredentials: Option[GithubCredentials], implicit val system: ActorSystem, implicit val materializer: ActorMaterializer) extends PlayWsDownloader {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

split in two

class GithubDownload(privateCredentials: Option[GithubCredentials])(implicit val system: ActorSystem, implicit val materializer: ActorMaterializer) extends PlayWsDownloader {

@MasseGuillaume MasseGuillaume merged commit 04df102 into master Jul 13, 2016
@Scyks Scyks deleted the publish-to-scaladex branch July 13, 2016 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants