mirror of
https://github.com/gitpitch/gitpitch.git
synced 2024-04-18 07:30:55 +08:00
Add GitBucket support. (#81)
GitBucket GRS support contributed by @kounoike.
This commit is contained in:
parent
f4df162a31
commit
71ada9ab7b
|
@ -6,7 +6,7 @@
|
|||
<br>
|
||||
<span style="color:gray">on</span>
|
||||
<br>
|
||||
<span style="color:gray">GitHub, GitLab, Bitbucket, Gitea, and Gogs</span>
|
||||
<span style="color:gray">GitHub, GitLab, Bitbucket, Gitea, Gogs, and GitBucket</span>
|
||||
|
||||
---
|
||||
|
||||
|
@ -35,7 +35,7 @@ Create GitPitch slideshow content using GitHub flavored Markdown in your favorit
|
|||
|
||||
![TERMINAL](https://d1z75bzl1vljy2.cloudfront.net/hello-world/terminal.png)
|
||||
|
||||
Git-commit on any branch and push your PITCHME.md to GitHub, GitLab, Bitbucket, Gitea, or Gogs.
|
||||
Git-commit on any branch and push your PITCHME.md to GitHub, GitLab, Bitbucket, Gitea, Gogs, or GitBucket.
|
||||
|
||||
---
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[![GitPitch](https://gitpitch.com/assets/badge.svg)](https://gitpitch.com/gitpitch/gitpitch/master) [![Build Status](https://semaphoreci.com/api/v1/onetapbeyond/gitpitch/branches/master/shields_badge.svg)](https://semaphoreci.com/onetapbeyond/gitpitch)
|
||||
|
||||
# Markdown Presentations For Everyone on GitHub, GitLab, Bitbucket, Gitea, and Gogs
|
||||
# Markdown Presentations For Everyone on GitHub, GitLab, Bitbucket, Gitea, Gogs, and GitBucket
|
||||
|
||||
#### WEBSITE: [www.gitpitch.com](https://gitpitch.com) | HOW-TO : [GitPitch Wiki](https://github.com/gitpitch/gitpitch/wiki) | TWITTER: [@gitpitch](https://twitter.com/gitpitch)
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
|||
|
||||
GitPitch is a service that turns **[PITCHME.md](https://gitpitch.com/#gitpitch-pitchme-markdown)** markdown into online and offline, interactive slideshows. You can use it to promote, pitch or present anything from designs and best practices, to code snippets and complete frameworks.
|
||||
|
||||
Each slideshow presentation is made instantly available online just as soon as you git-commit and push **PITCHME.md** on any branch within a public [GitHub, GitLab, Bitbucket, Gitea, or Gogs](https://github.com/gitpitch/gitpitch/wiki/Git-Repo-Services) repo.
|
||||
Each slideshow presentation is made instantly available online just as soon as you git-commit and push **PITCHME.md** on any branch within a public [GitHub, GitLab, Bitbucket, Gitea, Gogs, or GitBucket](https://github.com/gitpitch/gitpitch/wiki/Git-Repo-Services) repo.
|
||||
|
||||
![URL](images/gp-url.jpg)
|
||||
|
||||
|
@ -38,11 +38,11 @@ Then GitPitch is for you. Simply capture your ideas in Markdown and let GitPitch
|
|||
|
||||
## How does GitPitch work?
|
||||
|
||||
GitPitch presentations are powered by the amazing [reveal.js](https://github.com/hakimel/reveal.js) presentation framework. But with GitPitch there is nothing to download. All you need is your favorite text editor. And an account on GitHub, GitLab, Bitbucket, Gitea, or Gogs.
|
||||
GitPitch presentations are powered by the amazing [reveal.js](https://github.com/hakimel/reveal.js) presentation framework. But with GitPitch there is nothing to download. All you need is your favorite text editor. And an account on GitHub, GitLab, or Bitbucket. Or your instance of GitHub Enterprise, Gitea, Gogs, or GitBucket.
|
||||
|
||||
![TERMINAL](images/gp-terminal.png)
|
||||
|
||||
No more Keynote. No more PowerPoint. Just Markdown. Then git-commit on any branch within a public GitHub, GitLab, Bitbucket, Gitea, or Gogs repo.
|
||||
No more Keynote. No more PowerPoint. Just Markdown. Then git-commit on any branch within a public GitHub, GitLab, Bitbucket, or a private Gitea, Gogs, GitBucket repo.
|
||||
|
||||
## GitPitch slideshow presentations are compelling
|
||||
|
||||
|
|
|
@ -61,6 +61,7 @@ public class Module extends AbstractModule {
|
|||
bind(BitBucket.class).asEagerSingleton();
|
||||
bind(Gitea.class).asEagerSingleton();
|
||||
bind(Gogs.class).asEagerSingleton();
|
||||
bind(GitBucket.class).asEagerSingleton();
|
||||
bind(FrontEndThreads.class).asEagerSingleton();
|
||||
bind(BackEndThreads.class).asEagerSingleton();
|
||||
bind(Dependencies.class).asEagerSingleton();
|
||||
|
|
|
@ -50,6 +50,7 @@ public class GRSManager {
|
|||
private final BitBucket bitBucketService;
|
||||
private final Gitea giteaService;
|
||||
private final Gogs gogsService;
|
||||
private final GitBucket gitBucketService;
|
||||
private final Configuration cfg;
|
||||
private final Map<String,GRS> grsStore = new HashMap<String,GRS>();
|
||||
private GRS grsDefault;
|
||||
|
@ -61,6 +62,7 @@ public class GRSManager {
|
|||
BitBucket bitBucketService,
|
||||
Gitea giteaService,
|
||||
Gogs gogsService,
|
||||
GitBucket gitBucketService,
|
||||
Configuration cfg) {
|
||||
|
||||
this.diskService = diskService;
|
||||
|
@ -80,6 +82,9 @@ public class GRSManager {
|
|||
this.gogsService = gogsService;
|
||||
this.gogsService.init(this, diskService);
|
||||
|
||||
this.gitBucketService = gitBucketService;
|
||||
this.gitBucketService.init(this, diskService);
|
||||
|
||||
this.cfg = cfg;
|
||||
|
||||
List grsCfg = cfg.getList("gitpitch.git.repo.services");
|
||||
|
@ -158,6 +163,10 @@ public class GRSManager {
|
|||
log.debug("getService: matching Gogs");
|
||||
service = gogsService;
|
||||
break;
|
||||
case GitBucket.TYPE:
|
||||
log.debug("getService: matching GitBucket");
|
||||
service = gitBucketService;
|
||||
break;
|
||||
default:
|
||||
log.debug("getService: defaulting GitHub");
|
||||
service = gitHubService;
|
||||
|
|
60
app/com/gitpitch/git/vendors/GitBucket.java
vendored
Normal file
60
app/com/gitpitch/git/vendors/GitBucket.java
vendored
Normal file
|
@ -0,0 +1,60 @@
|
|||
/*
|
||||
* MIT License
|
||||
*
|
||||
* Copyright (c) 2016 David Russell
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package com.gitpitch.git.vendors;
|
||||
|
||||
import com.gitpitch.git.GRS;
|
||||
import com.gitpitch.utils.PitchParams;
|
||||
import play.Logger;
|
||||
import play.Logger.ALogger;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
|
||||
/*
|
||||
* GitBucket API Service.
|
||||
*/
|
||||
@Singleton
|
||||
public class GitBucket extends GitHub {
|
||||
|
||||
private final ALogger log = Logger.of(this.getClass());
|
||||
|
||||
public String raw(PitchParams pp) {
|
||||
|
||||
GRS grs = grsManager.get(pp);
|
||||
|
||||
return new StringBuffer(grs.getApiBase())
|
||||
.append(GITBUCKET_REPOS_API)
|
||||
.append(pp.user)
|
||||
.append(SLASH)
|
||||
.append(pp.repo)
|
||||
.append(SLASH)
|
||||
.append(GITBUCKET_RAW_API)
|
||||
.append(pp.branch)
|
||||
.append(SLASH)
|
||||
.toString();
|
||||
}
|
||||
|
||||
public static final String TYPE = "gitbucket";
|
||||
private static final String GITBUCKET_REPOS_API = "repos/";
|
||||
private static final String GITBUCKET_RAW_API = "raw/";
|
||||
}
|
|
@ -64,8 +64,8 @@
|
|||
<i class="fa fa-bitbucket" aria-hidden="true"
|
||||
style="font-size:0.9em; color: @ssm.fetchThemeFontColorInverse()"></i>
|
||||
}
|
||||
@if(ssm.params().grs.equals("gitea") ||
|
||||
ssm.params().grs.equals("gogs")) {
|
||||
@if(ssm.params().grs.equals("gitea") || ssm.params().grs.equals("gogs") ||
|
||||
ssm.params().grs.equals("gitbucket")) {
|
||||
<i class="fa fa-git-square" aria-hidden="true"
|
||||
style="font-size:0.9em; color: @ssm.fetchThemeFontColorInverse()"></i>
|
||||
}
|
||||
|
|
|
@ -66,8 +66,8 @@
|
|||
@if(rndr.params().grs.equals("bitbucket")) {
|
||||
<span class="fa fa-bitbucket" aria-hidden="true" style="font-size:1.4em"></span>
|
||||
}
|
||||
@if(rndr.params().grs.equals("gitea") ||
|
||||
rndr.params().grs.equals("gogs")) {
|
||||
@if(rndr.params().grs.equals("gitea") || rndr.params().grs.equals("gogs") ||
|
||||
rndr.params.grs.equals("gitbucket")) {
|
||||
<span class="fa fa-git-square" aria-hidden="true" style="font-size:1.4em"></span>
|
||||
}
|
||||
</a></li>
|
||||
|
|
|
@ -476,6 +476,16 @@ gitpitch {
|
|||
rawbase = "https://try.gogs.io/"
|
||||
default = "false"
|
||||
}
|
||||
{
|
||||
name = "GitBucket"
|
||||
type = "gitbucket"
|
||||
site = "http://localhost:8080/"
|
||||
apibase = "http://localhost:8080/api/v3/"
|
||||
// apitoken = "token your-gitbucket-access-token-here"
|
||||
apitokenheader = "Authorization"
|
||||
rawbase = "http://localhost:8080/"
|
||||
default = "false"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user