Merge pull request #3347 from owncloud/update-drone-star-file

[CI] Updated drone.star file to match latest changes
This commit is contained in:
Phil Davis authored and GitHub committed 2022-03-22 10:19:59 +05:45
commit 1265fd6bc2
1 file changed
+72 -58
+72 -58
View File
@@ -2,14 +2,41 @@
""" """
# images # images
OC_CI_ALPINE = "owncloudci/alpine:latest" ALPINE_GIT = "alpine/git:latest"
OC_CI_GOLANG = "owncloudci/golang:1.17" CHKO_DOCKER_PUSHRM = "chko/docker-pushrm:1"
OC_CI_NODEJS = "owncloudci/nodejs:14" DRONE_CLI = "drone/cli:alpine"
OC_CI_PHP = "owncloudci/php:7.4" MARIADB = "mariadb:10.6"
OC_CI_WAIT_FOR = "owncloudci/wait-for:latest" MELTWATER_DRONE_CACHE = "meltwater/drone-cache:v1"
OC_TESTING_MIDDLEWARE = "owncloud/owncloud-test-middleware:1.3.1"
MINIO_MC = "minio/mc:RELEASE.2021-10-07T04-19-58Z" MINIO_MC = "minio/mc:RELEASE.2021-10-07T04-19-58Z"
OC_CI_ALPINE = "owncloudci/alpine:latest"
OC_CI_BAZEL_BUILDIFIER = "owncloudci/bazel-buildifier:latest"
OC_CI_DRONE_ANSIBLE = "owncloudci/drone-ansible:latest"
OC_CI_DRONE_CANCEL_PREVIOUS_BUILDS = "owncloudci/drone-cancel-previous-builds"
OC_CI_DRONE_SKIP_PIPELINE = "owncloudci/drone-skip-pipeline"
OC_CI_GOLANG = "owncloudci/golang:1.17"
OC_CI_NODEJS = "owncloudci/nodejs:%s"
OC_CI_PHP = "owncloudci/php:%s"
OC_CI_WAIT_FOR = "owncloudci/wait-for:latest"
OC_OC_TEST_MIDDLEWARE = "owncloud/owncloud-test-middleware:1.3.1"
OC_SERVER = "owncloud/server:10"
OC_UBUNTU = "owncloud/ubuntu:18.04"
OSIXIA_OPEN_LDAP = "osixia/openldap:latest"
PLUGINS_CODACY = "plugins/codacy:1"
PLUGINS_DOCKER = "plugins/docker:latest"
PLUGINS_DOWNSTREAM = "plugins/downstream:latest"
PLUGINS_GH_PAGES = "plugins/gh-pages:1"
PLUGINS_GITHUB_RELEASE = "plugins/github-release:1"
PLUGINS_GIT_ACTION = "plugins/git-action:1"
PLUGINS_MANIFEST = "plugins/manifest:1"
PLUGINS_S3 = "plugins/s3:latest"
PLUGINS_SLACK = "plugins/slack:1"
REDIS = "redis:6-alpine" REDIS = "redis:6-alpine"
SELENIUM_STANDALONE_CHROME_DEBUG = "selenium/standalone-chrome-debug:3.141.59"
SONARSOURCE_SONAR_SCANNER_CLI = "sonarsource/sonar-scanner-cli:latest"
THEGEEKLAB_DRONE_GITHUB_COMMENT = "thegeeklab/drone-github-comment:1"
DEFAULT_PHP_VERSION = "7.4"
DEFAULT_NODEJS_VERSION = "14"
# configuration # configuration
config = { config = {
@@ -218,7 +245,7 @@ def cancelPreviousBuilds():
}, },
"steps": [{ "steps": [{
"name": "cancel-previous-builds", "name": "cancel-previous-builds",
"image": "owncloudci/drone-cancel-previous-builds", "image": OC_CI_DRONE_CANCEL_PREVIOUS_BUILDS,
"settings": { "settings": {
"DRONE_TOKEN": { "DRONE_TOKEN": {
"from_secret": "drone_token", "from_secret": "drone_token",
@@ -282,7 +309,7 @@ def testOcisModule(ctx, module):
}, },
{ {
"name": "scan-result-cache", "name": "scan-result-cache",
"image": "plugins/s3:latest", "image": PLUGINS_S3,
"settings": { "settings": {
"endpoint": { "endpoint": {
"from_secret": "cache_s3_endpoint", "from_secret": "cache_s3_endpoint",
@@ -379,7 +406,7 @@ def uploadScanResults(ctx):
"steps": [ "steps": [
{ {
"name": "clone", "name": "clone",
"image": "alpine/git:latest", "image": ALPINE_GIT,
"commands": [ "commands": [
# Always use the owncloud/ocis repository as base to have an up to date default branch. # Always use the owncloud/ocis repository as base to have an up to date default branch.
# This is needed for the skipIfUnchanged step, since it references a commit on master (which could be absent on a fork) # This is needed for the skipIfUnchanged step, since it references a commit on master (which could be absent on a fork)
@@ -405,7 +432,7 @@ def uploadScanResults(ctx):
}, },
{ {
"name": "codacy", "name": "codacy",
"image": "plugins/codacy:1", "image": PLUGINS_CODACY,
"settings": { "settings": {
"token": { "token": {
"from_secret": "codacy_token", "from_secret": "codacy_token",
@@ -414,7 +441,7 @@ def uploadScanResults(ctx):
}, },
{ {
"name": "sonarcloud", "name": "sonarcloud",
"image": "sonarsource/sonar-scanner-cli:latest", "image": SONARSOURCE_SONAR_SCANNER_CLI,
"environment": sonar_env, "environment": sonar_env,
}, },
{ {
@@ -455,7 +482,7 @@ def localApiTests(ctx, storage, suite, accounts_hash_difficulty = 4):
cloneCoreRepos() + [ cloneCoreRepos() + [
{ {
"name": "localApiTests-%s-%s" % (suite, storage), "name": "localApiTests-%s-%s" % (suite, storage),
"image": OC_CI_PHP, "image": OC_CI_PHP % DEFAULT_PHP_VERSION,
"environment": { "environment": {
"TEST_SERVER_URL": "https://ocis-server:9200", "TEST_SERVER_URL": "https://ocis-server:9200",
"OCIS_REVA_DATA_ROOT": "%s" % ("/srv/app/tmp/ocis/owncloud/data/" if storage == "owncloud" else ""), "OCIS_REVA_DATA_ROOT": "%s" % ("/srv/app/tmp/ocis/owncloud/data/" if storage == "owncloud" else ""),
@@ -504,7 +531,7 @@ def coreApiTests(ctx, part_number = 1, number_of_parts = 1, storage = "ocis", ac
cloneCoreRepos() + [ cloneCoreRepos() + [
{ {
"name": "oC10ApiTests-%s-storage-%s" % (storage, part_number), "name": "oC10ApiTests-%s-storage-%s" % (storage, part_number),
"image": OC_CI_PHP, "image": OC_CI_PHP % DEFAULT_PHP_VERSION,
"environment": { "environment": {
"TEST_SERVER_URL": "https://ocis-server:9200", "TEST_SERVER_URL": "https://ocis-server:9200",
"OCIS_REVA_DATA_ROOT": "%s" % ("/srv/app/tmp/ocis/owncloud/data/" if storage == "owncloud" else ""), "OCIS_REVA_DATA_ROOT": "%s" % ("/srv/app/tmp/ocis/owncloud/data/" if storage == "owncloud" else ""),
@@ -614,7 +641,7 @@ def uiTestPipeline(ctx, filterTags, early_fail, runPart = 1, numberOfParts = 1,
ocisServer(storage, accounts_hash_difficulty, [stepVolumeOC10Tests]) + waitForSeleniumService() + waitForMiddlewareService() + [ ocisServer(storage, accounts_hash_difficulty, [stepVolumeOC10Tests]) + waitForSeleniumService() + waitForMiddlewareService() + [
{ {
"name": "webUITests", "name": "webUITests",
"image": OC_CI_NODEJS, "image": OC_CI_NODEJS % DEFAULT_NODEJS_VERSION,
"environment": { "environment": {
"SERVER_HOST": "https://ocis-server:9200", "SERVER_HOST": "https://ocis-server:9200",
"BACKEND_HOST": "https://ocis-server:9200", "BACKEND_HOST": "https://ocis-server:9200",
@@ -673,7 +700,7 @@ def accountsUITests(ctx, storage = "ocis", accounts_hash_difficulty = 4):
ocisServer(storage, accounts_hash_difficulty, [stepVolumeOC10Tests]) + waitForSeleniumService() + waitForMiddlewareService() + [ ocisServer(storage, accounts_hash_difficulty, [stepVolumeOC10Tests]) + waitForSeleniumService() + waitForMiddlewareService() + [
{ {
"name": "WebUIAcceptanceTests", "name": "WebUIAcceptanceTests",
"image": OC_CI_NODEJS, "image": OC_CI_NODEJS % DEFAULT_NODEJS_VERSION,
"environment": { "environment": {
"SERVER_HOST": "https://ocis-server:9200", "SERVER_HOST": "https://ocis-server:9200",
"BACKEND_HOST": "https://ocis-server:9200", "BACKEND_HOST": "https://ocis-server:9200",
@@ -737,7 +764,7 @@ def settingsUITests(ctx, storage = "ocis", accounts_hash_difficulty = 4):
ocisServer(storage, accounts_hash_difficulty, [stepVolumeOC10Tests]) + waitForSeleniumService() + waitForMiddlewareService() + [ ocisServer(storage, accounts_hash_difficulty, [stepVolumeOC10Tests]) + waitForSeleniumService() + waitForMiddlewareService() + [
{ {
"name": "WebUIAcceptanceTests", "name": "WebUIAcceptanceTests",
"image": OC_CI_NODEJS, "image": OC_CI_NODEJS % DEFAULT_NODEJS_VERSION,
"environment": { "environment": {
"SERVER_HOST": "https://ocis-server:9200", "SERVER_HOST": "https://ocis-server:9200",
"BACKEND_HOST": "https://ocis-server:9200", "BACKEND_HOST": "https://ocis-server:9200",
@@ -773,7 +800,7 @@ def settingsUITests(ctx, storage = "ocis", accounts_hash_difficulty = 4):
"services": [ "services": [
{ {
"name": "redis", "name": "redis",
"image": "redis:6-alpine", "image": REDIS,
}, },
] + selenium() + middlewareService(), ] + selenium() + middlewareService(),
"volumes": [stepVolumeOC10Tests] + "volumes": [stepVolumeOC10Tests] +
@@ -808,7 +835,7 @@ def failEarly(ctx, early_fail):
return [ return [
{ {
"name": "github-comment", "name": "github-comment",
"image": "thegeeklab/drone-github-comment:1", "image": THEGEEKLAB_DRONE_GITHUB_COMMENT,
"settings": { "settings": {
"message": ":boom: Acceptance test [<strong>${DRONE_STAGE_NAME}</strong>](${DRONE_BUILD_LINK}/${DRONE_STAGE_NUMBER}/1) failed. Further test are cancelled...", "message": ":boom: Acceptance test [<strong>${DRONE_STAGE_NAME}</strong>](${DRONE_BUILD_LINK}/${DRONE_STAGE_NUMBER}/1) failed. Further test are cancelled...",
"key": "pr-${DRONE_PULL_REQUEST}", #TODO: we could delete the comment after a successful CI run "key": "pr-${DRONE_PULL_REQUEST}", #TODO: we could delete the comment after a successful CI run
@@ -828,7 +855,7 @@ def failEarly(ctx, early_fail):
}, },
{ {
"name": "stop-build", "name": "stop-build",
"image": "drone/cli:alpine", "image": DRONE_CLI,
# # https://github.com/drone/runner-go/blob/0bd0f8fc31c489817572060d17c6e24aaa487470/pipeline/runtime/const.go#L95-L102 # # https://github.com/drone/runner-go/blob/0bd0f8fc31c489817572060d17c6e24aaa487470/pipeline/runtime/const.go#L95-L102
# "failure": "fail-fast", # "failure": "fail-fast",
# would be an alternative, but is currently broken # would be an alternative, but is currently broken
@@ -895,7 +922,7 @@ def dockerRelease(ctx, arch):
}, },
{ {
"name": "dryrun", "name": "dryrun",
"image": "plugins/docker:latest", "image": PLUGINS_DOCKER,
"settings": { "settings": {
"dry_run": True, "dry_run": True,
"context": "ocis", "context": "ocis",
@@ -914,7 +941,7 @@ def dockerRelease(ctx, arch):
}, },
{ {
"name": "docker", "name": "docker",
"image": "plugins/docker:latest", "image": PLUGINS_DOCKER,
"settings": { "settings": {
"username": { "username": {
"from_secret": "docker_username", "from_secret": "docker_username",
@@ -1020,7 +1047,7 @@ def binaryRelease(ctx, name):
}, },
{ {
"name": "upload", "name": "upload",
"image": "plugins/s3:latest", "image": PLUGINS_S3,
"settings": settings, "settings": settings,
"when": { "when": {
"ref": [ "ref": [
@@ -1043,7 +1070,7 @@ def binaryRelease(ctx, name):
}, },
{ {
"name": "release", "name": "release",
"image": "plugins/github-release:1", "image": PLUGINS_GITHUB_RELEASE,
"settings": { "settings": {
"api_key": { "api_key": {
"from_secret": "github_token", "from_secret": "github_token",
@@ -1090,7 +1117,7 @@ def releaseSubmodule(ctx):
"steps": [ "steps": [
{ {
"name": "release-submodule", "name": "release-submodule",
"image": "plugins/github-release:1", "image": PLUGINS_GITHUB_RELEASE,
"settings": { "settings": {
"api_key": { "api_key": {
"from_secret": "github_token", "from_secret": "github_token",
@@ -1129,7 +1156,7 @@ def releaseDockerManifest(ctx):
"steps": [ "steps": [
{ {
"name": "execute", "name": "execute",
"image": "plugins/manifest:1", "image": PLUGINS_MANIFEST,
"settings": { "settings": {
"username": { "username": {
"from_secret": "docker_username", "from_secret": "docker_username",
@@ -1184,7 +1211,7 @@ def changelog(ctx):
}, },
{ {
"name": "publish", "name": "publish",
"image": "plugins/git-action:1", "image": PLUGINS_GIT_ACTION,
"settings": { "settings": {
"actions": [ "actions": [
"commit", "commit",
@@ -1231,7 +1258,7 @@ def releaseDockerReadme(ctx):
"steps": [ "steps": [
{ {
"name": "execute", "name": "execute",
"image": "chko/docker-pushrm:1", "image": CHKO_DOCKER_PUSHRM,
"environment": { "environment": {
"DOCKER_USER": { "DOCKER_USER": {
"from_secret": "docker_username", "from_secret": "docker_username",
@@ -1284,7 +1311,7 @@ def docs(ctx):
}, },
{ {
"name": "publish", "name": "publish",
"image": "plugins/gh-pages:1", "image": PLUGINS_GH_PAGES,
"settings": { "settings": {
"username": { "username": {
"from_secret": "github_username", "from_secret": "github_username",
@@ -1313,7 +1340,7 @@ def docs(ctx):
}, },
{ {
"name": "downstream", "name": "downstream",
"image": "plugins/downstream:latest", "image": PLUGINS_DOWNSTREAM,
"settings": { "settings": {
"server": "https://drone.owncloud.com/", "server": "https://drone.owncloud.com/",
"token": { "token": {
@@ -1348,7 +1375,7 @@ def makeNodeGenerate(module):
return [ return [
{ {
"name": "generate nodejs", "name": "generate nodejs",
"image": OC_CI_NODEJS, "image": OC_CI_NODEJS % DEFAULT_NODEJS_VERSION,
"commands": [ "commands": [
"%s ci-node-generate" % (make), "%s ci-node-generate" % (make),
], ],
@@ -1383,7 +1410,7 @@ def notify(ctx):
"steps": [ "steps": [
{ {
"name": "notify-rocketchat", "name": "notify-rocketchat",
"image": "plugins/slack:1", "image": PLUGINS_SLACK,
"settings": { "settings": {
"webhook": { "webhook": {
"from_secret": config["rocketchat"]["from_secret"], "from_secret": config["rocketchat"]["from_secret"],
@@ -1526,7 +1553,7 @@ def ocisServer(storage, accounts_hash_difficulty = 4, volumes = [], depends_on =
}, },
{ {
"name": "wait-for-ocis-server", "name": "wait-for-ocis-server",
"image": "owncloudci/wait-for:latest", "image": OC_CI_WAIT_FOR,
"commands": [ "commands": [
"wait-for -it ocis-server:9200 -t 300", "wait-for -it ocis-server:9200 -t 300",
], ],
@@ -1537,7 +1564,7 @@ def ocisServer(storage, accounts_hash_difficulty = 4, volumes = [], depends_on =
def middlewareService(): def middlewareService():
return [{ return [{
"name": "middleware", "name": "middleware",
"image": OC_TESTING_MIDDLEWARE, "image": OC_OC_TEST_MIDDLEWARE,
"environment": { "environment": {
"BACKEND_HOST": "https://ocis-server:9200", "BACKEND_HOST": "https://ocis-server:9200",
"OCIS_REVA_DATA_ROOT": "/srv/app/tmp/ocis/storage/owncloud/", "OCIS_REVA_DATA_ROOT": "/srv/app/tmp/ocis/storage/owncloud/",
@@ -1599,7 +1626,7 @@ def selenium():
return [ return [
{ {
"name": "selenium", "name": "selenium",
"image": "selenium/standalone-chrome-debug:3.141.59", "image": SELENIUM_STANDALONE_CHROME_DEBUG,
"volumes": [{ "volumes": [{
"name": "uploads", "name": "uploads",
"path": "/uploads", "path": "/uploads",
@@ -1659,8 +1686,7 @@ def skipIfUnchanged(ctx, type):
return [{ return [{
"name": "skip-if-unchanged", "name": "skip-if-unchanged",
"image": "owncloudci/drone-skip-pipeline", "image": OC_CI_DRONE_SKIP_PIPELINE,
"pull": "always",
"settings": { "settings": {
"ALLOW_SKIP_CHANGED": skip, "ALLOW_SKIP_CHANGED": skip,
}, },
@@ -1719,7 +1745,7 @@ def deploy(ctx, config, rebuild):
"steps": [ "steps": [
{ {
"name": "clone continuous deployment playbook", "name": "clone continuous deployment playbook",
"image": "alpine/git:latest", "image": ALPINE_GIT,
"commands": [ "commands": [
"cd deployments/continuous-deployment-config", "cd deployments/continuous-deployment-config",
"git clone https://github.com/owncloud-devops/continuous-deployment.git", "git clone https://github.com/owncloud-devops/continuous-deployment.git",
@@ -1727,7 +1753,7 @@ def deploy(ctx, config, rebuild):
}, },
{ {
"name": "deploy", "name": "deploy",
"image": "owncloudci/drone-ansible:latest", "image": SELENIUM_STANDALONE_CHROME_DEBUG,
"failure": "ignore", "failure": "ignore",
"environment": { "environment": {
"CONTINUOUS_DEPLOY_SERVERS_CONFIG": "../%s" % (config), "CONTINUOUS_DEPLOY_SERVERS_CONFIG": "../%s" % (config),
@@ -1766,14 +1792,14 @@ def checkStarlark():
"steps": [ "steps": [
{ {
"name": "format-check-starlark", "name": "format-check-starlark",
"image": "owncloudci/bazel-buildifier:latest", "image": OC_CI_BAZEL_BUILDIFIER,
"commands": [ "commands": [
"buildifier --mode=check .drone.star", "buildifier --mode=check .drone.star",
], ],
}, },
{ {
"name": "show-diff", "name": "show-diff",
"image": "owncloudci/bazel-buildifier:latest", "image": OC_CI_BAZEL_BUILDIFIER,
"commands": [ "commands": [
"buildifier --mode=fix .drone.star", "buildifier --mode=fix .drone.star",
"git diff", "git diff",
@@ -1805,7 +1831,7 @@ def genericCache(name, action, mounts, cache_key):
step = { step = {
"name": "%s_%s" % (action, name), "name": "%s_%s" % (action, name),
"image": "meltwater/drone-cache:v1", "image": MELTWATER_DRONE_CACHE,
"environment": { "environment": {
"AWS_ACCESS_KEY_ID": { "AWS_ACCESS_KEY_ID": {
"from_secret": "cache_s3_access_key", "from_secret": "cache_s3_access_key",
@@ -1954,12 +1980,6 @@ def pipelineSanityChecks(ctx, pipelines):
"""Parallel Deployment configs """Parallel Deployment configs
""" """
#images
OC_OC10 = "owncloud/server:10"
OC_UBUNTU = "owncloud/ubuntu:18.04"
MARIADB = "mariadb:10.6"
OSIXIA_OPENLDAP = "osixia/openldap:latest"
# configs # configs
OCIS_URL = "https://ocis-server:9200" OCIS_URL = "https://ocis-server:9200"
OCIS_DOMAIN = "ocis-server:9200" OCIS_DOMAIN = "ocis-server:9200"
@@ -2124,7 +2144,7 @@ def parallelAcceptance(env):
return [{ return [{
"name": "acceptance-tests", "name": "acceptance-tests",
"image": OC_CI_PHP, "image": OC_CI_PHP % DEFAULT_PHP_VERSION,
"environment": environment, "environment": environment,
"commands": [ "commands": [
"make test-paralleldeployment-api", "make test-paralleldeployment-api",
@@ -2141,8 +2161,7 @@ def parallelDeploymentOC10Server():
return [ return [
{ {
"name": "oc10", "name": "oc10",
"image": OC_OC10, "image": OC_SERVER,
"pull": "always",
"detach": True, "detach": True,
"environment": { "environment": {
# can be switched to "web" # can be switched to "web"
@@ -2210,8 +2229,7 @@ def parallelDeploymentOC10Server():
def ldapService(): def ldapService():
return [{ return [{
"name": "openldap", "name": "openldap",
"image": OSIXIA_OPENLDAP, "image": OSIXIA_OPEN_LDAP,
"pull": "always",
"environment": { "environment": {
"LDAP_TLS_VERIFY_CLIENT": "never", "LDAP_TLS_VERIFY_CLIENT": "never",
"LDAP_DOMAIN": "owncloud.com", "LDAP_DOMAIN": "owncloud.com",
@@ -2233,7 +2251,6 @@ def oc10DbService():
{ {
"name": "oc10-db", "name": "oc10-db",
"image": MARIADB, "image": MARIADB,
"pull": "always",
"environment": { "environment": {
"MYSQL_ROOT_PASSWORD": "owncloud", "MYSQL_ROOT_PASSWORD": "owncloud",
"MYSQL_USER": "owncloud", "MYSQL_USER": "owncloud",
@@ -2251,8 +2268,7 @@ def oc10DbService():
def copyConfigs(): def copyConfigs():
return [{ return [{
"name": "copy-configs", "name": "copy-configs",
"image": OC_OC10, "image": OC_SERVER,
"pull": "always",
"commands": [ "commands": [
# ocis proxy config # ocis proxy config
"mkdir -p /etc/ocis", "mkdir -p /etc/ocis",
@@ -2275,7 +2291,6 @@ def owncloudLog():
return [{ return [{
"name": "owncloud-log", "name": "owncloud-log",
"image": OC_UBUNTU, "image": OC_UBUNTU,
"pull": "always",
"detach": True, "detach": True,
"commands": [ "commands": [
"tail -f /mnt/data/owncloud.log", "tail -f /mnt/data/owncloud.log",
@@ -2289,8 +2304,7 @@ def owncloudLog():
def fixSharedDataPermissions(): def fixSharedDataPermissions():
return [{ return [{
"name": "fix-shared-data-permissions", "name": "fix-shared-data-permissions",
"image": OC_CI_PHP, "image": OC_CI_PHP % DEFAULT_PHP_VERSION,
"pull": "always",
"commands": [ "commands": [
"chown -R 33:33 /var/www/owncloud", # www-data user "chown -R 33:33 /var/www/owncloud", # www-data user
"chmod -R 777 /var/www/owncloud", "chmod -R 777 /var/www/owncloud",