Skip to content

Commit

Permalink
Remove more excess starlark code
Browse files Browse the repository at this point in the history
  • Loading branch information
phil-davis committed Jun 15, 2023
1 parent a5a931e commit 9670c2c
Showing 1 changed file with 0 additions and 80 deletions.
80 changes: 0 additions & 80 deletions .drone.star
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ OC_CI_BAZEL_BUILDIFIER = "owncloudci/bazel-buildifier"
OC_CI_CORE = "owncloudci/core"
OC_CI_DRONE_CANCEL_PREVIOUS_BUILDS = "owncloudci/drone-cancel-previous-builds"
OC_CI_DRONE_SKIP_PIPELINE = "owncloudci/drone-skip-pipeline"
OC_CI_ORACLE_XE = "owncloudci/oracle-xe:latest"
OC_CI_PHP = "owncloudci/php:%s"
OC_UBUNTU = "owncloud/ubuntu:20.04"
PLUGINS_S3 = "plugins/s3"
Expand Down Expand Up @@ -372,15 +371,11 @@ def phpTests(ctx, testType, withCoverage):
errorFound = False

# The default PHP unit test settings for a PR.
# Note: do not run Oracle by default in PRs.
prDefault = {
"phpVersions": [DEFAULT_PHP_VERSION],
"servers": ["daily-master-qa"],
"databases": [
"sqlite",
"mariadb:10.2",
"mysql:8.0",
"postgres:9.4",
],
"coverage": True,
"includeKeyInMatrixName": False,
Expand All @@ -397,10 +392,6 @@ def phpTests(ctx, testType, withCoverage):
"servers": ["daily-master-qa"],
"databases": [
"sqlite",
"mariadb:10.2",
"mysql:8.0",
"postgres:9.4",
"oracle",
],
"coverage": True,
"includeKeyInMatrixName": False,
Expand Down Expand Up @@ -502,8 +493,6 @@ def phpTests(ctx, testType, withCoverage):
],
},
],
"services": databaseService(db) +
params["extraServices"],
"depends_on": [],
"trigger": {
"ref": [
Expand Down Expand Up @@ -691,79 +680,19 @@ def notify():

return result

def databaseService(db):
dbName = getDbName(db)
if (dbName == "mariadb") or (dbName == "mysql"):
service = {
"name": dbName,
"image": db,
"environment": {
"MYSQL_USER": getDbUsername(db),
"MYSQL_PASSWORD": getDbPassword(db),
"MYSQL_DATABASE": getDbDatabase(db),
"MYSQL_ROOT_PASSWORD": getDbRootPassword(),
},
}
if (db == "mysql:8.0"):
service["command"] = ["--default-authentication-plugin=mysql_native_password"]
return [service]

if dbName == "postgres":
return [{
"name": dbName,
"image": db,
"environment": {
"POSTGRES_USER": getDbUsername(db),
"POSTGRES_PASSWORD": getDbPassword(db),
"POSTGRES_DB": getDbDatabase(db),
},
}]

if dbName == "oracle":
return [{
"name": dbName,
"image": OC_CI_ORACLE_XE,
"environment": {
"ORACLE_USER": getDbUsername(db),
"ORACLE_PASSWORD": getDbPassword(db),
"ORACLE_DB": getDbDatabase(db),
"ORACLE_DISABLE_ASYNCH_IO": "true",
},
}]

return []

def getDbName(db):
return db.split(":")[0]

def getDbUsername(db):
name = getDbName(db)

# The Oracle image has the Db Username hardcoded
if name == "oracle":
return "autotest"

return "owncloud"

def getDbPassword(db):
name = getDbName(db)

# The Oracle image has the Db Password hardcoded
if name == "oracle":
return "owncloud"

return "owncloud"

def getDbRootPassword():
return "owncloud"

def getDbDatabase(db):
name = getDbName(db)

# The Oracle image has the Db Name hardcoded
if name == "oracle":
return "XE"

return "owncloud"

def cacheRestore():
Expand Down Expand Up @@ -810,15 +739,6 @@ def installCore(ctx, version, db, useBundledApp):
password = getDbPassword(db)
database = getDbDatabase(db)

if host == "mariadb":
dbType = "mysql"

if host == "postgres":
dbType = "pgsql"

if host == "oracle":
dbType = "oci"

stepDefinition = {
"name": "install-core",
"image": OC_CI_CORE,
Expand Down

0 comments on commit 9670c2c

Please sign in to comment.