Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 59 additions & 9 deletions .drone.star
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
OC_CI_NODEJS = "owncloudci/nodejs:18"
OC_CI_ALPINE = "owncloudci/alpine:latest"
OC_CI_BUILDIFIER = "owncloudci/bazel-buildifier:latest"
SONARSOURCE_SONAR_SCANNER_CLI = "sonarsource/sonar-scanner-cli:11.0"
OC_CI_NODEJS = "owncloudci/nodejs:18"
OC_CI_WAIT_FOR = "owncloudci/wait-for:latest"
OCIS_IMAGE = "owncloud/ocis:5.0"
PLUGINS_DOCKER = "plugins/docker:latest"
PLUGINS_GITHUB_RELEASE = "plugins/github-release:1"
SONARSOURCE_SONAR_SCANNER_CLI = "sonarsource/sonar-scanner-cli:11.0"

dir = {
"webConfig": "/drone/src/tests/drone/web.config.json",
Expand All @@ -14,7 +16,8 @@ def main(ctx):
pnpmlint(ctx) + \
unitTestPipeline(ctx) + \
e2eTests() + \
dockerRelease(ctx)
dockerRelease(ctx) + \
releaseArtifacts(ctx)

def checkStarlark():
return [{
Expand Down Expand Up @@ -142,6 +145,8 @@ def serveExtension():
"detach": True,
"commands": [
"pnpm build:w",
"pwd",
"ls -al",
],
},
]
Expand Down Expand Up @@ -256,12 +261,12 @@ def dockerRelease(ctx):
"name": "docker",
"image": PLUGINS_DOCKER,
"settings": {
"username": {
"from_secret": "docker_username",
},
"password": {
"from_secret": "docker_password",
},
# "username": {
# "from_secret": "docker_username",
# },
# "password": {
# "from_secret": "docker_password",
# },
"tags": tag,
"dockerfile": "Dockerfile",
"repo": repo,
Expand All @@ -284,3 +289,48 @@ def dockerRelease(ctx):
},
},
]

def releaseArtifacts(ctx):
version = ctx.build.ref.replace("refs/tags/", "")
return [{
"kind": "pipeline",
"type": "docker",
"name": "publish-artifacts",
"steps": installPnpm() +
serveExtension() +
[
{
"name": "zip-artifacts",
"image": OC_CI_ALPINE,
"commands": [
"pwd",
"apk add --no-cache zip",
"mv dist dicom-viewer",
"zip -r dicom-viewer-%s.zip dicom-viewer" % version,
],
},
{
"name": "publish",
"image": PLUGINS_GITHUB_RELEASE,
"settings": {
"title": version,
"overwrite": True,
"files": [
"dicom-viewer-%s.zip" % version,
],
"checksum": [
"md5",
"sha256",
],
"api_key": {
"from_secret": "github_token",
},
},
},
],
"trigger": {
"ref": [
"refs/tags/**",
],
},
}]