refactoring
This commit is contained in:
parent
b07631f192
commit
6016d4a7ed
71
.drone.jsonnet
Normal file
71
.drone.jsonnet
Normal 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')
|
||||||
|
]
|
109
.drone.yml
109
.drone.yml
|
@ -1,50 +1,71 @@
|
||||||
---
|
---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
name: default
|
name: linux-amd64
|
||||||
|
|
||||||
|
platform:
|
||||||
|
os: linux
|
||||||
|
arch: amd64
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: dryrun
|
- name: dryrun
|
||||||
pull: always
|
pull: always
|
||||||
image: plugins/docker:linux-amd64
|
image: plugins/docker:linux-amd64
|
||||||
settings:
|
settings:
|
||||||
dry_run: true
|
dockerfile: docker/Dockerfile.linux.amd64
|
||||||
password:
|
dry_run: true
|
||||||
from_secret: docker_password
|
password:
|
||||||
repo: xoxys/rpmbuild-centos7
|
from_secret: docker_password
|
||||||
tags: linux-amd64
|
repo: plugins/base
|
||||||
username:
|
tags: linux-amd64
|
||||||
from_secret: docker_username
|
username:
|
||||||
when:
|
from_secret: docker_username
|
||||||
event:
|
|
||||||
- push
|
|
||||||
- tag
|
|
||||||
|
|
||||||
- name: publish
|
- name: publish
|
||||||
pull: always
|
pull: always
|
||||||
image: plugins/docker:linux-amd64
|
image: plugins/docker:linux-amd64
|
||||||
settings:
|
settings:
|
||||||
auto_tag: true
|
auto_tag: true
|
||||||
password:
|
auto_tag_suffix: linux-amd64
|
||||||
from_secret: docker_password
|
dockerfile: docker/Dockerfile.linux.amd64
|
||||||
repo: xoxys/rpmbuild-centos7
|
password:
|
||||||
username:
|
from_secret: docker_password
|
||||||
from_secret: docker_username
|
repo: plugins/base
|
||||||
when:
|
username:
|
||||||
event:
|
from_secret: docker_username
|
||||||
- push
|
|
||||||
- tag
|
|
||||||
|
|
||||||
- name: notify
|
---
|
||||||
image: plugins/matrix
|
kind: pipeline
|
||||||
settings:
|
name: linux-arm
|
||||||
homeserver: https://matrix.rknet.org
|
|
||||||
roomid: MtidqQXWWAtQcByBhH:rknet.org
|
platform:
|
||||||
template: "Status: **{{ build.status }}**<br/> Build: [{{ repo.Owner }}/{{ repo.Name }}]({{ build.link }}) ({{ build.branch }}) by {{ build.author }}<br/> Message: {{ build.message }}"
|
os: linux
|
||||||
username:
|
arch: arm
|
||||||
from_secret: matrix_username
|
|
||||||
password:
|
steps:
|
||||||
from_secret: matrix_password
|
- name: dryrun
|
||||||
when:
|
pull: always
|
||||||
status:
|
image: plugins/docker:linux-arm
|
||||||
- success
|
settings:
|
||||||
- failure
|
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
|
||||||
|
|
||||||
|
...
|
||||||
|
|
21
docker/Dockerfile.linux.arm
Normal file
21
docker/Dockerfile.linux.arm
Normal 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
|
Reference in New Issue
Block a user