Automate helm publishing

This commit is contained in:
Alexander Matyushentsev 2017-10-11 09:31:51 -07:00
parent 4ad4d551f9
commit 5e71ab6395
2 changed files with 79 additions and 0 deletions

21
.argo/argo-checkout.yaml Normal file
View file

@ -0,0 +1,21 @@
---
type: container
version: 1
name: argo-checkout
description: Checks out a source repository to /src
resources:
mem_mib: 500
cpu_cores: 0.1
image: argoproj/argoscm:v2.0
command: ["axscm"]
args: ["clone", "%%inputs.parameters.REPO%%", "/src", "--commit", "%%inputs.parameters.COMMIT%%"]
inputs:
parameters:
COMMIT:
default: "%%session.commit%%"
REPO:
default: "%%session.repo%%"
outputs:
artifacts:
CODE:
path: /src

58
.argo/publish.yaml Normal file
View file

@ -0,0 +1,58 @@
---
type: workflow
version: 1
name: Publish Charts
inputs:
parameters:
COMMIT:
default: "%%session.commit%%"
REPO:
default: "%%session.repo%%"
steps:
- CHECKOUT:
template: argo-checkout
- PREPARE:
image: ruby
resources:
mem_mib: 500
cpu_cores: 0.1
command: ["sh", "-c"]
args: [ruby /src/scripts/publish.rb]
inputs:
artifacts:
CODE:
from: "%%steps.CHECKOUT.outputs.artifacts.CODE%%"
path: /src
outputs:
artifacts:
CODE:
path: /src/output
- PUBLISH:
image: argoproj/argoscm:v2.0
command: ["sh", "-c"]
args: [
axscm clone %%inputs.parameters.REPO%% --commit gh-pages /src && cd /src && cp -r /output/* . &&
git add . && git commit -m "Build on `date`" &&
axscm clone %%inputs.parameters.REPO%% /src --commit gh-pages --merge=gh-pages --push]
resources:
mem_mib: 500
cpu_cores: 0.1
inputs:
artifacts:
CODE:
from: "%%steps.PREPARE.outputs.artifacts.CODE%%"
path: /output
---
type: policy
version: 1
name: Publish Charts Policy
template: Publish Charts
notifications:
- when:
- on_failure
whom:
- committer
- author
when:
- event: on_push