mirror of
https://github.com/harness/drone.git
synced 2025-05-12 06:59:54 +08:00
enable deploy events
This commit is contained in:
parent
bdad69cf3f
commit
db7f0cdffb
@ -22,6 +22,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/drone/drone/core"
|
"github.com/drone/drone/core"
|
||||||
"github.com/drone/go-scm/scm"
|
"github.com/drone/go-scm/scm"
|
||||||
@ -317,7 +318,50 @@ func (p *parser) Parse(req *http.Request, secretFunc func(string) string) (*core
|
|||||||
SSHURL: v.Repo.CloneSSH,
|
SSHURL: v.Repo.CloneSSH,
|
||||||
}
|
}
|
||||||
return hook, repo, nil
|
return hook, repo, nil
|
||||||
|
case *scm.DeployHook:
|
||||||
|
hook = &core.Hook{
|
||||||
|
Trigger: core.TriggerHook,
|
||||||
|
Event: core.EventPromote,
|
||||||
|
Link: v.TargetURL,
|
||||||
|
Timestamp: time.Now().Unix(),
|
||||||
|
Message: v.Desc,
|
||||||
|
After: v.Ref.Sha,
|
||||||
|
Ref: v.Ref.Path,
|
||||||
|
Source: v.Ref.Name,
|
||||||
|
Target: v.Ref.Name,
|
||||||
|
Author: v.Sender.Login,
|
||||||
|
AuthorName: v.Sender.Name,
|
||||||
|
AuthorEmail: v.Sender.Email,
|
||||||
|
AuthorAvatar: v.Sender.Avatar,
|
||||||
|
Sender: v.Sender.Login,
|
||||||
|
Deployment: v.Target,
|
||||||
|
Params: toMap(v.Data),
|
||||||
|
}
|
||||||
|
repo = &core.Repository{
|
||||||
|
UID: v.Repo.ID,
|
||||||
|
Namespace: v.Repo.Namespace,
|
||||||
|
Name: v.Repo.Name,
|
||||||
|
Slug: scm.Join(v.Repo.Namespace, v.Repo.Name),
|
||||||
|
Link: v.Repo.Link,
|
||||||
|
Branch: v.Repo.Branch,
|
||||||
|
Private: v.Repo.Private,
|
||||||
|
HTTPURL: v.Repo.Clone,
|
||||||
|
SSHURL: v.Repo.CloneSSH,
|
||||||
|
}
|
||||||
|
return hook, repo, nil
|
||||||
default:
|
default:
|
||||||
return nil, nil, nil
|
return nil, nil, nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func toMap(src interface{}) map[string]string {
|
||||||
|
set, ok := src.(map[string]interface{})
|
||||||
|
if !ok {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
dst := map[string]string{}
|
||||||
|
for k, v := range set {
|
||||||
|
dst[k] = fmt.Sprint(v)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
@ -1,6 +1,17 @@
|
|||||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
// Copyright 2019 Drone IO, Inc.
|
||||||
// Use of this source code is governed by the Drone Non-Commercial License
|
// Copyright 2016 The Linux Foundation
|
||||||
// that can be found in the LICENSE file.
|
//
|
||||||
|
// 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 batch
|
package batch
|
||||||
|
|
||||||
@ -9,9 +20,9 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/drone/drone/store/shared/db"
|
|
||||||
"github.com/drone/drone/core"
|
"github.com/drone/drone/core"
|
||||||
"github.com/drone/drone/store/repos"
|
"github.com/drone/drone/store/repos"
|
||||||
|
"github.com/drone/drone/store/shared/db"
|
||||||
)
|
)
|
||||||
|
|
||||||
// New returns a new Batcher.
|
// New returns a new Batcher.
|
||||||
|
@ -1,14 +1,25 @@
|
|||||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
// Copyright 2019 Drone IO, Inc.
|
||||||
// Use of this source code is governed by the Drone Non-Commercial License
|
// Copyright 2016 The Linux Foundation
|
||||||
// that can be found in the LICENSE file.
|
//
|
||||||
|
// 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 build
|
package build
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/drone/drone/store/shared/db"
|
|
||||||
"github.com/drone/drone/core"
|
"github.com/drone/drone/core"
|
||||||
|
"github.com/drone/drone/store/shared/db"
|
||||||
)
|
)
|
||||||
|
|
||||||
// New returns a new Buildcore.
|
// New returns a new Buildcore.
|
||||||
|
@ -1,6 +1,17 @@
|
|||||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
// Copyright 2019 Drone IO, Inc.
|
||||||
// Use of this source code is governed by the Drone Non-Commercial License
|
// Copyright 2016 The Linux Foundation
|
||||||
// that can be found in the LICENSE file.
|
//
|
||||||
|
// 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 build
|
package build
|
||||||
|
|
||||||
@ -8,8 +19,8 @@ import (
|
|||||||
"database/sql"
|
"database/sql"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
|
||||||
"github.com/drone/drone/store/shared/db"
|
|
||||||
"github.com/drone/drone/core"
|
"github.com/drone/drone/core"
|
||||||
|
"github.com/drone/drone/store/shared/db"
|
||||||
|
|
||||||
"github.com/jmoiron/sqlx/types"
|
"github.com/jmoiron/sqlx/types"
|
||||||
)
|
)
|
||||||
|
@ -1,6 +1,17 @@
|
|||||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
// Copyright 2019 Drone IO, Inc.
|
||||||
// Use of this source code is governed by the Drone Non-Commercial License
|
// Copyright 2016 The Linux Foundation
|
||||||
// that can be found in the LICENSE file.
|
//
|
||||||
|
// 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 logs
|
package logs
|
||||||
|
|
||||||
@ -10,8 +21,8 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
|
|
||||||
"github.com/drone/drone/store/shared/db"
|
|
||||||
"github.com/drone/drone/core"
|
"github.com/drone/drone/core"
|
||||||
|
"github.com/drone/drone/store/shared/db"
|
||||||
)
|
)
|
||||||
|
|
||||||
// New returns a new LogStore.
|
// New returns a new LogStore.
|
||||||
|
@ -1,6 +1,17 @@
|
|||||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
// Copyright 2019 Drone IO, Inc.
|
||||||
// Use of this source code is governed by the Drone Non-Commercial License
|
// Copyright 2016 The Linux Foundation
|
||||||
// that can be found in the LICENSE file.
|
//
|
||||||
|
// 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 logs
|
package logs
|
||||||
|
|
||||||
|
@ -1,14 +1,25 @@
|
|||||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
// Copyright 2019 Drone IO, Inc.
|
||||||
// Use of this source code is governed by the Drone Non-Commercial License
|
// Copyright 2016 The Linux Foundation
|
||||||
// that can be found in the LICENSE file.
|
//
|
||||||
|
// 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 perm
|
package perm
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/drone/drone/store/shared/db"
|
|
||||||
"github.com/drone/drone/core"
|
"github.com/drone/drone/core"
|
||||||
|
"github.com/drone/drone/store/shared/db"
|
||||||
)
|
)
|
||||||
|
|
||||||
// New returns a new PermStore.
|
// New returns a new PermStore.
|
||||||
|
@ -1,14 +1,25 @@
|
|||||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
// Copyright 2019 Drone IO, Inc.
|
||||||
// Use of this source code is governed by the Drone Non-Commercial License
|
// Copyright 2016 The Linux Foundation
|
||||||
// that can be found in the LICENSE file.
|
//
|
||||||
|
// 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 perm
|
package perm
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"database/sql"
|
"database/sql"
|
||||||
|
|
||||||
"github.com/drone/drone/store/shared/db"
|
|
||||||
"github.com/drone/drone/core"
|
"github.com/drone/drone/core"
|
||||||
|
"github.com/drone/drone/store/shared/db"
|
||||||
)
|
)
|
||||||
|
|
||||||
// helper function converts the Perm structure to a set
|
// helper function converts the Perm structure to a set
|
||||||
|
@ -1,14 +1,25 @@
|
|||||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
// Copyright 2019 Drone IO, Inc.
|
||||||
// Use of this source code is governed by the Drone Non-Commercial License
|
// Copyright 2016 The Linux Foundation
|
||||||
// that can be found in the LICENSE file.
|
//
|
||||||
|
// 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 repos
|
package repos
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/drone/drone/store/shared/db"
|
|
||||||
"github.com/drone/drone/core"
|
"github.com/drone/drone/core"
|
||||||
|
"github.com/drone/drone/store/shared/db"
|
||||||
)
|
)
|
||||||
|
|
||||||
// New returns a new RepositoryStore.
|
// New returns a new RepositoryStore.
|
||||||
|
@ -1,14 +1,25 @@
|
|||||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
// Copyright 2019 Drone IO, Inc.
|
||||||
// Use of this source code is governed by the Drone Non-Commercial License
|
// Copyright 2016 The Linux Foundation
|
||||||
// that can be found in the LICENSE file.
|
//
|
||||||
|
// 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 repos
|
package repos
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"database/sql"
|
"database/sql"
|
||||||
|
|
||||||
"github.com/drone/drone/store/shared/db"
|
|
||||||
"github.com/drone/drone/core"
|
"github.com/drone/drone/core"
|
||||||
|
"github.com/drone/drone/store/shared/db"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ToParams converts the Repository structure to a set
|
// ToParams converts the Repository structure to a set
|
||||||
|
@ -1,6 +1,17 @@
|
|||||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
// Copyright 2019 Drone IO, Inc.
|
||||||
// Use of this source code is governed by the Drone Non-Commercial License
|
// Copyright 2016 The Linux Foundation
|
||||||
// that can be found in the LICENSE file.
|
//
|
||||||
|
// 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 repos
|
package repos
|
||||||
|
|
||||||
|
@ -1,15 +1,26 @@
|
|||||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
// Copyright 2019 Drone IO, Inc.
|
||||||
// Use of this source code is governed by the Drone Non-Commercial License
|
// Copyright 2016 The Linux Foundation
|
||||||
// that can be found in the LICENSE file.
|
//
|
||||||
|
// 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 secret
|
package secret
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"database/sql"
|
"database/sql"
|
||||||
|
|
||||||
|
"github.com/drone/drone/core"
|
||||||
"github.com/drone/drone/store/shared/db"
|
"github.com/drone/drone/store/shared/db"
|
||||||
"github.com/drone/drone/store/shared/encrypt"
|
"github.com/drone/drone/store/shared/encrypt"
|
||||||
"github.com/drone/drone/core"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// helper function converts the User structure to a set
|
// helper function converts the User structure to a set
|
||||||
|
@ -1,15 +1,26 @@
|
|||||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
// Copyright 2019 Drone IO, Inc.
|
||||||
// Use of this source code is governed by the Drone Non-Commercial License
|
// Copyright 2016 The Linux Foundation
|
||||||
// that can be found in the LICENSE file.
|
//
|
||||||
|
// 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 secret
|
package secret
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
|
"github.com/drone/drone/core"
|
||||||
"github.com/drone/drone/store/shared/db"
|
"github.com/drone/drone/store/shared/db"
|
||||||
"github.com/drone/drone/store/shared/encrypt"
|
"github.com/drone/drone/store/shared/encrypt"
|
||||||
"github.com/drone/drone/core"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// New returns a new Secret database store.
|
// New returns a new Secret database store.
|
||||||
|
@ -1,6 +1,17 @@
|
|||||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
// Copyright 2019 Drone IO, Inc.
|
||||||
// Use of this source code is governed by the Drone Non-Commercial License
|
// Copyright 2016 The Linux Foundation
|
||||||
// that can be found in the LICENSE file.
|
//
|
||||||
|
// 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 stage
|
package stage
|
||||||
|
|
||||||
@ -8,8 +19,8 @@ import (
|
|||||||
"database/sql"
|
"database/sql"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
|
||||||
"github.com/drone/drone/store/shared/db"
|
|
||||||
"github.com/drone/drone/core"
|
"github.com/drone/drone/core"
|
||||||
|
"github.com/drone/drone/store/shared/db"
|
||||||
|
|
||||||
"github.com/jmoiron/sqlx/types"
|
"github.com/jmoiron/sqlx/types"
|
||||||
)
|
)
|
||||||
|
@ -1,14 +1,25 @@
|
|||||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
// Copyright 2019 Drone IO, Inc.
|
||||||
// Use of this source code is governed by the Drone Non-Commercial License
|
// Copyright 2016 The Linux Foundation
|
||||||
// that can be found in the LICENSE file.
|
//
|
||||||
|
// 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 stage
|
package stage
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/drone/drone/store/shared/db"
|
|
||||||
"github.com/drone/drone/core"
|
"github.com/drone/drone/core"
|
||||||
|
"github.com/drone/drone/store/shared/db"
|
||||||
)
|
)
|
||||||
|
|
||||||
// New returns a new StageStore.
|
// New returns a new StageStore.
|
||||||
|
@ -1,6 +1,17 @@
|
|||||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
// Copyright 2019 Drone IO, Inc.
|
||||||
// Use of this source code is governed by the Drone Non-Commercial License
|
// Copyright 2016 The Linux Foundation
|
||||||
// that can be found in the LICENSE file.
|
//
|
||||||
|
// 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 stage
|
package stage
|
||||||
|
|
||||||
|
@ -1,14 +1,25 @@
|
|||||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
// Copyright 2019 Drone IO, Inc.
|
||||||
// Use of this source code is governed by the Drone Non-Commercial License
|
// Copyright 2016 The Linux Foundation
|
||||||
// that can be found in the LICENSE file.
|
//
|
||||||
|
// 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 step
|
package step
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"database/sql"
|
"database/sql"
|
||||||
|
|
||||||
"github.com/drone/drone/store/shared/db"
|
|
||||||
"github.com/drone/drone/core"
|
"github.com/drone/drone/core"
|
||||||
|
"github.com/drone/drone/store/shared/db"
|
||||||
)
|
)
|
||||||
|
|
||||||
// helper function converts the Step structure to a set
|
// helper function converts the Step structure to a set
|
||||||
|
@ -1,14 +1,25 @@
|
|||||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
// Copyright 2019 Drone IO, Inc.
|
||||||
// Use of this source code is governed by the Drone Non-Commercial License
|
// Copyright 2016 The Linux Foundation
|
||||||
// that can be found in the LICENSE file.
|
//
|
||||||
|
// 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 step
|
package step
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/drone/drone/store/shared/db"
|
|
||||||
"github.com/drone/drone/core"
|
"github.com/drone/drone/core"
|
||||||
|
"github.com/drone/drone/store/shared/db"
|
||||||
)
|
)
|
||||||
|
|
||||||
// New returns a new StepStore.
|
// New returns a new StepStore.
|
||||||
|
@ -3,21 +3,3 @@
|
|||||||
// that can be found in the LICENSE file.
|
// that can be found in the LICENSE file.
|
||||||
|
|
||||||
package store
|
package store
|
||||||
|
|
||||||
import (
|
|
||||||
"github.com/drone/drone/core"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Stores provides all database stores.
|
|
||||||
type Stores struct {
|
|
||||||
Batch core.Batcher
|
|
||||||
Builds core.BuildStore
|
|
||||||
Crons core.CronStore
|
|
||||||
Logs core.LogStore
|
|
||||||
Perms core.PermStore
|
|
||||||
Secrets core.SecretStore
|
|
||||||
Stages core.StageStore
|
|
||||||
Steps core.StepStore
|
|
||||||
Repos core.RepositoryStore
|
|
||||||
Users core.UserStore
|
|
||||||
}
|
|
||||||
|
@ -1,14 +1,25 @@
|
|||||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
// Copyright 2019 Drone IO, Inc.
|
||||||
// Use of this source code is governed by the Drone Non-Commercial License
|
// Copyright 2016 The Linux Foundation
|
||||||
// that can be found in the LICENSE file.
|
//
|
||||||
|
// 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 user
|
package user
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"database/sql"
|
"database/sql"
|
||||||
|
|
||||||
"github.com/drone/drone/store/shared/db"
|
|
||||||
"github.com/drone/drone/core"
|
"github.com/drone/drone/core"
|
||||||
|
"github.com/drone/drone/store/shared/db"
|
||||||
)
|
)
|
||||||
|
|
||||||
// helper function converts the User structure to a set
|
// helper function converts the User structure to a set
|
||||||
|
@ -1,14 +1,25 @@
|
|||||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
// Copyright 2019 Drone IO, Inc.
|
||||||
// Use of this source code is governed by the Drone Non-Commercial License
|
// Copyright 2016 The Linux Foundation
|
||||||
// that can be found in the LICENSE file.
|
//
|
||||||
|
// 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 user
|
package user
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/drone/drone/store/shared/db"
|
|
||||||
"github.com/drone/drone/core"
|
"github.com/drone/drone/core"
|
||||||
|
"github.com/drone/drone/store/shared/db"
|
||||||
)
|
)
|
||||||
|
|
||||||
// New returns a new UserStore.
|
// New returns a new UserStore.
|
||||||
|
Loading…
Reference in New Issue
Block a user