Skip to content

Commit

Permalink
Git as trigger source (#170)
Browse files Browse the repository at this point in the history
* Added support for backoff option when making connections in stream gateways

* Extracting common webhook functionality

* Modified storage grid and webhook implementation to take advantage of common webhook functionality

* Added sns gateway implementation

* Enhancing sns gateway

* Update deps

* Adding git as trigger source

* Adding git as a store for triggers

* Adding capability to switch to a branch or tag for git trigger source

* Update codegen

* Update deps

* Support for adding remotes for git trigger source

* Minor comment update
  • Loading branch information
VaibhavPage authored and magaldima committed Feb 19, 2019
1 parent c98e35c commit ac66a69
Show file tree
Hide file tree
Showing 13 changed files with 1,779 additions and 262 deletions.
1 change: 1 addition & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ required = [
"github.com/golang/protobuf/protoc-gen-go",
"github.com/gogo/protobuf/protoc-gen-gofast",
"github.com/gogo/protobuf/protoc-gen-gogofast",
"gopkg.in/src-d/go-git.v4"
]

[[constraint]]
Expand Down
72 changes: 72 additions & 0 deletions examples/sensors/trigger-source-git.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
apiVersion: argoproj.io/v1alpha1
kind: Sensor
metadata:
name: trigger-source-git
labels:
sensors.argoproj.io/sensor-controller-instanceid: argo-events
spec:
deploySpec:
containers:
- name: "sensor"
# this is an experimental image
image: "argoproj/sensor:v0.7.3"
imagePullPolicy: Always
volumeMounts:
- mountPath: /git/argoproj
name: argoproj
volumes:
- name: argoproj
emptyDir: {}
serviceAccountName: argo-events-sa
dependencies:
- name: "webhook-gateway-http:foo"
eventProtocol:
type: "HTTP"
http:
port: "9300"
triggers:
- name: workflow-trigger-1
resource:
namespace: argo-events
group: argoproj.io
version: v1alpha1
kind: Workflow
source:
git:
url: "https://github.com/argoproj/argo.git"
cloneDirectory: "/git/argoproj"
creds:
username:
name: github-secret
key: username
password:
name: github-secret
key: password
namespace: argo-events
filePath: "examples/hello-world.yaml"
tag: "v2.2.1"
- name: workflow-trigger-2
resource:
namespace: argo-events
group: argoproj.io
version: v1alpha1
kind: Workflow
source:
git:
url: "https://github.com/argoproj/argo.git"
cloneDirectory: "/git/argoproj"
creds:
username:
name: github-secret
key: username
password:
name: github-secret
key: password
namespace: argo-events
filePath: "examples/hello-world.yaml"
branch: "release-2.0"
# optional
remote:
name: "myremote"
urls:
- "https://github.com/VaibhavPage/argo.git"
34 changes: 17 additions & 17 deletions pkg/apis/common/generated.pb.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@ limitations under the License.

package common

import "github.com/gogo/protobuf/proto"
import "fmt"
import "math"
import proto "github.com/gogo/protobuf/proto"
import fmt "fmt"
import math "math"

import v11 "k8s.io/api/core/v1"

import github_com_minio_minio_go "github.com/minio/minio-go"

import github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys"

import "strings"
import "reflect"
import strings "strings"
import reflect "reflect"

import "io"
import io "io"

// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
Expand All @@ -46,7 +46,7 @@ const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
func (m *Event) Reset() { *m = Event{} }
func (*Event) ProtoMessage() {}
func (*Event) Descriptor() ([]byte, []int) {
return fileDescriptor_generated_1ecb42411ad60761, []int{0}
return fileDescriptor_generated_fe300a967e896a62, []int{0}
}
func (m *Event) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
Expand Down Expand Up @@ -74,7 +74,7 @@ var xxx_messageInfo_Event proto.InternalMessageInfo
func (m *EventContext) Reset() { *m = EventContext{} }
func (*EventContext) ProtoMessage() {}
func (*EventContext) Descriptor() ([]byte, []int) {
return fileDescriptor_generated_1ecb42411ad60761, []int{1}
return fileDescriptor_generated_fe300a967e896a62, []int{1}
}
func (m *EventContext) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
Expand Down Expand Up @@ -102,7 +102,7 @@ var xxx_messageInfo_EventContext proto.InternalMessageInfo
func (m *EventProtocol) Reset() { *m = EventProtocol{} }
func (*EventProtocol) ProtoMessage() {}
func (*EventProtocol) Descriptor() ([]byte, []int) {
return fileDescriptor_generated_1ecb42411ad60761, []int{2}
return fileDescriptor_generated_fe300a967e896a62, []int{2}
}
func (m *EventProtocol) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
Expand Down Expand Up @@ -130,7 +130,7 @@ var xxx_messageInfo_EventProtocol proto.InternalMessageInfo
func (m *Http) Reset() { *m = Http{} }
func (*Http) ProtoMessage() {}
func (*Http) Descriptor() ([]byte, []int) {
return fileDescriptor_generated_1ecb42411ad60761, []int{3}
return fileDescriptor_generated_fe300a967e896a62, []int{3}
}
func (m *Http) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
Expand Down Expand Up @@ -158,7 +158,7 @@ var xxx_messageInfo_Http proto.InternalMessageInfo
func (m *Nats) Reset() { *m = Nats{} }
func (*Nats) ProtoMessage() {}
func (*Nats) Descriptor() ([]byte, []int) {
return fileDescriptor_generated_1ecb42411ad60761, []int{4}
return fileDescriptor_generated_fe300a967e896a62, []int{4}
}
func (m *Nats) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
Expand Down Expand Up @@ -186,7 +186,7 @@ var xxx_messageInfo_Nats proto.InternalMessageInfo
func (m *S3Artifact) Reset() { *m = S3Artifact{} }
func (*S3Artifact) ProtoMessage() {}
func (*S3Artifact) Descriptor() ([]byte, []int) {
return fileDescriptor_generated_1ecb42411ad60761, []int{5}
return fileDescriptor_generated_fe300a967e896a62, []int{5}
}
func (m *S3Artifact) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
Expand Down Expand Up @@ -214,7 +214,7 @@ var xxx_messageInfo_S3Artifact proto.InternalMessageInfo
func (m *S3Bucket) Reset() { *m = S3Bucket{} }
func (*S3Bucket) ProtoMessage() {}
func (*S3Bucket) Descriptor() ([]byte, []int) {
return fileDescriptor_generated_1ecb42411ad60761, []int{6}
return fileDescriptor_generated_fe300a967e896a62, []int{6}
}
func (m *S3Bucket) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
Expand Down Expand Up @@ -242,7 +242,7 @@ var xxx_messageInfo_S3Bucket proto.InternalMessageInfo
func (m *S3Filter) Reset() { *m = S3Filter{} }
func (*S3Filter) ProtoMessage() {}
func (*S3Filter) Descriptor() ([]byte, []int) {
return fileDescriptor_generated_1ecb42411ad60761, []int{7}
return fileDescriptor_generated_fe300a967e896a62, []int{7}
}
func (m *S3Filter) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
Expand Down Expand Up @@ -270,7 +270,7 @@ var xxx_messageInfo_S3Filter proto.InternalMessageInfo
func (m *URI) Reset() { *m = URI{} }
func (*URI) ProtoMessage() {}
func (*URI) Descriptor() ([]byte, []int) {
return fileDescriptor_generated_1ecb42411ad60761, []int{8}
return fileDescriptor_generated_fe300a967e896a62, []int{8}
}
func (m *URI) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
Expand Down Expand Up @@ -3022,10 +3022,10 @@ var (
)

func init() {
proto.RegisterFile("github.com/argoproj/argo-events/pkg/apis/common/generated.proto", fileDescriptor_generated_1ecb42411ad60761)
proto.RegisterFile("github.com/argoproj/argo-events/pkg/apis/common/generated.proto", fileDescriptor_generated_fe300a967e896a62)
}

var fileDescriptor_generated_1ecb42411ad60761 = []byte{
var fileDescriptor_generated_fe300a967e896a62 = []byte{
// 1309 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0xcf, 0x6f, 0x1b, 0xc5,
0x17, 0x8f, 0x13, 0xdb, 0xb1, 0xc7, 0xed, 0x37, 0xe9, 0xf4, 0x5b, 0x61, 0x05, 0xd5, 0x09, 0x46,
Expand Down
34 changes: 17 additions & 17 deletions pkg/apis/gateway/v1alpha1/generated.pb.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@ limitations under the License.

package v1alpha1

import "github.com/gogo/protobuf/proto"
import "fmt"
import "math"
import "github.com/argoproj/argo-events/pkg/apis/common"
import proto "github.com/gogo/protobuf/proto"
import fmt "fmt"
import math "math"
import common "github.com/argoproj/argo-events/pkg/apis/common"

import v11 "k8s.io/api/core/v1"

import github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys"

import "strings"
import "reflect"
import strings "strings"
import reflect "reflect"

import "io"
import io "io"

// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
Expand All @@ -45,7 +45,7 @@ const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
func (m *Gateway) Reset() { *m = Gateway{} }
func (*Gateway) ProtoMessage() {}
func (*Gateway) Descriptor() ([]byte, []int) {
return fileDescriptor_generated_d61eb949e4c0f5b3, []int{0}
return fileDescriptor_generated_d7e7992cb16da963, []int{0}
}
func (m *Gateway) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
Expand Down Expand Up @@ -73,7 +73,7 @@ var xxx_messageInfo_Gateway proto.InternalMessageInfo
func (m *GatewayList) Reset() { *m = GatewayList{} }
func (*GatewayList) ProtoMessage() {}
func (*GatewayList) Descriptor() ([]byte, []int) {
return fileDescriptor_generated_d61eb949e4c0f5b3, []int{1}
return fileDescriptor_generated_d7e7992cb16da963, []int{1}
}
func (m *GatewayList) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
Expand Down Expand Up @@ -101,7 +101,7 @@ var xxx_messageInfo_GatewayList proto.InternalMessageInfo
func (m *GatewayNotificationWatcher) Reset() { *m = GatewayNotificationWatcher{} }
func (*GatewayNotificationWatcher) ProtoMessage() {}
func (*GatewayNotificationWatcher) Descriptor() ([]byte, []int) {
return fileDescriptor_generated_d61eb949e4c0f5b3, []int{2}
return fileDescriptor_generated_d7e7992cb16da963, []int{2}
}
func (m *GatewayNotificationWatcher) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
Expand Down Expand Up @@ -129,7 +129,7 @@ var xxx_messageInfo_GatewayNotificationWatcher proto.InternalMessageInfo
func (m *GatewaySpec) Reset() { *m = GatewaySpec{} }
func (*GatewaySpec) ProtoMessage() {}
func (*GatewaySpec) Descriptor() ([]byte, []int) {
return fileDescriptor_generated_d61eb949e4c0f5b3, []int{3}
return fileDescriptor_generated_d7e7992cb16da963, []int{3}
}
func (m *GatewaySpec) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
Expand Down Expand Up @@ -157,7 +157,7 @@ var xxx_messageInfo_GatewaySpec proto.InternalMessageInfo
func (m *GatewayStatus) Reset() { *m = GatewayStatus{} }
func (*GatewayStatus) ProtoMessage() {}
func (*GatewayStatus) Descriptor() ([]byte, []int) {
return fileDescriptor_generated_d61eb949e4c0f5b3, []int{4}
return fileDescriptor_generated_d7e7992cb16da963, []int{4}
}
func (m *GatewayStatus) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
Expand Down Expand Up @@ -185,7 +185,7 @@ var xxx_messageInfo_GatewayStatus proto.InternalMessageInfo
func (m *NodeStatus) Reset() { *m = NodeStatus{} }
func (*NodeStatus) ProtoMessage() {}
func (*NodeStatus) Descriptor() ([]byte, []int) {
return fileDescriptor_generated_d61eb949e4c0f5b3, []int{5}
return fileDescriptor_generated_d7e7992cb16da963, []int{5}
}
func (m *NodeStatus) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
Expand Down Expand Up @@ -213,7 +213,7 @@ var xxx_messageInfo_NodeStatus proto.InternalMessageInfo
func (m *NotificationWatchers) Reset() { *m = NotificationWatchers{} }
func (*NotificationWatchers) ProtoMessage() {}
func (*NotificationWatchers) Descriptor() ([]byte, []int) {
return fileDescriptor_generated_d61eb949e4c0f5b3, []int{6}
return fileDescriptor_generated_d7e7992cb16da963, []int{6}
}
func (m *NotificationWatchers) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
Expand Down Expand Up @@ -241,7 +241,7 @@ var xxx_messageInfo_NotificationWatchers proto.InternalMessageInfo
func (m *SensorNotificationWatcher) Reset() { *m = SensorNotificationWatcher{} }
func (*SensorNotificationWatcher) ProtoMessage() {}
func (*SensorNotificationWatcher) Descriptor() ([]byte, []int) {
return fileDescriptor_generated_d61eb949e4c0f5b3, []int{7}
return fileDescriptor_generated_d7e7992cb16da963, []int{7}
}
func (m *SensorNotificationWatcher) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
Expand Down Expand Up @@ -2444,10 +2444,10 @@ var (
)

func init() {
proto.RegisterFile("github.com/argoproj/argo-events/pkg/apis/gateway/v1alpha1/generated.proto", fileDescriptor_generated_d61eb949e4c0f5b3)
proto.RegisterFile("github.com/argoproj/argo-events/pkg/apis/gateway/v1alpha1/generated.proto", fileDescriptor_generated_d7e7992cb16da963)
}

var fileDescriptor_generated_d61eb949e4c0f5b3 = []byte{
var fileDescriptor_generated_d7e7992cb16da963 = []byte{
// 1073 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0x5d, 0x6f, 0x1b, 0x45,
0x17, 0xce, 0xda, 0x71, 0x6c, 0x8f, 0x93, 0x7e, 0xcc, 0xdb, 0x57, 0x2c, 0x46, 0x72, 0x2a, 0x5f,
Expand Down
3 changes: 1 addition & 2 deletions pkg/apis/gateway/v1alpha1/openapi_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit ac66a69

Please sign in to comment.