Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tests-only][full-ci] use separate web config file for keycloak pipeline #10632

Merged
merged 6 commits into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 16 additions & 41 deletions .drone.star
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ NOTIFICATIONS = 3

ALPINE_GIT = "alpine/git:latest"
APACHE_TIKA = "apache/tika:2.8.0.0"
KEYCLOAK = "quay.io/keycloak/keycloak:22.0.4"
KEYCLOAK = "quay.io/keycloak/keycloak:24.0.1"
MINIO_MC = "minio/mc:RELEASE.2021-10-07T04-19-58Z"
OC_CI_ALPINE = "owncloudci/alpine:latest"
OC_CI_BAZEL_BUILDIFIER = "owncloudci/bazel-buildifier"
OC_CI_CORE_NODEJS = "owncloudci/core:nodejs14"
OC_CI_DRONE_ANSIBLE = "owncloudci/drone-ansible:latest"
OC_CI_DRONE_SKIP_PIPELINE = "owncloudci/drone-skip-pipeline"
OC_CI_GOLANG = "owncloudci/golang:1.22"
Expand Down Expand Up @@ -43,9 +42,9 @@ dir = {
"ocis": "/var/www/owncloud/ocis",
"commentsFile": "/var/www/owncloud/web/comments.file",
"app": "/srv/app",
"config": "/srv/config",
"ocisConfig": "/srv/config/drone/config-ocis.json",
"ocisIdentifierRegistrationConfig": "/srv/config/drone/identifier-registration.yml",
"ocisConfig": "/var/www/owncloud/web/tests/drone/config-ocis.json",
"webKeycloakConfig": "/var/www/owncloud/web/tests/drone/web-keycloak.json",
"ocisIdentifierRegistrationConfig": "/var/www/owncloud/web/tests/drone/identifier-registration.yml",
"ocisRevaDataRoot": "/srv/app/tmp/ocis/owncloud/data/",
"testingDataDir": "/srv/app/testing/data/",
}
Expand Down Expand Up @@ -219,9 +218,6 @@ go_step_volumes = [{
}, {
"name": "gopath",
"path": "/go",
}, {
"name": "configs",
"path": dir["config"],
}]

