Added development & release image publishing

main
Jef Roosens 2022-01-13 13:51:02 +01:00
parent eed6ec0644
commit 6fb893ff41
Signed by untrusted user: Jef Roosens
GPG Key ID: 955C0660072F691F
4 changed files with 44 additions and 21 deletions

View File

@ -1,4 +1,4 @@
*
!vieter/
!src/
!Makefile

View File

@ -0,0 +1,22 @@
pipeline:
dev:
image: plugins/docker
secrets: [ docker_username, docker_password ]
settings:
repo: chewingbever/vieter
tag: dev
when:
event: push
branch: dev
release:
image: plugins/docker
secrets: [ docker_username, docker_password ]
settings:
repo: chewingbever/vieter
tag:
- latest
- $CI_COMMIT_TAG
when:
event: tag
branch: main

View File

@ -1,20 +1,21 @@
FROM archlinux:latest AS builder
FROM chewingbever/vlang:latest AS builder
WORKDIR /src
COPY vieter ./vieter
WORKDIR /app
# Copy over source code & build production binary
COPY src ./src
COPY Makefile ./
RUN pacman \
-Syu --noconfirm --needed \
gcc git openssl make && \
make customv && \
jjr-v/v -prod vieter
RUN make prod
FROM archlinux:latest
FROM alpine:3.15
ENV REPO_DIR=/data
COPY --from=builder /src/vieter/vieter /usr/local/bin/
RUN apk update && \
apk add --no-cache \
libarchive
COPY --from=builder /app/pvieter /usr/local/bin/vieter
ENTRYPOINT [ "/usr/local/bin/vieter" ]

View File

@ -54,7 +54,7 @@ fn reader_to_file(mut reader io.BufferedReader, length int, path string) ? {
}
}
fn main2() {
fn main() {
// Configure logger
log_level_str := os.getenv_opt('LOG_LEVEL') or { 'WARN' }
log_level := log.level_from_tag(log_level_str) or {
@ -102,11 +102,11 @@ fn main2() {
}, port)
}
fn main() {
// archive.list_filenames()
info := archive.get_pkg_info('test/jjr-joplin-desktop-2.6.10-4-x86_64.pkg.tar.zst') or {
eprintln(err.msg)
return
}
println(info)
}
// fn main() {
// // archive.list_filenames()
// info := archive.get_pkg_info('test/jjr-joplin-desktop-2.6.10-4-x86_64.pkg.tar.zst') or {
// eprintln(err.msg)
// return
// }
// println(info)
// }