Skip to content

Commit 0136bee

Browse files
committed
helm setup to run tests
1 parent 7a2434a commit 0136bee

File tree

1 file changed

+116
-27
lines changed

1 file changed

+116
-27
lines changed

.drone.star

+116-27
Original file line numberDiff line numberDiff line change
@@ -424,35 +424,36 @@ 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)
447-
448-
test_pipelines.append(
449-
pipelineDependsOn(
450-
purgeBuildArtifactCache(ctx),
451-
testPipelines(ctx),
452-
),
453-
)
454-
455-
pipelines = test_pipelines + build_release_pipelines
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)
448+
449+
# test_pipelines.append(
450+
# pipelineDependsOn(
451+
# purgeBuildArtifactCache(ctx),
452+
# testPipelines(ctx),
453+
# ),
454+
# )
455+
456+
pipelines = deployments(ctx) #test_pipelines + build_release_pipelines
456457

457458
if ctx.build.event == "cron":
458459
pipelines = \
@@ -3409,3 +3410,91 @@ def onlyofficeService():
34093410
],
34103411
},
34113412
]
3413+
3414+
def deployments(ctx):
3415+
result = {
3416+
"kind": "pipeline",
3417+
"type": "docker",
3418+
"name": "k3d",
3419+
"privileged": True,
3420+
"steps": wait(ctx) + install(ctx) + showPodsAfterInstall(ctx),
3421+
"services": [
3422+
{
3423+
"name": "k3d",
3424+
"image": "ghcr.io/k3d-io/k3d:5-dind",
3425+
"user": "root",
3426+
"commands": [
3427+
"git clone https://github.com/owncloud/ocis-charts.git",
3428+
"cd ocis-charts",
3429+
"nohup dockerd-entrypoint.sh &",
3430+
"until docker ps 2>&1 > /dev/null; do sleep 1s; done",
3431+
"k3d cluster create --config ci/k3d-drone.yaml --api-port k3d:6445",
3432+
"until kubectl get deployment coredns -n kube-system -o go-template='{{.status.availableReplicas}}' | grep -v -e '<no value>'; do sleep 1s; done",
3433+
"k3d kubeconfig get drone > kubeconfig-$${DRONE_BUILD_NUMBER}.yaml",
3434+
"chmod 0600 kubeconfig-$${DRONE_BUILD_NUMBER}.yaml",
3435+
"printf '@@@@@@@@@@@@@@@@@@@@@@@\n@@@@ k3d is ready @@@@\n@@@@@@@@@@@@@@@@@@@@@@@\n'",
3436+
"kubectl get events -Aw",
3437+
],
3438+
},
3439+
],
3440+
"depends_on": [],
3441+
"volumes": [
3442+
{
3443+
"name": "gopath",
3444+
"temp": {},
3445+
},
3446+
],
3447+
"trigger": {
3448+
"ref": [
3449+
"refs/pull/**",
3450+
],
3451+
},
3452+
}
3453+
3454+
result["trigger"]["ref"].append("refs/heads/master")
3455+
3456+
return [result]
3457+
3458+
def wait(config):
3459+
return [{
3460+
"name": "wait",
3461+
"image": "docker.io/bitnami/kubectl:1.31",
3462+
"user": "root",
3463+
"commands": [
3464+
"export KUBECONFIG=kubeconfig-$${DRONE_BUILD_NUMBER}.yaml",
3465+
"until test -f $${KUBECONFIG}; do sleep 1s; done",
3466+
"kubectl config view",
3467+
"kubectl get pods -A",
3468+
],
3469+
}]
3470+
3471+
def showPodsAfterInstall(config):
3472+
return [{
3473+
"name": "testPodsAfterInstall",
3474+
"image": "docker.io/bitnami/kubectl:1.31",
3475+
"user": "root",
3476+
"commands": [
3477+
"export KUBECONFIG=kubeconfig-$${DRONE_BUILD_NUMBER}.yaml",
3478+
"until test -f $${KUBECONFIG}; do sleep 1s; done",
3479+
"kubectl get pods -n ocis",
3480+
"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
3481+
"kubectl get ingress -n ocis",
3482+
"if [ \"$(kubectl get ingress -n ocis | wc -l)\" -le \"1\" ]; then exit 1; fi",
3483+
],
3484+
}]
3485+
3486+
def install(ctx):
3487+
return [{
3488+
"name": "helm-install",
3489+
"image": "owncloudci/golang:latest",
3490+
"commands": [
3491+
"export KUBECONFIG=kubeconfig-$${DRONE_BUILD_NUMBER}.yaml",
3492+
"make helm-install-atomic",
3493+
],
3494+
"volumes": [
3495+
{
3496+
"name": "gopath",
3497+
"path": "/go",
3498+
},
3499+
],
3500+
}]

0 commit comments

Comments
 (0)