initial commit
This commit is contained in:
@@ -0,0 +1,72 @@
|
||||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: WorkflowTemplate
|
||||
metadata:
|
||||
name: clone-build-deploy
|
||||
namespace: argo
|
||||
spec:
|
||||
entrypoint: main
|
||||
volumes:
|
||||
- name: workdir
|
||||
persistentVolumeClaim:
|
||||
claimName: argo-workflows-pvc
|
||||
- name: dockersock
|
||||
hostPath:
|
||||
path: /var/run/docker.sock
|
||||
- name: kubeconfig
|
||||
secret:
|
||||
secretName: kubeconfig-secret
|
||||
|
||||
templates:
|
||||
- name: main
|
||||
steps:
|
||||
- - name: build
|
||||
template: git-clone
|
||||
- - name: deploy
|
||||
template: deploy-app
|
||||
|
||||
- name: git-clone
|
||||
container:
|
||||
image: allardkrings/riscv64-maven
|
||||
command: ["sh", "-c"]
|
||||
args:
|
||||
- |
|
||||
echo "Cleaning up /src directory..." && \
|
||||
rm -rf /src/* /src/.* 2>/dev/null || true && \
|
||||
git clone http://allard:Gitea01%40@gitea.gitea.svc.cluster.local:3000/allard/olproperties.git /src && \
|
||||
cd /src && \
|
||||
git status && \
|
||||
ls -la && \
|
||||
mvn clean install
|
||||
env:
|
||||
- name: USERNAME
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: gitea-creds
|
||||
key: username
|
||||
- name: PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: gitea-creds
|
||||
key: password
|
||||
volumeMounts:
|
||||
- name: workdir
|
||||
mountPath: /src
|
||||
- name: dockersock
|
||||
mountPath: /var/run/docker.sock
|
||||
|
||||
- name: deploy-app
|
||||
serviceAccountName: argo-workflow
|
||||
container:
|
||||
image: allardkrings/riscv64-kubectl
|
||||
command: ["sh", "-c"]
|
||||
args:
|
||||
- |
|
||||
echo "Contents of /src:" && ls -la /src && \
|
||||
echo "Checking deployment.yaml:" && cat /src/deployment.yaml && \
|
||||
echo "Deploying application..." && \
|
||||
kubectl apply -f /src/deployment.yaml --validate=false
|
||||
volumeMounts:
|
||||
- name: workdir
|
||||
mountPath: /src
|
||||
continueOn:
|
||||
failed: true
|
||||
51
riscv/argo-workflows/templates/dag-target.yaml
Normal file
51
riscv/argo-workflows/templates/dag-target.yaml
Normal file
@@ -0,0 +1,51 @@
|
||||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: Workflow
|
||||
metadata:
|
||||
generateName: dag-target-
|
||||
namespace: argo
|
||||
name: dag-target
|
||||
spec:
|
||||
entrypoint: dag-target
|
||||
arguments:
|
||||
parameters:
|
||||
- name: target
|
||||
value: E
|
||||
|
||||
templates:
|
||||
- name: dag-target
|
||||
dag:
|
||||
target: "{{workflow.parameters.target}}"
|
||||
|
||||
tasks:
|
||||
- name: A
|
||||
template: echo
|
||||
arguments:
|
||||
parameters: [{name: message, value: A}]
|
||||
- name: B
|
||||
depends: "A"
|
||||
template: echo
|
||||
arguments:
|
||||
parameters: [{name: message, value: B}]
|
||||
- name: C
|
||||
depends: "A"
|
||||
template: echo
|
||||
arguments:
|
||||
parameters: [{name: message, value: C}]
|
||||
- name: D
|
||||
depends: "B && C"
|
||||
template: echo
|
||||
arguments:
|
||||
parameters: [{name: message, value: D}]
|
||||
- name: E
|
||||
depends: "D"
|
||||
template: echo
|
||||
arguments:
|
||||
parameters: [{name: message, value: E}]
|
||||
|
||||
- name: echo
|
||||
inputs:
|
||||
parameters:
|
||||
- name: message
|
||||
container:
|
||||
image: riscv64/alpine
|
||||
command: [echo, "{{inputs.parameters.message}}"]
|
||||
@@ -0,0 +1,25 @@
|
||||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: WorkflowTemplate
|
||||
metadata:
|
||||
name: git-clone-template
|
||||
spec:
|
||||
entrypoint: git-clone
|
||||
templates:
|
||||
- name: git-clone
|
||||
inputs:
|
||||
artifacts:
|
||||
- name: argo-source
|
||||
path: /src
|
||||
git:
|
||||
repo: https://gitea-riscv/allard/olproperties.git
|
||||
usernameSecret:
|
||||
name: github-creds
|
||||
key: username
|
||||
passwordSecret:
|
||||
name: github-creds
|
||||
key: password
|
||||
container:
|
||||
image: allardkrings/riscv64-maven
|
||||
command: ["sh", "-c"]
|
||||
args: ["git status && ls && cat VERSION"]
|
||||
workingDir: /src
|
||||
26
riscv/argo-workflows/templates/git-clone-workflow.yaml
Normal file
26
riscv/argo-workflows/templates/git-clone-workflow.yaml
Normal file
@@ -0,0 +1,26 @@
|
||||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: Workflow
|
||||
metadata:
|
||||
generateName: git-clone-
|
||||
namespace: argo
|
||||
spec:
|
||||
entrypoint: git-clone
|
||||
templates:
|
||||
- name: git-clone
|
||||
inputs:
|
||||
artifacts:
|
||||
- name: argo-source
|
||||
path: /src
|
||||
git:
|
||||
repo: gitea.gitea.svc.cluster.local/allard/olproperties.git
|
||||
usernameSecret:
|
||||
name: github-creds
|
||||
key: username
|
||||
passwordSecret:
|
||||
name: github-creds
|
||||
key: password
|
||||
container:
|
||||
image: allardkrings/riscv64-maven
|
||||
command: ["sh", "-c"]
|
||||
args: ["git status && ls && cat VERSION"]
|
||||
workingDir: /src
|
||||
27
riscv/argo-workflows/templates/input-artifact-git.yaml
Normal file
27
riscv/argo-workflows/templates/input-artifact-git.yaml
Normal file
@@ -0,0 +1,27 @@
|
||||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: Workflow
|
||||
metadata:
|
||||
generateName: input-artifact-git-
|
||||
name: input-artifact-git
|
||||
namespace: argo
|
||||
spec:
|
||||
entrypoint: git-clone
|
||||
templates:
|
||||
- name: git-clone
|
||||
inputs:
|
||||
artifacts:
|
||||
- name: argo-source
|
||||
path: /src
|
||||
git:
|
||||
repo: https://gitea-riscv/allard/olproperties.git
|
||||
usernameSecret:
|
||||
name: github-creds
|
||||
key: username
|
||||
passwordSecret:
|
||||
name: github-creds
|
||||
key: password
|
||||
container:
|
||||
image: allardkrings/riscv64-maven
|
||||
command: [sh, -c]
|
||||
args: ["git status && ls && cat VERSION"]
|
||||
workingDir: /src
|
||||
Reference in New Issue
Block a user