Skip to content
This repository has been archived by the owner on Sep 11, 2023. It is now read-only.

Commit

Permalink
Add Argo workflows template (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
viktigpetterr authored Jun 12, 2022
1 parent bc2af33 commit db982ef
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,7 @@ Different CI/CD tools offer different support for this. Below you can find docs
## Azure Pipelines
- Add Debricked token variable. [Read more](https://debricked.com/docs/integrations/ci-build-systems/azure-devops.html)
- [See template](azure-pipelines.yml)

## Argo Workflows
- Add Debricked token variable. [Read more](https://debricked.com/docs/integrations/ci-build-systems/argo-workflows.html)
- [See template](argo.yml)
81 changes: 81 additions & 0 deletions argo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: debricked-
spec:
entrypoint: debricked
arguments:
parameters:
- name: git-url # For example: https://github.com/debricked/go-templates.git
- name: debricked-token # Consider using kubernetes secrets instead. For more details, see: https://github.com/argoproj/argo-workflows/blob/master/examples/secrets.yaml

templates:
- name: debricked
inputs:
parameters:
- name: git-url
- name: debricked-token
steps:
- - name: build
template: build
arguments:
parameters:
- name: git-url
value: "{{inputs.parameters.git-url}}"
- - name: scan
template: scan
arguments:
parameters:
- name: git-url
value: "{{inputs.parameters.git-url}}"
- name: debricked-token
value: "{{inputs.parameters.debricked-token}}"
artifacts:
- name: repository
from: "{{steps.build.outputs.artifacts.repository}}"

- name: build
inputs:
parameters:
- name: git-url
artifacts:
- name: repository
path: /repository
git: # For more details, see: https://github.com/argoproj/argo-workflows/blob/master/examples/input-artifact-git.yaml
repo: "{{inputs.parameters.git-url}}"
outputs:
artifacts:
- name: repository
path: /repository
container:
name: 'gradle'
image: gradle:7-jdk11
workingDir: /repository
command:
- /bin/sh
- '-c'
args:
- ./gradlew dependencies > .debricked-gradle-dependencies.txt

- name: scan
inputs:
parameters:
- name: debricked-token
- name: git-url
artifacts:
- name: repository
path: /repository
container:
name: 'debricked-scan'
image: debricked/debricked-scan:latest
workingDir: /repository
command:
- /bin/sh
- '-c'
args:
- /argo.sh
env:
- name: DEBRICKED_TOKEN
value: "{{inputs.parameters.debricked-token}}"
- name: DEBRICKED_GIT_URL
value: "{{inputs.parameters.git-url}}"

0 comments on commit db982ef

Please sign in to comment.