@@ -329,6 +329,7 @@ config = {
329329 ],
330330 "skip" : False ,
331331 "withRemotePhp" : [False ],
332+ "k8s" : True ,
332333 },
333334 "4" : {
334335 "suites" : [
@@ -1103,7 +1104,7 @@ def localApiTestPipeline(ctx):
11031104 params [item ] = matrix [item ] if item in matrix else defaults [item ]
11041105 for storage in params ["storages" ]:
11051106 for run_with_remote_php in params ["withRemotePhp" ]:
1106- run_on_k8s = params ["k8s" ] and ctx . build . event == "cron"
1107+ run_on_k8s = params ["k8s" ]
11071108 ocis_url = OCIS_URL
11081109 if run_on_k8s :
11091110 ocis_url = "https://%s" % OCIS_SERVER_NAME
@@ -1120,7 +1121,7 @@ def localApiTestPipeline(ctx):
11201121 ([] if run_on_k8s else restoreBuildArtifactCache (ctx , "ocis-binary-amd64" , "ocis/bin" )) +
11211122 (tikaService () if params ["tikaNeeded" ] and not run_on_k8s else tikaServiceK8s () if params ["tikaNeeded" ] and run_on_k8s else []) +
11221123 (waitForServices ("online-offices" , ["collabora:9980" , "onlyoffice:443" , "fakeoffice:8080" ]) if params ["collaborationServiceNeeded" ] else []) +
1123- (waitK3sCluster () + (enableAntivirusServiceK8s () if params ["antivirusNeeded" ] and run_on_k8s else []) + (emailServiceK8s () if params ["emailNeeded" ] and run_on_k8s else []) + prepareOcisDeployment (name ) + setupOcisConfigMaps (name ) + deployOcis () + waitForOcis (ocis_url = ocis_url ) + ociswrapper () + waitForOciswrapper () if run_on_k8s else ocisServer (storage , extra_server_environment = params ["extraServerEnvironment" ], with_wrapper = True , tika_enabled = params ["tikaNeeded" ], volumes = ([stepVolumeOcisStorage ]))) +
1124+ (waitK3sCluster () + (enableAntivirusServiceK8s () if params ["antivirusNeeded" ] and run_on_k8s else []) + (emailServiceK8s () if params ["emailNeeded" ] and run_on_k8s else []) + prepareOcisDeployment () + setupOcisConfigMaps () + deployOcis () + waitForOcis (ocis_url = ocis_url ) + ociswrapper () + waitForOciswrapper () if run_on_k8s else ocisServer (storage , extra_server_environment = params ["extraServerEnvironment" ], with_wrapper = True , tika_enabled = params ["tikaNeeded" ], volumes = ([stepVolumeOcisStorage ]))) +
11241125 (waitForClamavService () if params ["antivirusNeeded" ] and not run_on_k8s else exposeAntivirusServiceK8s () if params ["antivirusNeeded" ] and run_on_k8s else []) +
11251126 (waitForEmailService () if params ["emailNeeded" ] and not run_on_k8s else exposeEmailServiceK8s () if params ["emailNeeded" ] and run_on_k8s else []) +
11261127 (ocisServer (storage , deploy_type = "federation" , extra_server_environment = params ["extraServerEnvironment" ]) if params ["federationServer" ] else []) +
@@ -1405,7 +1406,7 @@ def coreApiTestPipeline(ctx):
14051406 for run_with_remote_php in params ["withRemotePhp" ]:
14061407 filter_tags = "~@skipOnGraph&&~@skipOnOcis-%s-Storage" % ("OC" if storage == "owncloud" else "OCIS" )
14071408 expected_failures_file = "%s/expected-failures-API-on-%s-storage.md" % (test_dir , storage .upper ())
1408- run_on_k8s = params ["k8s" ] and ctx . build . event == "cron"
1409+ run_on_k8s = params ["k8s" ]
14091410 ocis_url = OCIS_URL
14101411 if run_on_k8s :
14111412 ocis_url = "https://%s" % OCIS_SERVER_NAME
@@ -1422,7 +1423,7 @@ def coreApiTestPipeline(ctx):
14221423 (tikaService () if params ["tikaNeeded" ] else []) +
14231424 (waitForClamavService () if params ["antivirusNeeded" ] else []) +
14241425 (waitForEmailService () if params ["emailNeeded" ] else []) +
1425- (waitK3sCluster () + prepareOcisDeployment (name ) + setupOcisConfigMaps (name ) + deployOcis () + waitForOcis (ocis_url = ocis_url ) + ociswrapper () + waitForOciswrapper () if run_on_k8s else ocisServer (storage , extra_server_environment = params ["extraServerEnvironment" ], with_wrapper = True , tika_enabled = params ["tikaNeeded" ], volumes = ([stepVolumeOcisStorage ]))) +
1426+ (waitK3sCluster () + prepareOcisDeployment () + setupOcisConfigMaps () + deployOcis () + waitForOcis (ocis_url = ocis_url ) + ociswrapper () + waitForOciswrapper () if run_on_k8s else ocisServer (storage , extra_server_environment = params ["extraServerEnvironment" ], with_wrapper = True , tika_enabled = params ["tikaNeeded" ], volumes = ([stepVolumeOcisStorage ]))) +
14261427 [
14271428 {
14281429 "name" : "run-api-tests" ,
@@ -3824,7 +3825,7 @@ def waitK3sCluster():
38243825 ],
38253826 }]
38263827
3827- def prepareOcisDeployment (suite_name = "" ):
3828+ def prepareOcisDeployment ():
38283829 commands = [
38293830 "make -C %s build" % dirs ["ocisWrapper" ],
38303831 "mv %s/tests/config/drone/k8s/values.yaml %s/ocis-charts/charts/ocis/ci/deployment-values.yaml" % (dirs ["base" ], dirs ["base" ]),
@@ -3834,18 +3835,16 @@ def prepareOcisDeployment(suite_name = ""):
38343835 "sed -i '/- name: IDM_ADMIN_PASSWORD/{n;N;N;N;d;}' ./charts/ocis/templates/idm/deployment.yaml" ,
38353836 "sed -i '/- name: IDM_ADMIN_PASSWORD/a\\ \\ \\ n value: \" admin\" ' ./charts/ocis/templates/idm/deployment.yaml" ,
38363837 "sed -i '/- name: PROXY_HTTP_ADDR/i\\ \\ - name: PROXY_ENABLE_BASIC_AUTH\\ \n value: \" true\" ' ./charts/ocis/templates/proxy/deployment.yaml" ,
3838+ "sed -i 's|/etc/ocis/sharing-banned-passwords.txt|config/drone/banned-password-list.txt|' ./charts/ocis/templates/sharing/deployment.yaml" ,
3839+ "sed -i 's|- name: configs|- name: banned-passwords|' ./charts/ocis/templates/sharing/deployment.yaml" ,
3840+ "sed -i 's|mountPath: /etc/ocis$|mountPath: /etc/ocis/config/drone|' ./charts/ocis/templates/sharing/deployment.yaml" ,
3841+ "sed -i 's|name: sharing-banned-passwords-{{ .appName }}|name: sharing-banned-passwords|' ./charts/ocis/templates/sharing/deployment.yaml" ,
3842+ "sed -i 's|/etc/ocis/sharing-banned-passwords.txt|config/drone/banned-password-list.txt|' ./charts/ocis/templates/frontend/deployment.yaml" ,
3843+ "sed -i 's|- name: configs|- name: banned-passwords|' ./charts/ocis/templates/frontend/deployment.yaml" ,
3844+ "sed -i 's|mountPath: /etc/ocis$|mountPath: /etc/ocis/config/drone|' ./charts/ocis/templates/frontend/deployment.yaml" ,
3845+ "sed -i 's|name: sharing-banned-passwords-{{ .appName }}|name: sharing-banned-passwords|' ./charts/ocis/templates/frontend/deployment.yaml" ,
38373846 ]
38383847
3839- # Only add banned password patches for sharingNgLinkShare suite
3840- if suite_name == "sharingNgLinkShare" :
3841- commands .extend ([
3842- # Patch sharing deployment for banned password list
3843- "sed -i 's|/etc/ocis/sharing-banned-passwords.txt|/etc/ocis/config/drone/banned-password-list.txt|' ./charts/ocis/templates/sharing/deployment.yaml" ,
3844- "sed -i 's|- name: configs|- name: banned-passwords|' ./charts/ocis/templates/sharing/deployment.yaml" ,
3845- "sed -i 's|mountPath: /etc/ocis$|mountPath: /etc/ocis/config/drone|' ./charts/ocis/templates/sharing/deployment.yaml" ,
3846- "sed -i 's|name: sharing-banned-passwords-{{ .appName }}|name: sharing-banned-passwords|' ./charts/ocis/templates/sharing/deployment.yaml" ,
3847- ])
3848-
38493848 return [{
38503849 "name" : "prepare-ocis-deployment" ,
38513850 "image" : "owncloudci/golang:latest" ,
@@ -3858,19 +3857,14 @@ def prepareOcisDeployment(suite_name = ""):
38583857 ],
38593858 }]
38603859
3861- def setupOcisConfigMaps (suite_name = "" ):
3860+ def setupOcisConfigMaps ():
38623861 commands = [
38633862 "export KUBECONFIG=%s/kubeconfig-$${DRONE_BUILD_NUMBER}.yaml" % dirs ["base" ],
38643863 # Create namespace for oCIS deployment
38653864 "kubectl create namespace ocis || true" ,
3865+ "kubectl create configmap -n ocis sharing-banned-passwords --from-file=banned-password-list.txt=%s/tests/config/drone/banned-password-list.txt" % dirs ["base" ],
38663866 ]
38673867
3868- # Only create banned password ConfigMap for sharingNgLinkShare suite
3869- if suite_name == "sharingNgLinkShare" :
3870- commands .append (
3871- "kubectl create configmap -n ocis sharing-banned-passwords --from-file=banned-password-list.txt=%s/tests/config/drone/banned-password-list.txt" % dirs ["base" ],
3872- )
3873-
38743868 return [{
38753869 "name" : "setup-configmaps" ,
38763870 "image" : K3D_IMAGE ,
0 commit comments