lokinet/.drone.jsonnet

48 lines
1.8 KiB
Plaintext
Raw Normal View History

2022-07-13 22:23:05 +00:00
// force change distro change
2022-04-15 12:44:17 +00:00
local distro = "fedora-36";
local distro_name = 'Fedora 36';
local distro_docker = 'fedora:36';
2020-06-17 13:42:11 +00:00
local submodules = {
name: 'submodules',
image: 'drone/git',
2020-10-02 21:36:52 +00:00
commands: ['git fetch --tags', 'git submodule update --init --recursive --depth=1']
};
2021-08-10 22:05:11 +00:00
local dnf(arch) = 'dnf -y --setopt install_weak_deps=False --setopt cachedir=/cache/'+distro+'/'+arch+'/${DRONE_STAGE_MACHINE} ';
2021-08-10 22:05:11 +00:00
local rpm_pipeline(image, buildarch='amd64', rpmarch='x86_64', jobs=6) = {
2020-05-15 23:29:05 +00:00
kind: 'pipeline',
type: 'docker',
2021-08-10 22:05:11 +00:00
name: distro_name + ' (' + rpmarch + ')',
platform: { arch: buildarch },
2020-05-15 23:29:05 +00:00
steps: [
submodules,
2020-05-15 23:29:05 +00:00
{
name: 'build',
image: image,
2021-08-10 22:05:11 +00:00
environment: {
SSH_KEY: { from_secret: "SSH_KEY" },
RPM_BUILD_NCPUS: jobs
},
2020-05-15 23:29:05 +00:00
commands: [
'echo "Building on ${DRONE_STAGE_MACHINE}"',
2021-08-10 22:05:11 +00:00
dnf(rpmarch) + 'distro-sync',
dnf(rpmarch) + 'install rpm-build git-archive-all dnf-plugins-core ccache',
dnf(rpmarch) + 'config-manager --add-repo https://rpm.oxen.io/fedora/oxen.repo',
'pkg_src_base="$(rpm -q --queryformat=\'%{NAME}-%{VERSION}\n\' --specfile SPECS/lokinet.spec | head -n 1)"',
'git-archive-all --prefix $pkg_src_base/ SOURCES/$pkg_src_base.src.tar.gz',
dnf(rpmarch) + 'builddep --spec SPECS/lokinet.spec',
'if [ -n "$CCACHE_DIR" ]; then mkdir -pv ~/.cache; ln -sv "$CCACHE_DIR" ~/.cache/ccache; fi',
'rpmbuild --define "_topdir $(pwd)" -bb SPECS/lokinet.spec',
'./SPECS/ci-upload.sh ' + distro + ' ' + rpmarch,
],
2020-05-23 14:46:45 +00:00
}
]
};
2020-05-15 23:29:05 +00:00
[
2021-10-15 03:12:23 +00:00
rpm_pipeline(distro_docker),
rpm_pipeline("arm64v8/" + distro_docker, buildarch='arm64', rpmarch="aarch64", jobs=4)
2020-05-15 23:29:05 +00:00
]