This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
dagger/docs/learn/tests/kube-gcp/cue-manifest/test/test.cue

67 lines
1008 B
CUE
Raw Permalink Normal View History

package main
import (
"alpha.dagger.io/dagger/op"
"alpha.dagger.io/kubernetes"
)
TestEks: {
#_GetDeployment: """
kubectl describe deployment todoapp | grep 'True'
"""
#_DeleteDeployment: """
kubectl delete deployment todoapp
kubectl delete service todoapp-service
"""
#up: [
op.#Load & {
from: kubernetes.#Kubectl
},
op.#WriteFile & {
dest: "/kubeconfig"
content: todoApp.kubeSrc.kubeconfig
},
op.#WriteFile & {
dest: "/getPods.sh"
content: #_GetDeployment
},
op.#WriteFile & {
dest: "/deletePods.sh"
content: #_DeleteDeployment
},
// Get pods
op.#Exec & {
always: true
args: [
"/bin/bash",
"--noprofile",
"--norc",
"-eo",
"pipefail",
"/getPods.sh",
]
env: KUBECONFIG: "/kubeconfig"
},
// Delete pods
op.#Exec & {
always: true
args: [
"/bin/bash",
"--noprofile",
"--norc",
"-eo",
"pipefail",
"/deletePods.sh",
]
env: KUBECONFIG: "/kubeconfig"
},
]
}