mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-10-22 04:06:54 +00:00
Merge pull request #75 from floatdrop/github-enterprise-support
GitHub Enterprise Support
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
package migrate
|
||||
|
||||
type Rev3 struct{}
|
||||
|
||||
var GitHubEnterpriseSupport = &Rev3{}
|
||||
|
||||
func (r *Rev3) Revision() int64 {
|
||||
return 201402211147
|
||||
}
|
||||
|
||||
func (r *Rev3) Up(op Operation) error {
|
||||
_, err := op.AddColumn("settings", "github_domain VARCHAR(255)")
|
||||
if err {
|
||||
return err
|
||||
}
|
||||
_, err = op.AddColumn("settings", "github_apiurl VARCHAR(255)")
|
||||
return err
|
||||
}
|
||||
|
||||
func (r *Rev3) Down(op Operation) error {
|
||||
_, err := op.DropColumns("settings", []string{"github_domain", "github_apiurl"})
|
||||
return err
|
||||
}
|
@@ -49,7 +49,7 @@ insert into builds values (9, 3, 'node_0.80', 'Success', '2013-09-16 00:00:00','
|
||||
|
||||
-- insert default, dummy settings
|
||||
|
||||
insert into settings values (1,'','','','','','','','','','localhost:8080','http', 0);
|
||||
insert into settings values (1,'','','github.com','https://api.github.com','','','','','','','','localhost:8080','http',0);
|
||||
|
||||
-- add public & private keys to all repositories
|
||||
|
||||
@@ -123,4 +123,4 @@ Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 10.849 sec
|
||||
|
||||
Results :
|
||||
|
||||
Tests run: 7, Failures: 0, Errors: 0, Skipped: 0';
|
||||
Tests run: 7, Failures: 0, Errors: 0, Skipped: 0';
|
||||
|
@@ -118,6 +118,8 @@ CREATE TABLE settings (
|
||||
id INTEGER PRIMARY KEY
|
||||
,github_key VARCHAR(255)
|
||||
,github_secret VARCHAR(255)
|
||||
,github_domain VARCHAR(255)
|
||||
,github_apiurl VARCHAR(255)
|
||||
,bitbucket_key VARCHAR(255)
|
||||
,bitbucket_secret VARCHAR(255)
|
||||
,smtp_server VARCHAR(1024)
|
||||
|
@@ -103,6 +103,8 @@ CREATE TABLE settings (
|
||||
id INTEGER PRIMARY KEY
|
||||
,github_key VARCHAR(255)
|
||||
,github_secret VARCHAR(255)
|
||||
,github_domain VARCHAR(255)
|
||||
,github_apiurl VARCHAR(255)
|
||||
,bitbucket_key VARCHAR(255)
|
||||
,bitbucket_secret VARCHAR(255)
|
||||
,smtp_server VARCHAR(1024)
|
||||
|
@@ -10,7 +10,7 @@ const settingsTable = "settings"
|
||||
|
||||
// SQL Queries to retrieve the system settings
|
||||
const settingsStmt = `
|
||||
SELECT id, github_key, github_secret, bitbucket_key, bitbucket_secret,
|
||||
SELECT id, github_key, github_secret, github_domain, github_apiurl, bitbucket_key, bitbucket_secret,
|
||||
smtp_server, smtp_port, smtp_address, smtp_username, smtp_password, hostname, scheme, open_invitations
|
||||
FROM settings WHERE id = 1
|
||||
`
|
||||
|
Reference in New Issue
Block a user