cue modules: move stdlib to pkg/alpha.dagger.io
In preparation for Europa, we will vendor multiple CUE modules: - `pkg/alpha.dagger.io`: legacy non-europa packages - `pkg/dagger.io`: core Europa packages - `pkg/universe.dagger.io`: Europa universe Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
59
pkg/alpha.dagger.io/argocd/status.cue
Normal file
59
pkg/alpha.dagger.io/argocd/status.cue
Normal file
@@ -0,0 +1,59 @@
|
||||
package argocd
|
||||
|
||||
import (
|
||||
"alpha.dagger.io/dagger"
|
||||
"alpha.dagger.io/dagger/op"
|
||||
)
|
||||
|
||||
// Get application's status
|
||||
#Status: {
|
||||
// ArgoCD configuration
|
||||
config: #Config
|
||||
|
||||
// ArgoCD application
|
||||
name: dagger.#Input & {string}
|
||||
|
||||
// ArgoCD CLI output
|
||||
outputs: {
|
||||
// Application health
|
||||
health: dagger.#Output & {string}
|
||||
|
||||
// Application sync state
|
||||
sync: dagger.#Output & {string}
|
||||
|
||||
// Namespace
|
||||
namespace: dagger.#Output & {string}
|
||||
|
||||
// Server
|
||||
server: dagger.#Output & {string}
|
||||
|
||||
// Comma separated list of application URLs
|
||||
urls: dagger.#Output & {string}
|
||||
|
||||
// Last operation state message
|
||||
state: dagger.#Output & {string}
|
||||
}
|
||||
|
||||
outputs: #up: [
|
||||
op.#Load & {
|
||||
from: #CLI & {
|
||||
"config": config
|
||||
}
|
||||
},
|
||||
|
||||
op.#Exec & {
|
||||
args: ["sh", "-c",
|
||||
#"""
|
||||
argocd app get "$APPLICATION" --output json | jq '{health:.status.health.status,sync:.status.sync.status,namespace:.spec.destination.namespace,server:.spec.destination.server,urls:(.status.summary.externalURLs//[]|join(",")),state:.status.operationState.message}' > /output.json
|
||||
"""#,
|
||||
]
|
||||
env: APPLICATION: name
|
||||
always: true
|
||||
},
|
||||
|
||||
op.#Export & {
|
||||
source: "/output.json"
|
||||
format: "json"
|
||||
},
|
||||
]
|
||||
}
|
Reference in New Issue
Block a user