2021-06-09 21:08:03 +02:00
|
|
|
setup() {
|
2021-06-10 00:44:58 +02:00
|
|
|
load 'helpers'
|
2021-06-09 21:08:03 +02:00
|
|
|
|
2021-06-10 00:44:58 +02:00
|
|
|
common_setup
|
2021-06-09 21:08:03 +02:00
|
|
|
}
|
|
|
|
|
2021-06-09 20:37:05 +02:00
|
|
|
|
|
|
|
@test "os" {
|
|
|
|
dagger -e os up
|
|
|
|
}
|
|
|
|
|
2021-06-17 15:20:47 +02:00
|
|
|
@test "go" {
|
|
|
|
dagger -e go up
|
|
|
|
}
|
|
|
|
|
2021-06-10 12:50:49 +02:00
|
|
|
@test "js/yarn" {
|
|
|
|
dagger -e js-yarn up
|
|
|
|
}
|
|
|
|
|
2021-06-10 12:29:49 +02:00
|
|
|
@test "alpine" {
|
|
|
|
dagger -e alpine up
|
|
|
|
}
|
|
|
|
|
2021-06-09 21:08:03 +02:00
|
|
|
@test "netlify" {
|
|
|
|
dagger -e netlify up
|
|
|
|
}
|
|
|
|
|
2021-06-16 10:00:01 +02:00
|
|
|
@test "git" {
|
|
|
|
dagger -e git up
|
|
|
|
}
|
|
|
|
|
2021-06-23 12:46:56 +02:00
|
|
|
@test "os.#Container" {
|
|
|
|
dagger -e os-container up
|
|
|
|
}
|
|
|
|
|
2021-06-09 21:08:03 +02:00
|
|
|
@test "aws: ecr" {
|
2021-06-10 00:44:58 +02:00
|
|
|
dagger -e aws-ecr up
|
2021-06-09 21:08:03 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@test "aws: s3" {
|
2021-06-10 00:44:58 +02:00
|
|
|
dagger -e aws-s3 up
|
2021-06-09 21:08:03 +02:00
|
|
|
}
|
|
|
|
|
2021-06-18 18:03:59 +02:00
|
|
|
@test "aws: eks" {
|
|
|
|
dagger -e aws-eks up
|
|
|
|
}
|
|
|
|
|
2021-06-09 21:08:03 +02:00
|
|
|
@test "docker run: local" {
|
2021-06-10 00:44:58 +02:00
|
|
|
dagger -e docker-run-local up
|
2021-06-09 21:08:03 +02:00
|
|
|
}
|
|
|
|
|
2021-06-18 18:03:59 +02:00
|
|
|
@test "docker build" {
|
|
|
|
dagger -e docker-build up
|
|
|
|
}
|
|
|
|
|
2021-06-11 09:53:14 +02:00
|
|
|
@test "docker command: ssh" {
|
2021-06-11 19:01:33 +02:00
|
|
|
dagger -e docker-command-ssh up
|
2021-06-11 09:53:14 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@test "docker command: ssh with key passphrase" {
|
2021-06-11 19:01:33 +02:00
|
|
|
dagger -e docker-command-ssh-key-passphrase up
|
2021-06-11 09:53:14 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@test "docker command: ssh with wrong key passphrase" {
|
2021-06-11 19:01:33 +02:00
|
|
|
run dagger -e docker-command-ssh-wrong-key-passphrase up
|
|
|
|
assert_failure
|
2021-06-11 09:53:14 +02:00
|
|
|
}
|
|
|
|
|
2021-06-09 21:08:03 +02:00
|
|
|
@test "docker run: ssh" {
|
2021-06-10 00:44:58 +02:00
|
|
|
dagger -e docker-run-ssh up
|
2021-06-09 21:08:03 +02:00
|
|
|
}
|
|
|
|
|
2021-06-18 18:03:59 +02:00
|
|
|
@test "kubernetes: deployment" {
|
|
|
|
skip_unless_local_kube
|
|
|
|
|
2021-06-18 19:15:48 +02:00
|
|
|
# Copy deployment to sandbox
|
|
|
|
copy_to_sandbox kubernetes-deployment
|
|
|
|
|
2021-06-18 18:03:59 +02:00
|
|
|
# Set kubeconfig
|
2021-06-18 19:15:48 +02:00
|
|
|
dagger -w "$DAGGER_SANDBOX" -e kubernetes-deployment input text TestKubeconfig -f "$HOME"/.kube/config
|
2021-06-18 18:03:59 +02:00
|
|
|
|
2021-06-18 19:15:48 +02:00
|
|
|
dagger -w "$DAGGER_SANDBOX" -e kubernetes-deployment up
|
2021-06-18 18:03:59 +02:00
|
|
|
|
|
|
|
# Unset kubeconfig
|
2021-06-18 19:15:48 +02:00
|
|
|
dagger -w "$DAGGER_SANDBOX" -e kubernetes-deployment input unset TestKubeconfig
|
2021-06-18 18:03:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@test "kubernetes: kustomize" {
|
|
|
|
dagger -e kubernetes-kustomize up
|
|
|
|
}
|
|
|
|
|
|
|
|
@test "kubernetes: helm" {
|
|
|
|
skip_unless_local_kube
|
|
|
|
|
2021-06-18 19:15:48 +02:00
|
|
|
# Copy deployment to sandbox
|
|
|
|
copy_to_sandbox kubernetes-helm kubernetes
|
|
|
|
|
2021-06-18 18:03:59 +02:00
|
|
|
# Set kubeconfig
|
2021-06-18 19:15:48 +02:00
|
|
|
dagger -w "$DAGGER_SANDBOX" -e kubernetes-helm input text TestKubeconfig -f "$HOME"/.kube/config
|
2021-06-18 18:03:59 +02:00
|
|
|
|
2021-06-18 19:15:48 +02:00
|
|
|
dagger -w "$DAGGER_SANDBOX" -e kubernetes-helm up
|
2021-06-18 18:03:59 +02:00
|
|
|
|
|
|
|
# Unset kubeconfig
|
2021-06-18 19:15:48 +02:00
|
|
|
dagger -w "$DAGGER_SANDBOX" -e kubernetes-helm input unset TestKubeconfig
|
2021-06-18 18:03:59 +02:00
|
|
|
}
|
|
|
|
|
2021-06-09 21:08:03 +02:00
|
|
|
@test "google cloud: gcr" {
|
2021-06-10 00:44:58 +02:00
|
|
|
dagger -e google-gcr up
|
2021-06-09 21:08:03 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@test "google cloud: gke" {
|
2021-06-10 00:44:58 +02:00
|
|
|
dagger -e google-gke up
|
2021-06-09 21:08:03 +02:00
|
|
|
}
|
2021-06-18 18:03:59 +02:00
|
|
|
|
|
|
|
@test "terraform" {
|
|
|
|
# it must fail because of a missing var
|
|
|
|
run dagger -e terraform up
|
|
|
|
assert_failure
|
|
|
|
|
2021-06-18 19:15:48 +02:00
|
|
|
# Copy deployment to sandbox
|
|
|
|
copy_to_sandbox terraform terraform
|
|
|
|
|
2021-06-18 18:03:59 +02:00
|
|
|
# Add the var and try again
|
2021-06-18 19:15:48 +02:00
|
|
|
run dagger -w "$DAGGER_SANDBOX" -e terraform input text TestTerraform.apply.tfvars.input "42"
|
|
|
|
run dagger -w "$DAGGER_SANDBOX" -e terraform up
|
2021-06-18 18:03:59 +02:00
|
|
|
assert_success
|
|
|
|
|
|
|
|
# ensure the tfvar was passed correctly
|
2021-06-18 19:15:48 +02:00
|
|
|
run dagger -w "$DAGGER_SANDBOX" query -e terraform TestTerraform.apply.output.input.value -f text
|
2021-06-18 18:03:59 +02:00
|
|
|
assert_success
|
|
|
|
assert_output "42"
|
|
|
|
|
|
|
|
# ensure the random value is always the same
|
|
|
|
# this proves we're effectively using the s3 backend
|
2021-06-18 19:15:48 +02:00
|
|
|
run dagger -w "$DAGGER_SANDBOX" query -e terraform TestTerraform.apply.output.random.value -f json
|
2021-06-18 18:03:59 +02:00
|
|
|
assert_success
|
|
|
|
assert_output "36"
|
|
|
|
|
|
|
|
# Unset input
|
2021-06-18 19:15:48 +02:00
|
|
|
run dagger -w "$DAGGER_SANDBOX" -e terraform input unset TestTerraform.apply.tfvars.input
|
2021-06-18 18:03:59 +02:00
|
|
|
assert_success
|
2021-06-09 20:37:05 +02:00
|
|
|
}
|