Skip to content

Commit

Permalink
Add workflow for CI. (#42)
Browse files Browse the repository at this point in the history
This commit creates the workflow that will be run on every PR for argo-events.

Testing Done:

1. Ran workflow independently on a cluster. It succeeded modulo appropriate RBAC role
(See argoproj/argo-workflows#898 for details).

Refs #34.
  • Loading branch information
shrinandj authored and magaldima committed Jul 10, 2018
1 parent b20db08 commit 8fde9ce
Showing 1 changed file with 73 additions and 0 deletions.
73 changes: 73 additions & 0 deletions .argo-ci/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: argo-events-ci-
spec:
entrypoint: argo-events-ci
arguments:
parameters:
- name: revision
value: master
- name: repo
value: https://github.com/argoproj/argo-events.git

templates:
- name: argo-events-ci
steps:
- - name: build
template: ci-dind
arguments:
parameters:
- name: cmd
value: "{{item}}"
withItems:
- dep ensure && make
- name: test
template: ci-builder
arguments:
parameters:
- name: cmd
value: "{{item}}"
withItems:
- dep ensure && make test
- name: ci-builder
inputs:
parameters:
- name: cmd
artifacts:
- name: code
path: /go/src/github.com/argoproj/argo-events
git:
repo: "{{workflow.parameters.repo}}"
revision: "{{workflow.parameters.revision}}"
container:
image: argoproj/argo-ci-builder:1.0
command: [sh, -c]
args: ["{{inputs.parameters.cmd}}"]
workingDir: /go/src/github.com/argoproj/argo-events

- name: ci-dind
inputs:
parameters:
- name: cmd
artifacts:
- name: code
path: /go/src/github.com/argoproj/argo-events
git:
repo: "{{workflow.parameters.repo}}"
revision: "{{workflow.parameters.revision}}"
container:
image: argoproj/argo-ci-builder:1.0
command: [sh, -c]
args: ["until docker ps; do sleep 3; done && {{inputs.parameters.cmd}}"]
workingDir: /go/src/github.com/argoproj/argo-events
env:
- name: DOCKER_HOST
value: 127.0.0.1
sidecars:
- name: dind
image: docker:17.10-dind
securityContext:
privileged: true
mirrorVolumeMounts: true

0 comments on commit 8fde9ce

Please sign in to comment.