Skip to content

Commit

Permalink
Merge pull request #51 from owncloud/ci-changes
Browse files Browse the repository at this point in the history
CI changes and dependency bumps
  • Loading branch information
phil-davis authored Jun 6, 2023
2 parents 58aac99 + efff52e commit 1ae99a4
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 17 deletions.
43 changes: 39 additions & 4 deletions .drone.star
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def main(ctx):
return before + coverageTests + afterCoverageTests + nonCoverageTests + stages + after

def beforePipelines(ctx):
return codestyle(ctx) + jscodestyle(ctx) + cancelPreviousBuilds() + phpstan(ctx) + phan(ctx) + phplint(ctx) + checkStarlark()
return validateDailyTarballBuild() + codestyle(ctx) + jscodestyle(ctx) + cancelPreviousBuilds() + phpstan(ctx) + phan(ctx) + phplint(ctx) + checkStarlark()

def coveragePipelines(ctx):
# All unit test pipelines that have coverage or other test analysis reported
Expand Down Expand Up @@ -870,6 +870,7 @@ def acceptance(ctx):
"databases": ["mariadb:10.2"],
"esVersions": ["none"],
"federatedServerNeeded": False,
"federatedServerVersion": "",
"filterTags": "",
"logLevel": "2",
"emailNeeded": False,
Expand Down Expand Up @@ -1105,8 +1106,12 @@ def acceptance(ctx):
environment["S3_TYPE"] = "ceph"
if (testConfig["scalityS3"] != False):
environment["S3_TYPE"] = "scality"

federationDbSuffix = "-federated"

if len(testConfig["federatedServerVersion"]) == 0:
testConfig["federatedServerVersion"] = testConfig["server"]

result = {
"kind": "pipeline",
"type": "docker",
Expand All @@ -1118,7 +1123,7 @@ def acceptance(ctx):
"steps": skipIfUnchanged(ctx, "acceptance-tests") +
installCore(ctx, testConfig["server"], testConfig["database"], testConfig["useBundledApp"]) +
installTestrunner(ctx, DEFAULT_PHP_VERSION, testConfig["useBundledApp"]) +
(installFederated(testConfig["server"], phpVersionForDocker, testConfig["logLevel"], testConfig["database"], federationDbSuffix) + owncloudLog("federated") if testConfig["federatedServerNeeded"] else []) +
(installFederated(testConfig["federatedServerVersion"], phpVersionForDocker, testConfig["logLevel"], testConfig["database"], federationDbSuffix) + owncloudLog("federated") if testConfig["federatedServerNeeded"] else []) +
installAppPhp(ctx, phpVersionForDocker) +
installAppJavaScript(ctx) +
installExtraApps(phpVersionForDocker, testConfig["extraApps"]) +
Expand Down Expand Up @@ -1159,7 +1164,7 @@ def acceptance(ctx):
testConfig["extraServices"] +
owncloudService(testConfig["server"], phpVersionForDocker, "server", dir["server"], testConfig["ssl"], testConfig["xForwardedFor"]) +
((
owncloudService(testConfig["server"], phpVersionForDocker, "federated", dir["federated"], testConfig["ssl"], testConfig["xForwardedFor"]) +
owncloudService(testConfig["federatedServerVersion"], phpVersionForDocker, "federated", dir["federated"], testConfig["ssl"], testConfig["xForwardedFor"]) +
databaseServiceForFederation(testConfig["database"], federationDbSuffix)
) if testConfig["federatedServerNeeded"] else []),
"depends_on": [],
Expand Down Expand Up @@ -1848,7 +1853,7 @@ def setupElasticSearch(esVersion):
"image": OC_CI_PHP % DEFAULT_PHP_VERSION,
"commands": [
"cd %s" % dir["server"],
"php occ config:app:set search_elastic servers --value elasticsearch",
"php occ config:app:set search_elastic servers --value http://elasticsearch:9200",
"php occ search:index:reset --force",
],
},
Expand Down Expand Up @@ -2229,3 +2234,33 @@ def skipIfUnchanged(ctx, type):
return [skip_step]

return []

def validateDailyTarballBuild():
if "validateDailyTarball" not in config:
return []

if not config["validateDailyTarball"]:
return []

pipeline = {
"kind": "pipeline",
"type": "docker",
"name": "check-tarball-build-date",
"steps": [{
"name": "check-build-date",
"image": OC_CI_ALPINE,
"commands": [
"chmod +x ./tests/drone/check-daily-update.sh",
"./tests/drone/check-daily-update.sh %s %s" % ("daily-master", "daily-master-qa"),
],
}],
"depends_on": [],
"trigger": {
"ref": [],
},
}

for branch in config["branches"]:
pipeline["trigger"]["ref"].append("refs/heads/%s" % branch)

return [pipeline]
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"require": {
},
"require-dev": {
"bamarni/composer-bin-plugin": "^1.4"
"bamarni/composer-bin-plugin": "^1.8"
},
"extra": {
"bamarni-bin": {
Expand Down
20 changes: 10 additions & 10 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor-bin/owncloud-codestyle/composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"require": {
"owncloud/coding-standard": "^3.0"
"owncloud/coding-standard": "^4.1"
}
}
2 changes: 1 addition & 1 deletion vendor-bin/phpstan/composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"require": {
"phpstan/phpstan": "^1.2"
"phpstan/phpstan": "^1.10"
}
}

0 comments on commit 1ae99a4

Please sign in to comment.