EUGENIO SOUZA CARVALHO 3 years ago
parent
commit
5d69c39782
1 changed files with 65 additions and 31 deletions
  1. 65 31
      argoworkflow/030-sensor-github.yaml

+ 65 - 31
argoworkflow/030-sensor-github.yaml

@@ -104,38 +104,72 @@ spec:
           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
+              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
+  # 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