Skip to content

Commit

Permalink
Merge pull request #6749 from owncloud/backpot-remove-special-drone-a…
Browse files Browse the repository at this point in the history
…ction-from-ci

[full-ci][tests-only] Backport drone update
  • Loading branch information
phil-davis authored Jul 10, 2023
2 parents ec8b66b + a115d3f commit 5f9934a
Showing 1 changed file with 24 additions and 81 deletions.
105 changes: 24 additions & 81 deletions .drone.star
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@
# images
ALPINE_GIT = "alpine/git:latest"
CHKO_DOCKER_PUSHRM = "chko/docker-pushrm:1"
DRONE_CLI = "drone/cli:alpine"
INBUCKET_INBUCKET = "inbucket/inbucket"
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_CLAMAVD = "owncloudci/clamavd"
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.20"
OC_CI_NODEJS = "owncloudci/nodejs:%s"
Expand Down Expand Up @@ -169,7 +167,7 @@ config = {
},
"rocketchat": {
"channel": "ocis-internal",
"from_secret": "private_rocketchat",
"from_secret": "rocketchat_chat_webhook",
},
"binaryReleases": {
"os": ["linux", "darwin"],
Expand Down Expand Up @@ -200,10 +198,10 @@ pipelineVolumeGo = \
# minio mc environment variables
MINIO_MC_ENV = {
"CACHE_BUCKET": {
"from_secret": "cache_public_s3_bucket",
"from_secret": "cache_s3_bucket",
},
"MC_HOST": {
"from_secret": "cache_s3_endpoint",
"from_secret": "cache_s3_server",
},
"AWS_ACCESS_KEY_ID": {
"from_secret": "cache_s3_access_key",
Expand Down Expand Up @@ -254,7 +252,6 @@ def main(ctx):
pipelines = []

test_pipelines = \
cancelPreviousBuilds() + \
codestyle(ctx) + \
buildWebCache(ctx) + \
getGoBinForTesting(ctx) + \
Expand Down Expand Up @@ -340,30 +337,6 @@ def testOcisModules(ctx):

return pipelines + [scan_result_upload]

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",
},
},
}],
"trigger": {
"ref": [
"refs/pull/**",
],
},
}]

def testPipelines(ctx):
pipelines = []

