Skip to content
Closed
133 changes: 26 additions & 107 deletions .drone.star
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
BANST_AWS_CLI = "banst/awscli"
DRONE_CLI = "drone/cli:alpine"
INBUCKET_INBUCKET = "inbucket/inbucket"
MINIO_MC = "minio/mc:RELEASE.2020-12-18T10-53-53Z"
OC_CI_ALPINE = "owncloudci/alpine:latest"
OC_CI_BAZEL_BUILDIFIER = "owncloudci/bazel-buildifier"
OC_CI_CEPH = "owncloudci/ceph:tag-build-master-jewel-ubuntu-16.04"
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_NODEJS = "owncloudci/nodejs:%s"
OC_CI_ORACLE_XE = "owncloudci/oracle-xe:latest"
Expand All @@ -23,11 +21,26 @@ PLUGINS_SLACK = "plugins/slack:1"
SELENIUM_STANDALONE_CHROME_DEBUG = "selenium/standalone-chrome-debug:3.141.59-oxygen"
SELENIUM_STANDALONE_FIREFOX_DEBUG = "selenium/standalone-firefox-debug:3.8.1"
SONARSOURCE_SONAR_SCANNER_CLI = "sonarsource/sonar-scanner-cli"
THEGEEKLAB_DRONE_GITHUB_COMMENT = "thegeeklab/drone-github-comment:1"

DEFAULT_PHP_VERSION = "7.4"
DEFAULT_NODEJS_VERSION = "14"

# minio mc environment variables
MINIO_MC_ENV = {
"CACHE_BUCKET": {
"from_secret": "cache_s3_bucket",
},
"MC_HOST": {
"from_secret": "cache_s3_server",
},
"AWS_ACCESS_KEY_ID": {
"from_secret": "cache_s3_access_key",
},
"AWS_SECRET_ACCESS_KEY": {
"from_secret": "cache_s3_secret_key",
},
}

