EUGENIO SOUZA CARVALHO %!s(int64=4) %!d(string=hai) anos
pai
achega
3b959f9358
Modificáronse 1 ficheiros con 144 adicións e 96 borrados
  1. 144 96
      argoworkflow/workflow/040-sensor-github.yaml

+ 144 - 96
argoworkflow/workflow/040-sensor-github.yaml

@@ -1,3 +1,51 @@
+apiVersion: argoproj.io/v1alpha1
+kind: Sensor
+metadata:
+  name: github
+spec:
+  template:
+    serviceAccountName: argo-events-sa
+  dependencies:
+    - name: test-dep
+      gatewayName: github
+      eventName: example
+  subscription:
+    http:
+      port: 9300
+  triggers:
+    - template:
+        name: github-workflow-trigger
+        k8s:
+          group: argoproj.io
+          version: v1alpha1
+          resource: workflows
+          operation: create
+          source:
+            resource:
+              apiVersion: argoproj.io/v1alpha1
+              kind: Workflow
+              metadata:
+                generateName: github-
+              spec:
+                entrypoint: whalesay
+                arguments:
+                  parameters:
+                  - name: message
+                    # value will get overridden by the event payload
+                    value: hello world
+                templates:
+                - name: whalesay
+                  inputs:
+                    parameters:
+                    - name: message
+                  container:
+                    image: docker/whalesay:latest
+                    command: [cowsay]
+                    args: ["{{inputs.parameters.message}}"]
+          parameters:
+            - src:
+                dependencyName: test-dep
+              dest: spec.arguments.parameters.0.value
 # apiVersion: argoproj.io/v1alpha1
 # kind: WorkflowTemplate
 # metadata:
@@ -78,99 +126,99 @@
 #       - name: workdir
 #         mountPath: /go
 
