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/manifest.cue
Tom Chauveau 4d03638911 Add test for kube-gcp cue-manifest step
Signed-off-by: Tom Chauveau <tom.chauveau@epitech.eu>
2021-09-01 11:19:13 +02:00

30 lines
572 B
CUE

package main
import (
"encoding/yaml"
)
// Define and generate kubernetes deployment to deploy to kubernetes cluster
#AppManifest: {
// Name of the application
name: string
// Image to deploy to
image: string
// Define a kubernetes deployment object
deployment: #Deployment & {
"name": name
"image": image
}
// Define a kubernetes service object
service: #Service & {
"name": name
ports: http: deployment.port
}
// Merge definitions and convert them back from CUE to YAML
manifest: yaml.MarshalStream([deployment.manifest, service.manifest])
}