mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-26 11:51:02 +00:00
How to generate sql files
This commit is contained in:
parent
3fe710bbe4
commit
9504b00a40
2 changed files with 50 additions and 53 deletions
17
BUILDING
17
BUILDING
|
@ -10,3 +10,20 @@
|
||||||
|
|
||||||
go install github.com/laszlocph/drone-oss-08/cmd/drone-agent
|
go install github.com/laszlocph/drone-oss-08/cmd/drone-agent
|
||||||
go install github.com/laszlocph/drone-oss-08/cmd/drone-server
|
go install github.com/laszlocph/drone-oss-08/cmd/drone-server
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
0. To generate SQL files
|
||||||
|
|
||||||
|
go get github.com/vektra/mockery/.../
|
||||||
|
|
||||||
|
export download_url=$(curl -s https://api.github.com/repos/go-swagger/go-swagger/releases/latest | \
|
||||||
|
jq -r '.assets[] | select(.name | contains("'"$(uname | tr '[:upper:]' '[:lower:]')"'_amd64")) | .browser_download_url')
|
||||||
|
curl -o swagger -L'#' "$download_url"
|
||||||
|
chmod +x swagger
|
||||||
|
sudo mv swagger /usr/local/bin
|
||||||
|
|
||||||
|
go get github.com/laszlocph/togo
|
||||||
|
|
||||||
|
go generate
|
||||||
|
|
||||||
|
|
|
@ -1,27 +1,11 @@
|
||||||
// Copyright 2018 Drone.IO Inc.
|
// Code generated by mockery v1.0.0. DO NOT EDIT.
|
||||||
//
|
|
||||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
// you may not use this file except in compliance with the License.
|
|
||||||
// You may obtain a copy of the License at
|
|
||||||
//
|
|
||||||
// http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
//
|
|
||||||
// Unless required by applicable law or agreed to in writing, software
|
|
||||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
// See the License for the specific language governing permissions and
|
|
||||||
// limitations under the License.
|
|
||||||
|
|
||||||
package mock
|
package mocks
|
||||||
|
|
||||||
import (
|
import http "net/http"
|
||||||
"fmt"
|
import mock "github.com/stretchr/testify/mock"
|
||||||
"net/http"
|
import model "github.com/laszlocph/drone-oss-08/model"
|
||||||
|
import remote "github.com/laszlocph/drone-oss-08/remote"
|
||||||
"github.com/laszlocph/drone-oss-08/model"
|
|
||||||
"github.com/laszlocph/drone-oss-08/remote"
|
|
||||||
"github.com/stretchr/testify/mock"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Remote is an autogenerated mock type for the Remote type
|
// Remote is an autogenerated mock type for the Remote type
|
||||||
type Remote struct {
|
type Remote struct {
|
||||||
|
@ -77,6 +61,29 @@ func (_m *Remote) Deactivate(u *model.User, r *model.Repo, link string) error {
|
||||||
return r0
|
return r0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Dir provides a mock function with given fields: u, r, b, f
|
||||||
|
func (_m *Remote) Dir(u *model.User, r *model.Repo, b *model.Build, f string) ([]*remote.FileMeta, error) {
|
||||||
|
ret := _m.Called(u, r, b, f)
|
||||||
|
|
||||||
|
var r0 []*remote.FileMeta
|
||||||
|
if rf, ok := ret.Get(0).(func(*model.User, *model.Repo, *model.Build, string) []*remote.FileMeta); ok {
|
||||||
|
r0 = rf(u, r, b, f)
|
||||||
|
} else {
|
||||||
|
if ret.Get(0) != nil {
|
||||||
|
r0 = ret.Get(0).([]*remote.FileMeta)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var r1 error
|
||||||
|
if rf, ok := ret.Get(1).(func(*model.User, *model.Repo, *model.Build, string) error); ok {
|
||||||
|
r1 = rf(u, r, b, f)
|
||||||
|
} else {
|
||||||
|
r1 = ret.Error(1)
|
||||||
|
}
|
||||||
|
|
||||||
|
return r0, r1
|
||||||
|
}
|
||||||
|
|
||||||
// File provides a mock function with given fields: u, r, b, f
|
// File provides a mock function with given fields: u, r, b, f
|
||||||
func (_m *Remote) File(u *model.User, r *model.Repo, b *model.Build, f string) ([]byte, error) {
|
func (_m *Remote) File(u *model.User, r *model.Repo, b *model.Build, f string) ([]byte, error) {
|
||||||
ret := _m.Called(u, r, b, f)
|
ret := _m.Called(u, r, b, f)
|
||||||
|
@ -100,10 +107,6 @@ func (_m *Remote) File(u *model.User, r *model.Repo, b *model.Build, f string) (
|
||||||
return r0, r1
|
return r0, r1
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Remote) Dir(u *model.User, r *model.Repo, b *model.Build, f string) ([]*remote.FileMeta, error) {
|
|
||||||
return nil, fmt.Errorf("Not implemented")
|
|
||||||
}
|
|
||||||
|
|
||||||
// Hook provides a mock function with given fields: r
|
// Hook provides a mock function with given fields: r
|
||||||
func (_m *Remote) Hook(r *http.Request) (*model.Repo, *model.Build, error) {
|
func (_m *Remote) Hook(r *http.Request) (*model.Repo, *model.Build, error) {
|
||||||
ret := _m.Called(r)
|
ret := _m.Called(r)
|
||||||
|
@ -229,15 +232,15 @@ func (_m *Remote) Repo(u *model.User, owner string, repo string) (*model.Repo, e
|
||||||
}
|
}
|
||||||
|
|
||||||
// Repos provides a mock function with given fields: u
|
// Repos provides a mock function with given fields: u
|
||||||
func (_m *Remote) Repos(u *model.User) ([]*model.RepoLite, error) {
|
func (_m *Remote) Repos(u *model.User) ([]*model.Repo, error) {
|
||||||
ret := _m.Called(u)
|
ret := _m.Called(u)
|
||||||
|
|
||||||
var r0 []*model.RepoLite
|
var r0 []*model.Repo
|
||||||
if rf, ok := ret.Get(0).(func(*model.User) []*model.RepoLite); ok {
|
if rf, ok := ret.Get(0).(func(*model.User) []*model.Repo); ok {
|
||||||
r0 = rf(u)
|
r0 = rf(u)
|
||||||
} else {
|
} else {
|
||||||
if ret.Get(0) != nil {
|
if ret.Get(0) != nil {
|
||||||
r0 = ret.Get(0).([]*model.RepoLite)
|
r0 = ret.Get(0).([]*model.Repo)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -265,29 +268,6 @@ func (_m *Remote) Status(u *model.User, r *model.Repo, b *model.Build, link stri
|
||||||
return r0
|
return r0
|
||||||
}
|
}
|
||||||
|
|
||||||
// TeamPerm provides a mock function with given fields: u, org
|
|
||||||
func (_m *Remote) TeamPerm(u *model.User, org string) (*model.Perm, error) {
|
|
||||||
ret := _m.Called(u, org)
|
|
||||||
|
|
||||||
var r0 *model.Perm
|
|
||||||
if rf, ok := ret.Get(0).(func(*model.User, string) *model.Perm); ok {
|
|
||||||
r0 = rf(u, org)
|
|
||||||
} else {
|
|
||||||
if ret.Get(0) != nil {
|
|
||||||
r0 = ret.Get(0).(*model.Perm)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var r1 error
|
|
||||||
if rf, ok := ret.Get(1).(func(*model.User, string) error); ok {
|
|
||||||
r1 = rf(u, org)
|
|
||||||
} else {
|
|
||||||
r1 = ret.Error(1)
|
|
||||||
}
|
|
||||||
|
|
||||||
return r0, r1
|
|
||||||
}
|
|
||||||
|
|
||||||
// Teams provides a mock function with given fields: u
|
// Teams provides a mock function with given fields: u
|
||||||
func (_m *Remote) Teams(u *model.User) ([]*model.Team, error) {
|
func (_m *Remote) Teams(u *model.User) ([]*model.Team, error) {
|
||||||
ret := _m.Called(u)
|
ret := _m.Called(u)
|
||||||
|
|
Loading…
Reference in a new issue