Integrate j7s-os deployment with flux.
This commit is contained in:
parent
8663653ec3
commit
c5d15bcaa6
|
|
@ -16,9 +16,6 @@ spec:
|
||||||
- name: make-image-name
|
- name: make-image-name
|
||||||
type: string
|
type: string
|
||||||
description: The name of image to make in the os repo.
|
description: The name of image to make in the os repo.
|
||||||
- name: short-name
|
|
||||||
type: string
|
|
||||||
description: A short name for this image from which other names a derived. (aka j7-os)
|
|
||||||
- name: branch
|
- name: branch
|
||||||
type: string
|
type: string
|
||||||
default: main
|
default: main
|
||||||
|
|
@ -61,10 +58,22 @@ spec:
|
||||||
- name: commit
|
- name: commit
|
||||||
value: $(params.make-image-name)
|
value: $(params.make-image-name)
|
||||||
- name: image
|
- name: image
|
||||||
value: $(params.short-name)-deploy
|
value: j7s-os-deploy
|
||||||
- name: registry
|
- name: registry
|
||||||
value: 192.168.1.128:8443
|
value: 192.168.1.128:8443
|
||||||
- name: version
|
- name: version
|
||||||
value: $(tasks.image-build.results.version-string)
|
value: $(tasks.image-build.results.version-string)
|
||||||
taskRef:
|
taskRef:
|
||||||
name: j7s-os-buildah
|
name: j7s-os-buildah
|
||||||
|
- name: deploy-image
|
||||||
|
runAfter: ["build-deploy-image"]
|
||||||
|
workspaces:
|
||||||
|
- name: ssh-directory
|
||||||
|
workspace: git-credentials
|
||||||
|
params:
|
||||||
|
- name: image
|
||||||
|
value: 192.168.1.128:8443/j7s-os-deploy
|
||||||
|
- name: version
|
||||||
|
value: $(tasks.image-build.results.version-string)
|
||||||
|
taskRef:
|
||||||
|
name: j7s-os-k8s-deploy
|
||||||
|
|
@ -21,7 +21,5 @@ spec:
|
||||||
params:
|
params:
|
||||||
- name: make-image-name
|
- name: make-image-name
|
||||||
value: cs9-qemu-minimal-ostree.x86_64.repo
|
value: cs9-qemu-minimal-ostree.x86_64.repo
|
||||||
- name: short-name
|
|
||||||
value: j7s-os
|
|
||||||
- name: branch
|
- name: branch
|
||||||
value: main
|
value: main
|
||||||
|
|
@ -31,6 +31,7 @@ spec:
|
||||||
-f ./hosting/Dockerfile -t $(params.image):$(params.version) .
|
-f ./hosting/Dockerfile -t $(params.image):$(params.version) .
|
||||||
# Push
|
# Push
|
||||||
buildah --storage-driver=overlay push --tls-verify=false $(params.image) docker://$(params.registry)/$(params.image):$(params.version)
|
buildah --storage-driver=overlay push --tls-verify=false $(params.image) docker://$(params.registry)/$(params.image):$(params.version)
|
||||||
|
buildah --storage-driver=overlay push --tls-verify=false $(params.image) docker://$(params.registry)/$(params.image):latest
|
||||||
env:
|
env:
|
||||||
- name: USERNAME
|
- name: USERNAME
|
||||||
valueFrom:
|
valueFrom:
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,45 @@
|
||||||
|
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
|
||||||
|
|
||||||
Loading…
Reference in New Issue