From fcfa8aee3cfe03817d253aaf3de6b8d66d912794 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Mon, 18 Mar 2019 13:46:03 +0100 Subject: [PATCH] refactoring --- .drone.jsonnet | 47 ++++++++++++++++++++++++++++------- .drone.yml | 34 +++++++++++++++++++++++-- README.md | 3 +++ docker/Dockerfile.linux.amd64 | 8 ++++-- docker/manifest.tmpl | 7 ++++++ 5 files changed, 86 insertions(+), 13 deletions(-) create mode 100644 docker/manifest.tmpl diff --git a/.drone.jsonnet b/.drone.jsonnet index 8abd81b..138cf7a 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -16,9 +16,9 @@ local PipelineBuild(os='linux', arch='amd64') = { dry_run: true, tags: tag, dockerfile: 'docker/Dockerfile.' + file_suffix, - repo: ' xoxys/rpmbuild-centos7', - username: { from_secret: 'docker_username' }, - password: { from_secret: 'docker_password' }, + repo: ' xoxys/rpmbuild', + username: { from_secret: "docker_username" }, + password: { from_secret: "docker_password" }, }, }, { @@ -29,9 +29,12 @@ local PipelineBuild(os='linux', arch='amd64') = { auto_tag: true, auto_tag_suffix: tag, dockerfile: 'docker/Dockerfile.' + file_suffix, - repo: ' xoxys/rpmbuild-centos7', - username: { from_secret: 'docker_username' }, - password: { from_secret: 'docker_password' }, + repo: ' xoxys/rpmbuild', + username: { from_secret: "docker_username" }, + password: { from_secret: "docker_password" }, + }, + when: { + branch: [ "master" ], }, }, ], @@ -45,27 +48,53 @@ local PipelineNotifications(depends_on=[]) = { arch: "amd64", }, steps: [ + { + image: "plugins/manifest", + name: "manifest", + pull: "always", + settings: { + ignore_missing: true, + username: { from_secret: "docker_username" }, + password: { from_secret: "docker_password" }, + spec: "docker/manifest.tmpl", + }, + when: { + branch: [ "master" ], + }, + }, + { + name: "microbadger", + image: "plugins/webhook", + pull: "always", + settings: { + urls: { from_secret: "microbadger_url" }, + }, + }, { image: "plugins/matrix", name: "matrix", + pull: 'always', settings: { homeserver: "https://matrix.rknet.org", roomid: "MtidqQXWWAtQcByBhH:rknet.org", template: "Status: **{{ build.status }}**
Build: [{{ repo.Owner }}/{{ repo.Name }}]({{ build.link }}) ({{ build.branch }}) by {{ build.author }}
Message: {{ build.message }}", - username: { "from_secret": "matrix_username" }, - password: { "from_secret": "matrix_password" }, + username: { from_secret: "matrix_username" }, + password: { from_secret: "matrix_password" }, }, when: { status: [ "success", "failure" ], }, }, ], + trigger: { + status: [ "success", "failure" ], + }, depends_on: depends_on, }; [ PipelineBuild(os='linux', arch='amd64'), PipelineNotifications(depends_on=[ - 'linux-amd64', + "linux-amd64" ]) ] diff --git a/.drone.yml b/.drone.yml index ac0e7f7..50bf3ee 100644 --- a/.drone.yml +++ b/.drone.yml @@ -15,7 +15,7 @@ steps: dry_run: true password: from_secret: docker_password - repo: xoxys/rpmbuild-centos7 + repo: xoxys/rpmbuild tags: linux-amd64 username: from_secret: docker_username @@ -29,9 +29,12 @@ steps: dockerfile: docker/Dockerfile.linux.amd64 password: from_secret: docker_password - repo: xoxys/rpmbuild-centos7 + repo: xoxys/rpmbuild username: from_secret: docker_username + when: + branch: + - master --- kind: pipeline @@ -42,7 +45,29 @@ platform: arch: amd64 steps: +- name: manifest + pull: always + image: plugins/manifest + settings: + ignore_missing: true + password: + from_secret: docker_password + spec: docker/manifest.tmpl + username: + from_secret: docker_username + when: + branch: + - master + +- name: microbadger + pull: always + image: plugins/webhook + settings: + urls: + from_secret: microbadger_url + - name: matrix + pull: always image: plugins/matrix settings: homeserver: https://matrix.rknet.org @@ -57,6 +82,11 @@ steps: - success - failure +trigger: + status: + - success + - failure + depends_on: - linux-amd64 diff --git a/README.md b/README.md index ae0d1c1..d9d03e2 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,5 @@ # rpmbuild-centos7 +[![Build Status](https://drone.rknet.org/api/badges/docker/rpmbuild/status.svg)](https://drone.rknet.org/docker/rpmbuild/) + +Simple docker image based on CentOS 7 to build rpm packages. diff --git a/docker/Dockerfile.linux.amd64 b/docker/Dockerfile.linux.amd64 index 71f5c62..7b1554c 100644 --- a/docker/Dockerfile.linux.amd64 +++ b/docker/Dockerfile.linux.amd64 @@ -1,5 +1,11 @@ FROM centos:7 +LABEL maintainer="Robert Kaussow " \ + org.label-schema.name="cc-arm" \ + org.label-schema.vcs-url="https://gitea.rknet.org/docker/cc-arm" \ + org.label-schema.vendor="Robert Kaussow" \ + org.label-schema.schema-version="1.0" + RUN yum install -y gcc gcc-c++ \ libtool libtool-ltdl \ gnutls-devel \ @@ -16,6 +22,4 @@ RUN yum install -y gcc gcc-c++ \ yum clean all USER root - -ENV FLAVOR=rpmbuild OS=centos DIST=el7 CMD /srv/pkg diff --git a/docker/manifest.tmpl b/docker/manifest.tmpl new file mode 100644 index 0000000..5de6c5a --- /dev/null +++ b/docker/manifest.tmpl @@ -0,0 +1,7 @@ +image: xoxys/rpmbuild:latest +manifests: + - + image: xoxys/rpmbuild:linux-amd64 + platform: + architecture: amd64 + os: linux