k8s-config/tasks/j7s-os-k8s-deploy.yaml

46 lines
1.2 KiB
YAML

apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: j7s-os-k8s-deploy
namespace: j7s-ci
spec:
params:
- name: image
description: The image to deploy.
- name: version
description: The version of the image to deploy.
workspaces:
- name: ssh-directory
steps:
- name: update-with-flux
image: 192.168.1.128:8443/gitssh:latest
script: |
#!/usr/bin/env bash
set -x
cp -r $(workspaces.ssh-directory.path) ~/.ssh
chmod 700 ~/.ssh
chmod -R 400 ~/.ssh/*
git config --global user.name tekton
git config --global user.email tekton@internal.jpace121.net
git clone ssh://git.jpace121.net:2222/cd/flux-apps flux-apps
cd flux-apps
cat <<EOF > j7s-os-deploy/patch.yaml
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: j7s-os-app-deployment
spec:
template:
spec:
containers:
- name: j7s-os-app
image: $(params.image):$(params.version)
EOF
git add ./j7s-os-deploy
git commit -m "Update j7s-os-deploy to version $(params.version)"
git push origin master