48 lines
1.4 KiB
YAML
48 lines
1.4 KiB
YAML
apiVersion: tekton.dev/v1beta1
|
|
kind: Task
|
|
metadata:
|
|
name: j7s-os-k8s-deploy
|
|
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: harbor.internal.jpace121.net/gitssh:latest
|
|
script: |
|
|
#!/usr/bin/env bash
|
|
set -x
|
|
cp -r $(workspaces.ssh-directory.path) ~/.ssh
|
|
chmod 700 ~/.ssh
|
|
chmod -R 400 ~/.ssh/*
|
|
ssh-keyscan -H -p 2222 git.jpace121.net >> ~/.ssh/known_hosts
|
|
git config --global user.name tekton
|
|
git config --global user.email tekton@internal.jpace121.net
|
|
|
|
git clone ssh://git@git.jpace121.net:2222/cd/flux-apps.git 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 HEAD:refs/for/master \
|
|
-o title="Update j7s-os-deploy to version $(params.version)" \
|
|
-o topic="j7s-os-deploy-$(params.version)"
|
|
|