Fix caching issue on argoCD package

Signed-off-by: Tom Chauveau <tom.chauveau@epitech.eu>
This commit is contained in:
Tom Chauveau 2021-09-10 15:37:37 +02:00 committed by Sam Alba
parent 05b165bcc8
commit ef112e21ec
5 changed files with 41 additions and 35 deletions

View File

@ -16,26 +16,26 @@ Create an ArgoCD application
### argocd.#App Inputs ### argocd.#App Inputs
| Name | Type | Description | | Name | Type | Description |
| ------------- |:-------------: |:-------------: | | ------------- |:-------------: |:-------------: |
|*config.version* | `*"v2.0.5" \| string` |ArgoCD CLI binary version | |*config.version* | `*"v2.0.5" \| string` |ArgoCD CLI binary version |
|*config.server* | `string` |ArgoCD server | |*config.server* | `string` |ArgoCD server |
|*config.project* | `*"default" \| string` |ArgoCD project | |*config.project* | `*"default" \| string` |ArgoCD project |
|*config.token* | `dagger.#Secret` |ArgoCD authentication token | |*config.token* | `dagger.#Secret` |ArgoCD authentication token |
|*name* | `string` |App name | |*name* | `string` |App name |
|*repo* | `string` |Repository url (git or helm) | |*repo* | `string` |Repository url (git or helm) |
|*path* | `string` |Folder to deploy | |*path* | `string` |Folder to deploy |
|*server* | `*"https://kubernetes.default.svc" \| string` |Destination server | |*server* | `*"https://kubernetes.default.svc" \| string` |Destination server |
|*namespace* | `*"default" \| string` |Destination namespace | |*image.config.version* | `*"v2.0.5" \| string` |ArgoCD CLI binary version |
|*ctr.image.config.version* | `*"v2.0.5" \| string` |ArgoCD CLI binary version | |*image.config.server* | `string` |ArgoCD server |
|*ctr.image.config.server* | `string` |ArgoCD server | |*image.config.project* | `*"default" \| string` |ArgoCD project |
|*ctr.image.config.project* | `*"default" \| string` |ArgoCD project | |*image.config.token* | `dagger.#Secret` |ArgoCD authentication token |
|*ctr.image.config.token* | `dagger.#Secret` |ArgoCD authentication token | |*namespace* | `*"default" \| string` |Destination namespace |
|*ctr.env.APP_NAME* | `string` |- | |*env.APP_NAME* | `string` |- |
|*ctr.env.APP_REPO* | `string` |- | |*env.APP_REPO* | `string` |- |
|*ctr.env.APP_PATH* | `string` |- | |*env.APP_PATH* | `string` |- |
|*ctr.env.APP_SERVER* | `*"https://kubernetes.default.svc" \| string` |- | |*env.APP_SERVER* | `*"https://kubernetes.default.svc" \| string` |- |
|*ctr.env.APP_NAMESPACE* | `*"default" \| string` |- | |*env.APP_NAMESPACE* | `*"default" \| string` |- |
### argocd.#App Outputs ### argocd.#App Outputs
@ -106,19 +106,19 @@ Sync an application to its targer state
### argocd.#Sync Inputs ### argocd.#Sync Inputs
| Name | Type | Description | | Name | Type | Description |
| ------------- |:-------------: |:-------------: | | ------------- |:-------------: |:-------------: |
|*config.version* | `*"v2.0.5" \| string` |ArgoCD CLI binary version | |*config.version* | `*"v2.0.5" \| string` |ArgoCD CLI binary version |
|*config.server* | `string` |ArgoCD server | |*config.server* | `string` |ArgoCD server |
|*config.project* | `*"default" \| string` |ArgoCD project | |*config.project* | `*"default" \| string` |ArgoCD project |
|*config.token* | `dagger.#Secret` |ArgoCD authentication token | |*config.token* | `dagger.#Secret` |ArgoCD authentication token |
|*application* | `string` |ArgoCD application | |*application* | `string` |ArgoCD application |
|*wait* | `*false \| bool` |Wait the application to sync correctly | |*image.config.version* | `*"v2.0.5" \| string` |ArgoCD CLI binary version |
|*ctr.image.config.version* | `*"v2.0.5" \| string` |ArgoCD CLI binary version | |*image.config.server* | `string` |ArgoCD server |
|*ctr.image.config.server* | `string` |ArgoCD server | |*image.config.project* | `*"default" \| string` |ArgoCD project |
|*ctr.image.config.project* | `*"default" \| string` |ArgoCD project | |*image.config.token* | `dagger.#Secret` |ArgoCD authentication token |
|*ctr.image.config.token* | `dagger.#Secret` |ArgoCD authentication token | |*wait* | `*false \| bool` |Wait the application to sync correctly |
|*ctr.env.APPLICATION* | `string` |- | |*env.APPLICATION* | `string` |- |
### argocd.#Sync Outputs ### argocd.#Sync Outputs

View File

@ -25,7 +25,7 @@ import (
// Destination namespace // Destination namespace
namespace: dagger.#Input & {*"default" | string} namespace: dagger.#Input & {*"default" | string}
ctr: os.#Container & { os.#Container & {
image: #CLI & { image: #CLI & {
"config": config "config": config
} }
@ -36,6 +36,7 @@ import (
--dest-server "$APP_SERVER" \ --dest-server "$APP_SERVER" \
--dest-namespace "$APP_NAMESPACE" --dest-namespace "$APP_NAMESPACE"
"""# """#
always: true
env: { env: {
APP_NAME: name APP_NAME: name
APP_REPO: repo APP_REPO: repo

View File

@ -48,6 +48,7 @@ import (
"""#, """#,
] ]
env: APPLICATION: name env: APPLICATION: name
always: true
}, },
op.#Export & { op.#Export & {

View File

@ -16,7 +16,7 @@ import (
// Wait the application to sync correctly // Wait the application to sync correctly
wait: dagger.#Input & {*false | bool} wait: dagger.#Input & {*false | bool}
ctr: os.#Container & { os.#Container & {
image: #CLI & { image: #CLI & {
"config": config "config": config
} }
@ -27,6 +27,7 @@ import (
argocd app wait "$APPLICATION" argocd app wait "$APPLICATION"
fi fi
"""# """#
always: true
env: APPLICATION: application env: APPLICATION: application
if wait { if wait {
env: WAIT_FLAG: "wait" env: WAIT_FLAG: "wait"

View File

@ -222,6 +222,9 @@ setup() {
dagger -e argocd-infra input text TestKubeconfig -f "$HOME"/.kube/config dagger -e argocd-infra input text TestKubeconfig -f "$HOME"/.kube/config
dagger -e argocd-infra up dagger -e argocd-infra up
# Wait for infra to be ready
kubectl -n argocd wait --for=condition=available deployment -l "app.kubernetes.io/part-of=argocd" --timeout=45s
# Forward port # Forward port
# We need to kill subprocess to avoid infinity loop # We need to kill subprocess to avoid infinity loop
kubectl port-forward svc/argocd-server -n argocd 8080:443 >/dev/null 2>/dev/null & kubectl port-forward svc/argocd-server -n argocd 8080:443 >/dev/null 2>/dev/null &