Comments (31)
I'd like to be part of this feature. I'll look at the go gitlab api to see how I can add the lacking features
from gitness.
@luxifer thanks, much appreciated!
from gitness.
Hooks https://github.com/gitlabhq/gitlabhq/blob/master/lib/api/project_hooks.rb
Deployment keys for private repos https://github.com/gitlabhq/gitlabhq/blob/master/lib/api/deploy_keys.rb
from gitness.
Thanks for the links ;)
Hooks
https://github.com/gitlabhq/gitlabhq/blob/master/lib/api/project_hooks.rb
Deployment keys for private repos
https://github.com/gitlabhq/gitlabhq/blob/master/lib/api/deploy_keys.rb
—
Reply to this email directly or view it on
GitHubhttps://github.com//issues/53#issuecomment-34811990
.
from gitness.
I think you can look at the appliance gitlab-ci, it use http basic auth for git. GitLab creates special service user for project. May be it easy.
from gitness.
I don't have any experience with programming in Go (coming from an ops background). But I would be happy to test and provide feedback.
from gitness.
Would it be great to create a Host interface which describe each methods needed to add a repo and trigger build and then implement this methods in specific struct for GitHub, GitLab and so on?
from gitness.
@luxifer agreed. take a look at the last few comments in thread #10
from gitness.
I made a PR to the plouc/go-gitlab-client, you can check it out here plouc/go-gitlab-client#2
This on is for deploy keys, i'll made another for adding and removing projetc hooks
from gitness.
Awesome! It looks like it was accepted. I forgot to mention, we'll also need a way to download the .drone.yml
file for a particular commit hash.
from gitness.
Thanks ;) I'm working on it!
from gitness.
Here's the api doc to get a single file for a particular commit/branch https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/repositories.md#raw-file-content
from gitness.
Here's my PR to manage hooks plouc/go-gitlab-client#3
from gitness.
And here's the PR to get single raw file content without having to clone the entire repo plouc/go-gitlab-client#5
from gitness.
any news?
from gitness.
For now I don't have so much time to work on the PR.
Also I would like to have the point of view of the core dev. To go in the right direction
from gitness.
If you want to increase the probability of this happening, vote here: http://feedback.gitlab.com/forums/176466-general/suggestions/5675077-integrate-docker-drone-with-gitlab-ci-runner
from gitness.
@fudanchii expressed interest in working on this as well. @luxifer perhaps you two can work together to expedite the request? I think it is safe to add but would ask that we take the following into account:
Code Structure
Let's try to keep the GitLab code in a single go file, using a struct, similar to how I started writing the Bitbucket code:
https://github.com/drone/drone/blob/bitbucket/pkg/handler/bitbucket.go
Unit Tests
Look at this github branch and how we implement unit tests, and follow that pattern:
https://github.com/bradrydzewski/drone/blob/example-fixture/pkg/handler/testing/github_test.go
Minimize Refactoring
Resist the urge to refactor code. There will be inefficiencies and code duplication. This is OK. We can (and will) refactor as part of a separate pull request. This section of the code will change a lot, so keeping it isolated (no shared code between GitLab, GitHub, Bitbucket, etc) will make it easier to refactor and combine once we've figured out an appropriate plugin design.
The smaller and more isolated the changeset the quicker we can merge the change.
from gitness.
Few updates...
Gitlab only use secret key for API invocation. And this Secret key is tied to user. The secret is similar to access token for OAuth, so the account-linking process is just a matter of filling this secret key.
Also github.com/plouc/go-gitlab-client still missing few features needed to get gitlab integrated:
Project.Public
attribute. This is equal toRepo.Private
for GitHub- Add SSH key for user.
- The project payload from Gitlab includes
ssh_url_to_repo
andhttp_url_to_repo
, github.com/plouc/go-gitlab-client currently doesn't have this properties, but I think this will be very convenient to have.
I'll continue over the weekend.
Thanks
from gitness.
@fudanchii
I made pull request with ssh and http repo urls to go-gitlab-client.
Could You please tell more info about Project.Public attribute?
from gitness.
Pardon me, the Project.Public
is apparently already there :D
Much obliged.
from gitness.
@fudanchii
For keys you need method like user.AddKey("title", "key") ?
from gitness.
There is 2 versions of addkey, user.AddKey(title, key)
which can be invoked if the given private_token is owned by admin account, this version require the user ID , so we have to get user instance first, another version can be used to add key for our current user (the user which tied to the private_token) maybe something like this? gitlab.UserAddKey(title, key)
. I think we may use the latter since we don't want to messing with another user here, and I suppose it's easier to implement?
Again, thank you!
from gitness.
@fudanchii I will make both methods and see whats better.
UPD. Made all api key methods in same pull request. Waiting for merge
from gitness.
@fudanchii it seems like @plouc it now available or looks for pull requests rarely.
You can use my fork of go gitlab client until changes get merged.
from gitness.
@arrowcircle, sorry but I just didn't received any notifications until this comment, I'll take a look at your PR asap. I've (quickly) seen the refactoring you made on tests, it will be easier to add test with stubs !
from gitness.
@arrowcircle @plouc
Just in: fudanchii/go-gitlab-client@d0da2d6
I'm not sure about this approach, any suggestions?
In another note, here's current status on the integration: https://github.com/fudanchii/drone/compare/gitlab?expand=1
Haven't add hook handling yet, I want to make sure I did the right approach for gitlab above.
Another way is to get all list of projects and iterate over it until we find the project we want, but this will get really exhaustive, so I guess it's a no no.
I plan to enable user level key later. The plan is, user can opted to add/generate key pair and add it to the user account at upstream repo host. Then each time drone create project, it will check if user is opted-in for user key, if it's true drone will use this key and wont add deploy key to the repository.
from gitness.
Some updates,
I'm currently working on the merge_request hook handling,
I've added the push hook handling and now waiting for @plouc to review my PR for the hook parsing feature and the raw requests at go-gitlab-client.
I'll open a PR after this.
Thanks!
from gitness.
Hey guys, having this issue with self signed gitlab server :
Private Token is not valid: "Client.Do error: \"Get https:/.../api/v3/user?private_token=HXgFW2XH5zqSfjJDYDyC: x509: certificate signed by unknown authority\""
from gitness.
@luxifer by default self signed certificates disabled, add flag -gitlab.skip-cert-check=true
to /etc/init/drone.conf
from gitness.
@Bugagazavr thx, it works 😉
from gitness.
Related Issues (20)
- Drone use PAT owner account for git commit HOT 1
- Cannot use expression variables in pipeline HOT 2
- feat: is it possible to recreate frontend(web) with nextjs? HOT 1
- The pipelines are unable to function properly when reading secrets. HOT 1
- any plan to release public cloud hosting? HOT 1
- Deploying Code on Different Runners based on Branches in Drone CI/CD HOT 1
- Helm chart missing index file HOT 1
- Opensource Website? HOT 1
- Git HTTPS Protocol - New Branch Creation Rule Not Blocking Push from CLI but Works via UI HOT 2
- Project and repo deletion actually do not delete the db spaces + repos, and do not free disk space HOT 1
- Pipeline Only Mode HOT 1
- Bug: Improve public repositories experience when visited HOT 1
- Feature request: explore tab
- Using drone is a real pain
- Gitness Integration with Open Source Dev Environment Manager. HOT 2
- Gitness Integration support HOT 1
- Gitness Api HOT 3
- Error: Changes blocked by files exceeding the file size limit HOT 2
- using pipelines with Docker-in-Docker samples, Error: mount: permission denied
- Gitness - Unauthenticated Git Pulls HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gitness.