From 5c462a0ca8d1df443dbdf680715b9c581928626f Mon Sep 17 00:00:00 2001 From: Michael Barz Date: Wed, 14 Oct 2020 13:02:03 +0200 Subject: [PATCH] run build in ocis folder --- .drone.star | 95 ++++++++++++++++++++++++++------- ocis/docker/eos-ocis/Dockerfile | 2 +- 2 files changed, 77 insertions(+), 20 deletions(-) diff --git a/.drone.star b/.drone.star index 69803f20ee..0f774295cc 100644 --- a/.drone.star +++ b/.drone.star @@ -102,6 +102,7 @@ def main(ctx): docker(ctx, 'amd64'), docker(ctx, 'arm64'), docker(ctx, 'arm'), + dockerEos(ctx), binary(ctx, 'linux'), binary(ctx, 'darwin'), binary(ctx, 'windows'), @@ -700,25 +701,6 @@ def docker(ctx, arch): }, }, }, - { - 'name': 'dryrun-eos-docker', - 'image': 'plugins/docker:18.09', - 'pull': 'always', - 'settings': { - 'dry_run': True, - 'context': 'ocis/docker/eos-ocis', - 'tags': 'linux-%s' % (arch), - 'dockerfile': 'ocis/docker/eos-ocis/Dockerfile', - 'repo': 'owncloud/eos-ocis', - }, - 'when': { - 'ref': { - 'include': [ - 'refs/pull/**', - ], - }, - }, - }, { 'name': 'docker', 'image': 'plugins/docker:18.09', @@ -761,6 +743,79 @@ def docker(ctx, arch): }, } +def dockerEos(ctx): + return { + 'kind': 'pipeline', + 'type': 'docker', + 'name': 'docker-eos-ocis', + 'platform': { + 'os': 'linux', + 'arch': 'amd64', + }, + 'steps': + generate('ocis') + + build() + [ + { + 'name': 'dryrun-eos-ocis', + 'image': 'plugins/docker:18.09', + 'pull': 'always', + 'settings': { + 'dry_run': True, + 'context': 'ocis/docker/eos-ocis', + 'tags': 'linux-eos-ocis', + 'dockerfile': 'ocis/docker/eos-ocis/Dockerfile', + 'repo': 'owncloud/eos-ocis', + }, + 'when': { + 'ref': { + 'include': [ + 'refs/pull/**', + ], + }, + }, + }, + { + 'name': 'docker-eos-ocis', + 'image': 'plugins/docker:18.09', + 'pull': 'always', + 'settings': { + 'username': { + 'from_secret': 'docker_username', + }, + 'password': { + 'from_secret': 'docker_password', + }, + 'auto_tag': True, + 'context': 'ocis/docker/eos-ocis', + 'auto_tag_suffix': 'linux-amd64', + 'dockerfile': 'ocis/docker/eos-ocis/Dockerfile', + 'repo': 'owncloud/eos-ocis', + }, + 'when': { + 'ref': { + 'exclude': [ + 'refs/pull/**', + ], + }, + }, + }, + ], + 'volumes': [ + { + 'name': 'gopath', + 'temp': {}, + }, + ], + 'depends_on': getDependsOnAllTestPipelines(ctx), + 'trigger': { + 'ref': [ + 'refs/heads/master', + 'refs/tags/v*', + 'refs/pull/**', + ], + }, + } + def binary(ctx, name): if ctx.build.event == "tag": settings = { @@ -994,6 +1049,7 @@ def manifest(ctx): 'docker-amd64', 'docker-arm64', 'docker-arm', + 'docker-eos-ocis', 'binaries-linux', 'binaries-darwin', 'binaries-windows', @@ -1148,6 +1204,7 @@ def badges(ctx): 'docker-amd64', 'docker-arm64', 'docker-arm', + 'docker-eos-ocis', ], 'trigger': { 'ref': [ diff --git a/ocis/docker/eos-ocis/Dockerfile b/ocis/docker/eos-ocis/Dockerfile index c59feb3ac7..eb63a782a0 100644 --- a/ocis/docker/eos-ocis/Dockerfile +++ b/ocis/docker/eos-ocis/Dockerfile @@ -16,7 +16,7 @@ RUN ln -s /usr/local/go/bin/* /usr/local/bin RUN git clone https://github.com/owncloud/ocis.git RUN cd ocis && git checkout ${BRANCH} RUN cd ocis && git log -n 1 -RUN cd ocis && go build -v -o bin/ocis -toolexec '/usr/bin/time -v' ./cmd/ocis +RUN cd ocis/ocis && go build -v -o ../bin/ocis -toolexec '/usr/bin/time -v' ./cmd/ocis # RUN cd ocis && make generate bin/ocis # build user lookup test program