dir = {
"base": "/var/www/owncloud",
"federated": "/var/www/owncloud/federated",
Expand All @@ -40,7 +53,7 @@ dir = {
config = {
"rocketchat": {
"channel": "builds",
"from_secret": "private_rocketchat",
"from_secret": "rocketchat_chat_webhook",
},
"branches": [
"master",
Expand Down Expand Up @@ -94,7 +107,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 codestyle(ctx) + jscodestyle(ctx) + 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 @@ -248,31 +261,6 @@ def jscodestyle(ctx):

return pipelines

def cancelPreviousBuilds():
return [{
"kind": "pipeline",
"type": "docker",
"name": "cancel-previous-builds",
"clone": {
"disable": True,
},
"steps": [{
"name": "cancel-previous-builds",
"image": OC_CI_DRONE_CANCEL_PREVIOUS_BUILDS,
"settings": {
"DRONE_TOKEN": {
"from_secret": "drone_token",
},
},
}],
"depends_on": [],
"trigger": {
"ref": [
"refs/pull/**",
],
},
}]

def phpstan(ctx):
pipelines = []

Expand Down Expand Up @@ -594,7 +582,7 @@ def javascript(ctx, withCoverage):
"image": PLUGINS_S3,
"settings": {
"endpoint": {
"from_secret": "cache_s3_endpoint",
"from_secret": "cache_s3_server",
},
"bucket": "cache",
"source": "./coverage/lcov.info",
Expand Down Expand Up @@ -822,7 +810,7 @@ def phpTests(ctx, testType, withCoverage):
"image": PLUGINS_S3,
"settings": {
"endpoint": {
"from_secret": "cache_s3_endpoint",
"from_secret": "cache_s3_server",
},
"bucket": "cache",
"source": "tests/output/clover-%s.xml" % (name),
Expand Down Expand Up @@ -892,7 +880,6 @@ def acceptance(ctx):
"skip": False,
"debugSuites": [],
"skipExceptParts": [],
"earlyFail": True,
"enableApp": True,
"selUserNeeded": False,
}
Expand Down Expand Up @@ -930,14 +917,6 @@ def acceptance(ctx):
if params["skip"]:
continue

# switch off earlyFail if the PR title contains full-ci
if ("full-ci" in ctx.build.title.lower()):
params["earlyFail"] = False

# switch off earlyFail when running cron builds (for example, nightly CI)
if (ctx.build.event == "cron"):
params["earlyFail"] = False

if "externalScality" in params and len(params["externalScality"]) != 0:
# We want to use an external scality server for this pipeline.
# That uses some "standard" extraSetup and extraTeardown.
Expand Down Expand Up @@ -1144,7 +1123,7 @@ def acceptance(ctx):
"path": "%s/downloads" % dir["server"],
}],
}),
] + testConfig["extraTeardown"] + githubComment(params["earlyFail"]) + stopBuild(ctx, params["earlyFail"]),
] + testConfig["extraTeardown"],
"services": databaseService(testConfig["database"]) +
browserService(testConfig["browser"]) +
emailService(testConfig["emailNeeded"]) +
Expand Down Expand Up @@ -1229,13 +1208,10 @@ def sonarAnalysis(ctx, phpVersion = DEFAULT_PHP_VERSION):
{
"name": "sync-from-cache",
"image": MINIO_MC,
"environment": {
"MC_HOST_cache": {
"from_secret": "cache_s3_connection_url",
},
},
"environment": MINIO_MC_ENV,
"commands": [
"mkdir -p results",
"mc alias set cache $MC_HOST $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY",
"mc mirror cache/cache/%s/%s results/" % (ctx.repo.slug, ctx.build.commit + "-${DRONE_BUILD_NUMBER}"),
],
},
Expand All @@ -1260,12 +1236,9 @@ def sonarAnalysis(ctx, phpVersion = DEFAULT_PHP_VERSION):
{
"name": "purge-cache",
"image": MINIO_MC,
"environment": {
"MC_HOST_cache": {
"from_secret": "cache_s3_connection_url",
},
},
"environment": MINIO_MC_ENV,
"commands": [
"mc alias set cache $MC_HOST $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY",
"mc rm --recursive --force cache/cache/%s/%s" % (ctx.repo.slug, ctx.build.commit + "-${DRONE_BUILD_NUMBER}"),
],
},
Expand Down Expand Up @@ -1577,7 +1550,7 @@ def cacheRestore():
"from_secret": "cache_s3_access_key",
},
"endpoint": {
"from_secret": "cache_s3_endpoint",
"from_secret": "cache_s3_server",
},
"restore": True,
"secret_key": {
Expand Down Expand Up @@ -1956,60 +1929,6 @@ def buildTestConfig(params):
configs.append(config)
return configs

def stopBuild(ctx, earlyFail):
if (earlyFail):
return [{
"name": "stop-build",
"image": DRONE_CLI,
"environment": {
"DRONE_SERVER": "https://drone.owncloud.com",
"DRONE_TOKEN": {
"from_secret": "drone_token",
},
},
"commands": [
"drone build stop owncloud/%s ${DRONE_BUILD_NUMBER}" % ctx.repo.name,
],
"when": {
"status": [
"failure",
],
"event": [
"pull_request",
],
},
}]

else:
return []

def githubComment(earlyFail):
if (earlyFail):
return [{
"name": "github-comment",
"image": THEGEEKLAB_DRONE_GITHUB_COMMENT,
"pull": "if-not-exists",
"settings": {
"message": ":boom: Acceptance tests pipeline <strong>${DRONE_STAGE_NAME}</strong> failed. The build has been cancelled.\\n\\n${DRONE_BUILD_LINK}/${DRONE_JOB_NUMBER}${DRONE_STAGE_NUMBER}",
"key": "pr-${DRONE_PULL_REQUEST}",
"update": "true",
"api_key": {
"from_secret": "github_token",
},
},
"when": {
"status": [
"failure",
],
"event": [
"pull_request",
],
},
}]

else:
return []

def checkStarlark():
return [{
"kind": "pipeline",
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"jshint": "^2.13.6",
"jshint-stylish": "^2.2.1",
"karma": "^4.4.1",
"karma-coverage": "^2.2.0",
"karma-coverage": "^2.2.1",
"karma-firefox-launcher": "^2.1.2",
"karma-jasmine": "^1.0.2",
"karma-phantomjs-launcher": "^1.0.4",
Expand All @@ -55,7 +55,7 @@
"angular-sanitize": "^1.8.3",
"angular-ui-bootstrap": "^2.5.0",
"autosize": "^5.0.2",
"fullcalendar": "^3.10.5",
"fullcalendar": "^6.1.8",
"hsl_rgb_converter": "kayellpeee/hsl_rgb_converter",
"ical.js": "DeepDiver1975/ical.js#timezone-fix-and-build",
"jquery-timepicker": "fgelinas/timepicker#883bb2cd94",
Expand Down
70 changes: 59 additions & 11 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,42 @@
"@babel/helper-validator-identifier" "^7.18.6"
to-fast-properties "^2.0.0"

"@fullcalendar/core@~6.1.8":
version "6.1.8"
resolved "https://registry.yarnpkg.com/@fullcalendar/core/-/core-6.1.8.tgz#62008f7b2785dc01f0bf8c2f0c853925eab1c03a"
integrity sha512-i8JBIvZCWGO9dsMEDcx9bnsQZ9PtGSJdOXGgWbhLaGq2iq41OBdp9g9gM4b/Otv2oK8bL5Gl6CsMmb/HkDtA6Q==
dependencies:
preact "~10.12.1"

"@fullcalendar/daygrid@~6.1.8":
version "6.1.8"
resolved "https://registry.yarnpkg.com/@fullcalendar/daygrid/-/daygrid-6.1.8.tgz#2ca4a10892f5e2abeac0f8a8ecc8f07c002a4bf4"
integrity sha512-kCZxQFKb9Vqa3CZRX0v7rMSJ2mlTt4gDpyLfiNJKxUAq7W51uKurPaFZWicaXy1ESHVBxKNlbx5uNjBpyu50JQ==

"@fullcalendar/interaction@~6.1.8":
version "6.1.8"
resolved "https://registry.yarnpkg.com/@fullcalendar/interaction/-/interaction-6.1.8.tgz#36c35bd5718f893e8215a45d48a6ef7d5fcc4650"
integrity sha512-r6W4E9ohaA87M2uPSlmpE2WT7Fzu7LN0u2pE6D/tThruCEaAPbN8Pw5+sqclsuyTIL09mg0eSJm/ggJekTabSA==

"@fullcalendar/list@~6.1.8":
version "6.1.8"
resolved "https://registry.yarnpkg.com/@fullcalendar/list/-/list-6.1.8.tgz#69e5efba0cb8416955a3ad1cd7d550345ffaa16d"
integrity sha512-10N0T/vCtId1cE3JGLpnbAivWVnaWCCkVO7wmbsyr5Y+I939kr/zq4BUNwBoP/xSFVVxx59FETh3iyA+MkV8Fw==

"@fullcalendar/multimonth@~6.1.8":
version "6.1.8"
resolved "https://registry.yarnpkg.com/@fullcalendar/multimonth/-/multimonth-6.1.8.tgz#f28bbe35b8114d09969357d4cc9077d9fb17fe24"
integrity sha512-3F0NlncQTfeE9x5ICxh/M9DaSdY6XjgM1NazY8k+d6ukd1jthHI7vs6j7tXJI9eGUKs3DNNEyzN/LoP06SIyKw==
dependencies:
"@fullcalendar/daygrid" "~6.1.8"

"@fullcalendar/timegrid@~6.1.8":
version "6.1.8"
resolved "https://registry.yarnpkg.com/@fullcalendar/timegrid/-/timegrid-6.1.8.tgz#30b9860eb900c5dc9b72ceaab98c0728018a0ff1"
integrity sha512-3+3KHHCoNcaLs/gQt004hAqICbY5+WAffrZ0ePv+80HFB1OVh8BQ5XXLHSOUbTvXdgtUTcfBHuw9fhO31kt5gA==
dependencies:
"@fullcalendar/daygrid" "~6.1.8"

"@gulp-sourcemaps/identity-map@^2.0.1":
version "2.0.1"
resolved "https://registry.yarnpkg.com/@gulp-sourcemaps/identity-map/-/identity-map-2.0.1.tgz#a6e8b1abec8f790ec6be2b8c500e6e68037c0019"
Expand Down Expand Up @@ -2161,10 +2197,17 @@ fsevents@~2.1.2:
resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.1.2.tgz#4c0a1fb34bc68e543b4b82a9ec392bfbda840805"
integrity sha512-R4wDiBwZ0KzpgOWetKDug1FZcYhqYnUYKtfZYt4mD5SBz76q0KR4Q9o7GIPamsVPGmW3EYPPJ0dOOjvx32ldZA==

fullcalendar@^3.10.5:
version "3.10.5"
resolved "https://registry.yarnpkg.com/fullcalendar/-/fullcalendar-3.10.5.tgz#57a3a64d7d744181582bb9e1be32d1846e1db53a"
integrity sha512-JGWpECKgza/344bbF5QT0hBJpx04DZ/7QGPlR1ZbAwrG6Yz6mWEkQd+NnZUh1sK6HCBIPnPRW2x53aJxeLGvvQ==
fullcalendar@^6.1.8:
version "6.1.8"
resolved "https://registry.yarnpkg.com/fullcalendar/-/fullcalendar-6.1.8.tgz#52b5c73b6214713dbe446587acd4a3feb1f0c4bf"
integrity sha512-cbIdnInHVjj3fWqGgurbRuo8EFViVcEKpI2NZpGkzaqpnvN0p1ifKyQ9qnSGS2bKr7733z8Tv8T+CRXfnEWVmw==
dependencies:
"@fullcalendar/core" "~6.1.8"
"@fullcalendar/daygrid" "~6.1.8"
"@fullcalendar/interaction" "~6.1.8"
"@fullcalendar/list" "~6.1.8"
"@fullcalendar/multimonth" "~6.1.8"
"@fullcalendar/timegrid" "~6.1.8"

function-bind@^1.1.1:
version "1.1.1"
Expand Down Expand Up @@ -3211,10 +3254,10 @@ jstzdetect@pellepim/jstimezonedetect:
version "1.0.7"
resolved "https://codeload.github.com/pellepim/jstimezonedetect/tar.gz/0508acd36d5243a9215ee99ac2cb0d723c2fef4e"

karma-coverage@^2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/karma-coverage/-/karma-coverage-2.2.0.tgz#64f838b66b71327802e7f6f6c39d569b7024e40c"
integrity sha512-gPVdoZBNDZ08UCzdMHHhEImKrw1+PAOQOIiffv1YsvxFhBjqvo/SVXNk4tqn1SYqX0BJZT6S/59zgxiBe+9OuA==
karma-coverage@^2.2.1:
version "2.2.1"
resolved "https://registry.yarnpkg.com/karma-coverage/-/karma-coverage-2.2.1.tgz#e1cc074f93ace9dc4fb7e7aeca7135879c2e358c"
integrity sha512-yj7hbequkQP2qOSb20GuNSIyE//PgJWHwC2IydLE6XRtsnaflv+/OSGNssPjobYUlhVVagy99TQpqUt3vAUG7A==
dependencies:
istanbul-lib-coverage "^3.2.0"
istanbul-lib-instrument "^5.1.0"
Expand Down Expand Up @@ -4167,6 +4210,11 @@ postcss@^7.0.16:
picocolors "^0.2.1"
source-map "^0.6.1"

preact@~10.12.1:
version "10.12.1"
resolved "https://registry.yarnpkg.com/preact/-/preact-10.12.1.tgz#8f9cb5442f560e532729b7d23d42fd1161354a21"
integrity sha512-l8386ixSsBdbreOAkqtrwqHwdvR35ID8c3rKPa8lCWuO86dBi32QWHV4vfsZK1utLLFMvw+Z5Ad4XLkZzchscg==

prelude-ls@~1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54"
Expand Down Expand Up @@ -5360,9 +5408,9 @@ which@^2.0.1:
isexe "^2.0.0"

word-wrap@~1.2.3:
version "1.2.3"
resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c"
integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==
version "1.2.4"
resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.4.tgz#cb4b50ec9aca570abd1f52f33cd45b6c61739a9f"
integrity sha512-2V81OA4ugVo5pRo46hAoD2ivUJx8jXmWXfUkY4KFNw0hEptvN0QfH3K4nHiwzGeKl5rFKedV48QVoqYavy4YpA==

wordwrap@^1.0.0:
version "1.0.0"
Expand Down