Fixed linting errors
Some checks failed
ci/woodpecker/push/arch unknown status
ci/woodpecker/push/deploy unknown status
ci/woodpecker/push/docker unknown status
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/build Pipeline was successful

This commit is contained in:
Jef Roosens 2022-02-25 21:54:16 +01:00
parent 732b53b6ce
commit 4a4362c138
Signed by: Jef Roosens
GPG key ID: B580B976584B5F30
3 changed files with 12 additions and 9 deletions

View file

@ -2,7 +2,6 @@ module main
import docker
import encoding.base64
import rand
import time
import json
import server
@ -10,6 +9,7 @@ import env
import net.http
const container_build_dir = '/build'
const build_image_repo = 'vieter-build'
fn create_build_image() ?string {
@ -83,13 +83,13 @@ fn build() ? {
for repo in repos {
// TODO what to do with PKGBUILDs that build multiple packages?
commands := [
"git clone --single-branch --depth 1 --branch $repo.branch $repo.url repo"
'cd repo'
"makepkg --nobuild --nodeps"
'source PKGBUILD'
'git clone --single-branch --depth 1 --branch $repo.branch $repo.url repo',
'cd repo',
'makepkg --nobuild --nodeps',
'source PKGBUILD',
// The build container checks whether the package is already present on the server
"curl --head --fail $conf.address/\$pkgname-\$pkgver-\$pkgrel-\$(uname -m).pkg.tar.zst && exit 0"
'MAKEFLAGS="-j\$(nproc)" makepkg -s --noconfirm --needed && for pkg in \$(ls -1 *.pkg*); do curl -XPOST -T "\$pkg" -H "X-API-KEY: \$API_KEY" $conf.address/publish; done'
'curl --head --fail $conf.address/\$pkgname-\$pkgver-\$pkgrel-\$(uname -m).pkg.tar.zst && exit 0',
'MAKEFLAGS="-j\$(nproc)" makepkg -s --noconfirm --needed && for pkg in \$(ls -1 *.pkg*); do curl -XPOST -T "\$pkg" -H "X-API-KEY: \$API_KEY" $conf.address/publish; done',
]
// We convert the list of commands into a base64 string, which then gets