Expand Down Expand Up @@ -415,10 +388,10 @@ def checkGoBinCache():
"image": OC_UBUNTU,
"environment": {
"CACHE_ENDPOINT": {
"from_secret": "cache_public_s3_server",
"from_secret": "cache_s3_server",
},
"CACHE_BUCKET": {
"from_secret": "cache_public_s3_bucket",
"from_secret": "cache_s3_bucket",
},
},
"commands": [
Expand Down Expand Up @@ -518,7 +491,7 @@ def testOcisModule(ctx, module):
"image": PLUGINS_S3,
"settings": {
"endpoint": {
"from_secret": "cache_s3_endpoint",
"from_secret": "cache_s3_server",
},
"bucket": "cache",
"source": "cache/**/*",
Expand Down Expand Up @@ -625,14 +598,11 @@ def uploadScanResults(ctx):
{
"name": "sync-from-cache",
"image": MINIO_MC,
"environment": {
"MC_HOST_cachebucket": {
"from_secret": "cache_s3_connection_url",
},
},
"environment": MINIO_MC_ENV,
"commands": [
"mkdir -p cache",
"mc mirror cachebucket/cache/%s/%s/cache cache/" % (ctx.repo.slug, ctx.build.commit + "-${DRONE_BUILD_NUMBER}"),
"mc alias set cachebucket $MC_HOST $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY",
"mc mirror cachebucket/$CACHE_BUCKET/%s/%s/cache cache/" % (ctx.repo.slug, ctx.build.commit + "-${DRONE_BUILD_NUMBER}"),
],
},
{
Expand All @@ -652,13 +622,10 @@ def uploadScanResults(ctx):
{
"name": "purge-cache",
"image": MINIO_MC,
"environment": {
"MC_HOST_cachebucket": {
"from_secret": "cache_s3_connection_url",
},
},
"environment": MINIO_MC_ENV,
"commands": [
"mc rm --recursive --force cachebucket/cache/%s/%s/cache" % (ctx.repo.slug, ctx.build.commit + "-${DRONE_BUILD_NUMBER}"),
"mc alias set cachebucket $MC_HOST $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY",
"mc rm --recursive --force cachebucket/$CACHE_BUCKET/%s/%s/cache" % (ctx.repo.slug, ctx.build.commit + "-${DRONE_BUILD_NUMBER}"),
],
},
],
Expand Down Expand Up @@ -1222,10 +1189,10 @@ def uploadTracingResult(ctx):
"pull": "if-not-exists",
"settings": {
"bucket": {
"from_secret": "cache_public_s3_bucket",
"from_secret": "cache_s3_bucket",
},
"endpoint": {
"from_secret": "cache_public_s3_server",
"from_secret": "cache_s3_server",
},
"path_style": True,
"source": "webTestRunner/reports/e2e/playwright/tracing/**/*",
Expand Down Expand Up @@ -1264,10 +1231,10 @@ def buildTracingComment():
],
"environment": {
"CACHE_ENDPOINT": {
"from_secret": "cache_public_s3_server",
"from_secret": "cache_s3_server",
},
"CACHE_BUCKET": {
"from_secret": "cache_public_s3_bucket",
"from_secret": "cache_s3_bucket",
},
},
"when": {
Expand Down Expand Up @@ -1344,30 +1311,6 @@ def failEarly(ctx, early_fail):
],
},
},
{
"name": "stop-build",
"image": DRONE_CLI,
# # https://github.com/drone/runner-go/blob/0bd0f8fc31c489817572060d17c6e24aaa487470/pipeline/runtime/const.go#L95-L102
# "failure": "fail-fast",
# would be an alternative, but is currently broken
"environment": {
"DRONE_SERVER": "https://drone.owncloud.com",
"DRONE_TOKEN": {
"from_secret": "drone_token",
},
},
"commands": [
"drone build stop owncloud/ocis ${DRONE_BUILD_NUMBER}",
],
"when": {
"status": [
"failure",
],
"event": [
"pull_request",
],
},
},
]

return []
Expand Down Expand Up @@ -1493,16 +1436,16 @@ def binaryRelease(ctx, name):

settings = {
"endpoint": {
"from_secret": "s3_endpoint",
"from_secret": "upload_s3_endpoint",
},
"access_key": {
"from_secret": "aws_access_key_id",
"from_secret": "upload_s3_access_key",
},
"secret_key": {
"from_secret": "aws_secret_access_key",
"from_secret": "upload_s3_secret_key",
},
"bucket": {
"from_secret": "s3_bucket",
"from_secret": "upload_s3_bucket",
},
"path_style": True,
"strip_prefix": "ocis/dist/release/",
Expand Down Expand Up @@ -2443,7 +2386,7 @@ def genericCache(name, action, mounts, cache_path):
"image": PLUGINS_S3_CACHE,
"settings": {
"endpoint": {
"from_secret": "cache_s3_endpoint",
"from_secret": "cache_s3_server",
},
"rebuild": rebuild,
"restore": restore,
Expand Down Expand Up @@ -2482,7 +2425,7 @@ def genericCachePurge(flush_path):
"from_secret": "cache_s3_secret_key",
},
"endpoint": {
"from_secret": "cache_s3_endpoint",
"from_secret": "cache_s3_server",
},
"flush": True,
"flush_age": 1,
Expand Down Expand Up @@ -2785,10 +2728,10 @@ def checkForWebCache(name):
"image": OC_UBUNTU,
"environment": {
"CACHE_ENDPOINT": {
"from_secret": "cache_public_s3_server",
"from_secret": "cache_s3_server",
},
"CACHE_BUCKET": {
"from_secret": "cache_public_s3_bucket",
"from_secret": "cache_s3_bucket",
},
},
"commands": [
Expand Down

0 comments on commit 5f9934a

Please sign in to comment.