web_workspace = {
Expand Down Expand Up @@ -680,8 +676,7 @@ def e2eTests(ctx):
restoreBuildArtifactCache(ctx, "playwright", ".playwright") + \
installPnpm() + \
installPlaywright() + \
restoreBuildArtifactCache(ctx, "web-dist", "dist") + \
setupServerConfigureWeb(params["logLevel"])
restoreBuildArtifactCache(ctx, "web-dist", "dist")

if ctx.build.event == "cron":
steps += restoreBuildArtifactCache(ctx, "ocis", "ocis")
Expand Down Expand Up @@ -817,7 +812,6 @@ def acceptance(ctx):
# TODO: don't start services if we skip it -> maybe we need to convert them to steps
steps += skipIfUnchanged(ctx, "acceptance-tests")
steps += restoreBuildArtifactCache(ctx, "web-dist", "dist")
steps += setupServerConfigureWeb(params["logLevel"])

services = browserService(alternateSuiteName, browser) + middlewareService()

Expand Down Expand Up @@ -1234,16 +1228,19 @@ def ocisService(type, tika_enabled = False, enforce_password_public_link = False
environment["GRAPH_ASSIGN_DEFAULT_USER_ROLE"] = "false"
environment["GRAPH_USERNAME_MATCH"] = "none"

if type == "app-provider":
# TODO: after ocis issue is fixed
# - use config from dir["ocisConfig"]
# - remove config file from dir["webKeycloakConfig"]
# issue: https://github.com/owncloud/ocis/issues/8703
environment["WEB_UI_CONFIG_FILE"] = "%s" % dir["webKeycloakConfig"]
elif type == "app-provider":
environment["GATEWAY_GRPC_ADDR"] = "0.0.0.0:9142"
environment["MICRO_REGISTRY"] = "nats-js-kv"
environment["MICRO_REGISTRY_ADDRESS"] = "0.0.0.0:9233"
environment["NATS_NATS_HOST"] = "0.0.0.0"
environment["NATS_NATS_PORT"] = 9233
else:
environment["WEB_UI_CONFIG_FILE"] = "%s" % dir["ocisConfig"]
environment["STORAGE_HOME_DRIVER"] = "ocis"
environment["STORAGE_USERS_DRIVER"] = "ocis"

if tika_enabled:
environment["FRONTEND_FULL_TEXT_SEARCH_ENABLED"] = True
Expand Down Expand Up @@ -1275,9 +1272,6 @@ def ocisService(type, tika_enabled = False, enforce_password_public_link = False
"volumes": [{
"name": "gopath",
"path": dir["app"],
}, {
"name": "configs",
"path": dir["config"],
}, {
"name": "ocis-config",
"path": "/root/.ocis/config",
Expand Down Expand Up @@ -1310,21 +1304,6 @@ def checkForExistingOcisCache(ctx):
},
]

def setupServerConfigureWeb(logLevel):
return [{
"name": "setup-server-configure-web",
"image": OC_CI_PHP,
"commands": [
"mkdir -p /srv/config",
"cp -r %s/tests/drone /srv/config" % dir["web"],
"ls -la /srv/config/drone",
],
"volumes": [{
"name": "configs",
"path": dir["config"],
}],
}]

def copyFilesForUpload():
return [{
"name": "copy-files-for-upload",
Expand Down Expand Up @@ -1378,9 +1357,6 @@ def runWebuiAcceptanceTests(ctx, suite, alternateSuiteName, filterTags, extraEnv
"volumes": [{
"name": "gopath",
"path": dir["app"],
}, {
"name": "configs",
"path": dir["config"],
}],
}]

Expand Down Expand Up @@ -2269,10 +2245,9 @@ def keycloakService():
return [
{
"name": "generate-keycloak-certs",
"image": OC_UBUNTU,
"image": OC_CI_NODEJS,
"commands": [
"apt install openssl -y",
"mkdir keycloak-certs",
"mkdir -p keycloak-certs",
"openssl req -x509 -newkey rsa:2048 -keyout keycloak-certs/keycloakkey.pem -out keycloak-certs/keycloakcrt.pem -nodes -days 365 -subj '/CN=keycloak'",
"chmod -R 777 keycloak-certs",
],
Expand Down Expand Up @@ -2310,7 +2285,7 @@ def keycloakService():
"commands": [
"mkdir -p /opt/keycloak/data/import",
"cp tests/drone/ocis_keycloak/ocis-ci-realm.dist.json /opt/keycloak/data/import/ocis-realm.json",
"/opt/keycloak/bin/kc.sh start-dev --proxy edge --spi-connections-http-client-default-disable-trust-manager=false --import-realm --health-enabled=true",
"/opt/keycloak/bin/kc.sh start-dev --proxy=edge --spi-connections-http-client-default-disable-trust-manager=true --import-realm --health-enabled=true",
],
"volumes": [
{
Expand Down Expand Up @@ -2351,6 +2326,7 @@ def e2eTestsOnKeycloak(ctx):
"temp": {},
},
]

if not "full-ci" in ctx.build.title.lower() and ctx.build.event != "cron":
return []

Expand All @@ -2359,8 +2335,7 @@ def e2eTestsOnKeycloak(ctx):
installPnpm() + \
installPlaywright() + \
keycloakService() + \
restoreBuildArtifactCache(ctx, "web-dist", "dist") + \
setupServerConfigureWeb("2")
restoreBuildArtifactCache(ctx, "web-dist", "dist")
if ctx.build.event == "cron":
steps += restoreBuildArtifactCache(ctx, "ocis", "ocis")
else:
Expand Down
Loading