Skip to content

Commit dded2bd

Browse files
committed
helm setup to run tests
1 parent a6ced22 commit dded2bd

File tree

1 file changed

+109
-19
lines changed

1 file changed

+109
-19
lines changed

.drone.star

+109-19
Original file line numberDiff line numberDiff line change
@@ -424,26 +424,27 @@ def main(ctx):
424424

425425
pipelines = []
426426

427-
build_release_helpers = \
428-
changelog() + \
429-
docs() + \
430-
licenseCheck(ctx)
427+
# build_release_helpers = \
428+
# changelog() + \
429+
# docs() + \
430+
# licenseCheck(ctx)
431431

432432
test_pipelines = \
433-
codestyle(ctx) + \
434-
checkGherkinLint(ctx) + \
435-
checkTestSuitesInExpectedFailures(ctx) + \
436-
buildWebCache(ctx) + \
437-
getGoBinForTesting(ctx) + \
438-
buildOcisBinaryForTesting(ctx) + \
439-
checkStarlark() + \
440-
build_release_helpers + \
441-
testOcisAndUploadResults(ctx) + \
442-
testPipelines(ctx)
443-
444-
build_release_pipelines = \
445-
dockerReleases(ctx) + \
446-
binaryReleases(ctx)
433+
deployments(ctx)
434+
# codestyle(ctx) + \
435+
# checkGherkinLint(ctx) + \
436+
# checkTestSuitesInExpectedFailures(ctx) + \
437+
# buildWebCache(ctx) + \
438+
# getGoBinForTesting(ctx) + \
439+
# buildOcisBinaryForTesting(ctx) + \
440+
# checkStarlark() + \
441+
# build_release_helpers + \
442+
# testOcisAndUploadResults(ctx) + \
443+
# testPipelines(ctx) + \
444+
445+
# build_release_pipelines = \
446+
# dockerReleases(ctx) + \
447+
# binaryReleases(ctx)
447448

448449
test_pipelines.append(
449450
pipelineDependsOn(
@@ -459,7 +460,7 @@ def main(ctx):
459460
),
460461
)
461462

462-
pipelines = test_pipelines + build_release_pipelines
463+
pipelines = deployments(ctx) #test_pipelines + build_release_pipelines
463464

464465
if ctx.build.event == "cron":
465466
pipelines = \
@@ -3535,3 +3536,92 @@ def onlyofficeService():
35353536
],
35363537
},
35373538
]
3539+
3540+
def deployments(ctx):
3541+
result = {
3542+
"kind": "pipeline",
3543+
"type": "docker",
3544+
"name": "k3d",
3545+
"privileged": True,
3546+
"steps": wait(ctx) + install(ctx) + showPodsAfterInstall(ctx),
3547+
"services": [
3548+
{
3549+
"name": "k3d",
3550+
"image": "ghcr.io/k3d-io/k3d:5-dind",
3551+
"user": "root",
3552+
"commands": [
3553+
"git clone https://github.com/owncloud/ocis-charts.git",
3554+
"cd ocis-charts",
3555+
"nohup dockerd-entrypoint.sh &",
3556+
"until docker ps 2>&1 > /dev/null; do sleep 1s; done",
3557+
"k3d cluster create --config ci/k3d-drone.yaml --api-port k3d:6445",
3558+
"until kubectl get deployment coredns -n kube-system -o go-template='{{.status.availableReplicas}}' | grep -v -e '<no value>'; do sleep 1s; done",
3559+
"k3d kubeconfig get drone > kubeconfig-$${DRONE_BUILD_NUMBER}.yaml",
3560+
"chmod 0600 kubeconfig-$${DRONE_BUILD_NUMBER}.yaml",
3561+
"printf '@@@@@@@@@@@@@@@@@@@@@@@\n@@@@ k3d is ready @@@@\n@@@@@@@@@@@@@@@@@@@@@@@\n'",
3562+
"kubectl get events -Aw",
3563+
],
3564+
},
3565+
],
3566+
"depends_on": [],
3567+
"volumes": [
3568+
{
3569+
"name": "gopath",
3570+
"temp": {},
3571+
},
3572+
],
3573+
"trigger": {
3574+
"ref": [
3575+
"refs/pull/**",
3576+
],
3577+
},
3578+
}
3579+
3580+
result["trigger"]["ref"].append("refs/heads/master")
3581+
3582+
return [result]
3583+
3584+
def wait(config):
3585+
return [{
3586+
"name": "wait",
3587+
"image": "docker.io/bitnami/kubectl:1.31",
3588+
"user": "root",
3589+
"commands": [
3590+
"export KUBECONFIG=kubeconfig-$${DRONE_BUILD_NUMBER}.yaml",
3591+
# "until test -f $${KUBECONFIG}; do sleep 1s; done",
3592+
"timeout=10; while ! until test -f $${KUBECONFIG} > /dev/null 2>&1; do ((timeout--)) || { echo 'Timed out'; exit 1; }; sleep 1; done;",
3593+
"kubectl config view",
3594+
"kubectl get pods -A",
3595+
],
3596+
}]
3597+
3598+
def showPodsAfterInstall(config):
3599+
return [{
3600+
"name": "testPodsAfterInstall",
3601+
"image": "docker.io/bitnami/kubectl:1.31",
3602+
"user": "root",
3603+
"commands": [
3604+
"export KUBECONFIG=kubeconfig-$${DRONE_BUILD_NUMBER}.yaml",
3605+
"until test -f $${KUBECONFIG}; do sleep 1s; done",
3606+
"kubectl get pods -n ocis",
3607+
"if [ \"$(kubectl get pods -n ocis --field-selector status.phase=Running | wc -l)\" -le \"32\" ]; then exit 1; fi", # there are 32 pods + 1 header line
3608+
"kubectl get ingress -n ocis",
3609+
"if [ \"$(kubectl get ingress -n ocis | wc -l)\" -le \"1\" ]; then exit 1; fi",
3610+
],
3611+
}]
3612+
3613+
def install(ctx):
3614+
return [{
3615+
"name": "helm-install",
3616+
"image": "owncloudci/golang:latest",
3617+
"commands": [
3618+
"export KUBECONFIG=kubeconfig-$${DRONE_BUILD_NUMBER}.yaml",
3619+
"make helm-install-atomic",
3620+
],
3621+
"volumes": [
3622+
{
3623+
"name": "gopath",
3624+
"path": "/go",
3625+
},
3626+
],
3627+
}]

0 commit comments

Comments
 (0)