chore: ran `make fmt`

hash-on-upload
Jef Roosens 2022-05-08 14:53:35 +02:00
parent 4b172cb5d8
commit e79d18100f
Signed by: Jef Roosens
GPG Key ID: B75D4F293C7052DB
2 changed files with 12 additions and 14 deletions

View File

@ -94,7 +94,7 @@ pub fn build_repo(address string, api_key string, base_image_id string, repo &db
'source PKGBUILD',
// The build container checks whether the package is already
// present on the server
'curl --head --fail $address/$repo.repo/$build_arch/\$pkgname-\$pkgver-\$pkgrel && exit 0',
'curl -s --head --fail $address/$repo.repo/$build_arch/\$pkgname-\$pkgver-\$pkgrel && 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" $address/$repo.repo/publish; done',
]
@ -146,18 +146,16 @@ fn build(conf Config, repo_id int) ? {
build_arch := os.uname().machine
// First, we create a base image which has updated repos n stuff
println('Creating base image...')
image_id := create_build_image(conf.base_image) ?
println('Running build...')
res := build_repo(conf.address, conf.api_key, image_id, repo) ?
// Remove the builder image
println('Removing build image...')
docker.remove_image(image_id) ?
// Upload the build log to the Vieter instance
println('Uploading logs to Vieter...')
c.add_build_log(repo.id, res.start_time, res.end_time, build_arch, res.exit_code, res.logs) ?
c.add_build_log(repo.id, res.start_time, res.end_time, build_arch, res.exit_code,
res.logs) ?
}

View File

@ -88,7 +88,7 @@ pub fn inspect_container(id string) ?ContainerInspect {
data.state.start_time = docker_timestamp_to_time(data.state.start_time_str) ?
if data.state.status == "exited" {
if data.state.status == 'exited' {
data.state.end_time = docker_timestamp_to_time(data.state.end_time_str) ?
}