refactoring

This commit is contained in:
Robert Kaussow 2019-03-13 10:57:48 +01:00
parent b07631f192
commit 6016d4a7ed
4 changed files with 157 additions and 44 deletions

71
.drone.jsonnet Normal file
View File

@ -0,0 +1,71 @@
local PipelineBuild(os='linux', arch='amd64') = {
local tag = os + '-' + arch,
local file_suffix = std.strReplace(tag, '-', '.'),
kind: "pipeline",
name: tag,
platform: {
os: os,
arch: arch,
},
steps: [
{
name: 'dryrun',
image: 'plugins/docker:' + tag,
pull: 'always',
settings: {
dry_run: true,
tags: tag,
dockerfile: 'docker/Dockerfile.' + file_suffix,
repo: 'plugins/base',
username: { from_secret: 'docker_username' },
password: { from_secret: 'docker_password' },
},
},
{
name: 'publish',
image: 'plugins/docker:' + tag,
pull: 'always',
settings: {
auto_tag: true,
auto_tag_suffix: tag,
dockerfile: 'docker/Dockerfile.' + file_suffix,
repo: 'plugins/base',
username: { from_secret: 'docker_username' },
password: { from_secret: 'docker_password' },
},
},
],
};
local PipelineNotifications = {
kind: "pipeline",
name: "notifications",
platform: {
os: "linux",
arch: "amd64",
},
steps: [
{
image: "plugins/matrix",
settings: {
homeserver: "https://matrix.rknet.org",
roomid: "MtidqQXWWAtQcByBhH:rknet.org",
template: "Status: **{{ build.status }}**<br/> Build: [{{ repo.Owner }}/{{ repo.Name }}]({{ build.link }}) ({{ build.branch }}) by {{ build.author }}<br/> Message: {{ build.message }}",
username: { "from_secret": "matrix_username" },
password: { "from_secret": "matrix_password" },
},
},
],
depends_on: [
"deployment",
],
trigger: {
event: [ "push", "tag" ],
status: [ "success", "failure" ],
},
};
[
PipelineBuild(os='linux', arch='amd64'),
PipelineBuild(os='linux', arch='arm')
]

View File

@ -1,50 +1,71 @@
---
kind: pipeline
name: default
name: linux-amd64
platform:
os: linux
arch: amd64
steps:
- name: dryrun
pull: always
image: plugins/docker:linux-amd64
settings:
dry_run: true
password:
from_secret: docker_password
repo: xoxys/rpmbuild-centos7
tags: linux-amd64
username:
from_secret: docker_username
when:
event:
- push
- tag
- name: dryrun
pull: always
image: plugins/docker:linux-amd64
settings:
dockerfile: docker/Dockerfile.linux.amd64
dry_run: true
password:
from_secret: docker_password
repo: plugins/base
tags: linux-amd64
username:
from_secret: docker_username
- name: publish
pull: always
image: plugins/docker:linux-amd64
settings:
auto_tag: true
password:
from_secret: docker_password
repo: xoxys/rpmbuild-centos7
username:
from_secret: docker_username
when:
event:
- push
- tag
- name: publish
pull: always
image: plugins/docker:linux-amd64
settings:
auto_tag: true
auto_tag_suffix: linux-amd64
dockerfile: docker/Dockerfile.linux.amd64
password:
from_secret: docker_password
repo: plugins/base
username:
from_secret: docker_username
- name: notify
image: plugins/matrix
settings:
homeserver: https://matrix.rknet.org
roomid: MtidqQXWWAtQcByBhH:rknet.org
template: "Status: **{{ build.status }}**<br/> Build: [{{ repo.Owner }}/{{ repo.Name }}]({{ build.link }}) ({{ build.branch }}) by {{ build.author }}<br/> Message: {{ build.message }}"
username:
from_secret: matrix_username
password:
from_secret: matrix_password
when:
status:
- success
- failure
---
kind: pipeline
name: linux-arm
platform:
os: linux
arch: arm
steps:
- name: dryrun
pull: always
image: plugins/docker:linux-arm
settings:
dockerfile: docker/Dockerfile.linux.arm
dry_run: true
password:
from_secret: docker_password
repo: plugins/base
tags: linux-arm
username:
from_secret: docker_username
- name: publish
pull: always
image: plugins/docker:linux-arm
settings:
auto_tag: true
auto_tag_suffix: linux-arm
dockerfile: docker/Dockerfile.linux.arm
password:
from_secret: docker_password
repo: plugins/base
username:
from_secret: docker_username
...

View File

@ -0,0 +1,21 @@
FROM arm32v7/centos:7
RUN yum install -y gcc gcc-c++ \
libtool libtool-ltdl \
gnutls-devel \
pam-devel \
dbus-devel \
avahi-devel \
systemd-devel \
make cmake \
git \
pkgconfig \
wget \
automake autoconf \
yum-utils rpm-build && \
yum clean all
USER root
ENV FLAVOR=rpmbuild OS=centos DIST=el7
CMD /srv/pkg