-# ---
-apiVersion: argoproj.io/v1alpha1
-kind: Sensor
-metadata:
-  name: github
-  namespace: argo-events
-spec:
-  template:
-    serviceAccountName: argo-events-sa
-  dependencies:
-    - name: test-dep
-      gatewayName: github
-      eventName: example
-  subscription:
-    http:
-      port: 9300
-  triggers:
-    - template:
-        name: github-workflow-trigger
-        k8s:
-          group: argoproj.io
-          version: v1alpha1
-          resource: workflows
-          operation: create
-          source:
-            resource:
-              apiVersion: argoproj.io/v1alpha1
-              kind: Workflow
-              metadata:
-                generateName: github-
-              spec:
-                # serviceAccountName: workflow
-                entrypoint: whalesay
-                arguments:
-                  parameters:
-                  - name: message
-                    # value will get overridden by the event payload
-                    value: hello world
-                templates:
-                - name: whalesay
-                  inputs:
-                    parameters:
-                    - name: message
-                  container:
-                    image: docker/whalesay:latest
-                    command: [cowsay]
-                    args: ["{{inputs.parameters.message}}"]
-          parameters:
-            - src:
-                dependencyName: test-dep
-              dest: spec.arguments.parameters.0.value
-  # triggers:
-  #   - template:
-  #       name: github-workflow-trigger
-  #       k8s:
-  #         group: argoproj.io
-  #         version: v1alpha1
-  #         resource: workflows
-  #         operation: create
-  #         source:
-  #           resource:
-  #           apiVersion: argoproj.io/v1alpha1
-  #           kind: Workflow
-  #           metadata:
-  #             generateName: ci-workflow-
-  #           spec:
-  #             # ttlStrategy:
-  #             #   secondsAfterCompletion: 10 # Time to live after workflow is completed, replaces ttlSecondsAfterFinished
-  #             #   secondsAfterSuccess: 5     # Time to live after workflow is successful
-  #             #   secondsAfterFailure: 5     # Time to live after workflow fails
-  #             serviceAccountName: workflow
-  #             # entrypoint: ci-workflow
-  #             # entrypoint is the name of the template used as the starting point of the workflow
-  #             entrypoint: ci-workflow
-  #             workflowTemplateRef:
-  #               name: ci-workflow
-  #             # the 'ci-workflow' template accepts an parameter 'revision', with a default of 'master'.
-  #             # this can be overridden via argo CLI (e.g. `argo submit ci.yaml -p revision=0dea2d0`)
-  #             arguments:
-  #               parameters:
-  #                 - name: revision
-  #                   value: master
-  #             # a temporary volume, named workdir, will be used as a working directory
-  #             # for this workflow. This volume is passed around from step to step.
-  #             volumeClaimTemplates:
-  #               - metadata:
-  #                   name: workdir
-  #                 spec:
-  #                   accessModes: ["ReadWriteOnce"]
-  #                   resources:
-  #                     requests:
-  #                       storage: 1Gi
-  #         parameters:
-  #           - src:
-  #               dependencyName: test-dep
-  #             dest: spec.arguments.parameters.0.value
+# --- daqui pra baixo
+# apiVersion: argoproj.io/v1alpha1
+# kind: Sensor
+# metadata:
+#   name: github
+#   namespace: argo-events
+# spec:
+#   template:
+#     serviceAccountName: argo-events-sa
+#   dependencies:
+#     - name: test-dep
+#       gatewayName: github
+#       eventName: example
+#   subscription:
+#     http:
+#       port: 9300
+#   triggers:
+#     - template:
+#         name: github-workflow-trigger
+#         k8s:
+#           group: argoproj.io
+#           version: v1alpha1
+#           resource: workflows
+#           operation: create
+#           source:
+#             resource:
+#               apiVersion: argoproj.io/v1alpha1
+#               kind: Workflow
+#               metadata:
+#                 generateName: github-
+#               spec:
+#                 # serviceAccountName: workflow
+#                 entrypoint: whalesay
+#                 arguments:
+#                   parameters:
+#                   - name: message
+#                     # value will get overridden by the event payload
+#                     value: hello world
+#                 templates:
+#                 - name: whalesay
+#                   inputs:
+#                     parameters:
+#                     - name: message
+#                   container:
+#                     image: docker/whalesay:latest
+#                     command: [cowsay]
+#                     args: ["{{inputs.parameters.message}}"]
+#           parameters:
+#             - src:
+#                 dependencyName: test-dep
+#               dest: spec.arguments.parameters.0.value
+#   # triggers:
+#   #   - template:
+#   #       name: github-workflow-trigger
+#   #       k8s:
+#   #         group: argoproj.io
+#   #         version: v1alpha1
+#   #         resource: workflows
+#   #         operation: create
+#   #         source:
+#   #           resource:
+#   #           apiVersion: argoproj.io/v1alpha1
+#   #           kind: Workflow
+#   #           metadata:
+#   #             generateName: ci-workflow-
+#   #           spec:
+#   #             # ttlStrategy:
+#   #             #   secondsAfterCompletion: 10 # Time to live after workflow is completed, replaces ttlSecondsAfterFinished
+#   #             #   secondsAfterSuccess: 5     # Time to live after workflow is successful
+#   #             #   secondsAfterFailure: 5     # Time to live after workflow fails
+#   #             serviceAccountName: workflow
+#   #             # entrypoint: ci-workflow
+#   #             # entrypoint is the name of the template used as the starting point of the workflow
+#   #             entrypoint: ci-workflow
+#   #             workflowTemplateRef:
+#   #               name: ci-workflow
+#   #             # the 'ci-workflow' template accepts an parameter 'revision', with a default of 'master'.
+#   #             # this can be overridden via argo CLI (e.g. `argo submit ci.yaml -p revision=0dea2d0`)
+#   #             arguments:
+#   #               parameters:
+#   #                 - name: revision
+#   #                   value: master
+#   #             # a temporary volume, named workdir, will be used as a working directory
+#   #             # for this workflow. This volume is passed around from step to step.
+#   #             volumeClaimTemplates:
+#   #               - metadata:
+#   #                   name: workdir
+#   #                 spec:
+#   #                   accessModes: ["ReadWriteOnce"]
+#   #                   resources:
+#   #                     requests:
+#   #                       storage: 1Gi
+#   #         parameters:
+#   #           - src:
+#   #               dependencyName: test-dep
+#   #             dest: spec.arguments.parameters.0.value