Compare commits

...

4 commits

Author SHA1 Message Date
Emelie Graven f9d6b40fd2
fixup! Disable drone autotag
Some checks failed
continuous-integration/drone/push Build is failing
2021-11-16 16:32:52 +01:00
Emelie Graven 3938c58b60
Disable drone autotag
All checks were successful
continuous-integration/drone/push Build is passing
2021-11-16 16:12:54 +01:00
Emelie Graven 76919e67f3
update drone trigger
All checks were successful
continuous-integration/drone/push Build is passing
2021-11-16 16:08:40 +01:00
Emelie Graven 5a95ec4586
Update docker image, add drone pipeline
All checks were successful
continuous-integration/drone/push Build is passing
2021-11-16 16:03:41 +01:00
2 changed files with 39 additions and 14 deletions

18
.drone.yml Normal file
View file

@ -0,0 +1,18 @@
kind: pipeline
name: default
steps:
- name: docker
image: plugins/docker
settings:
repo: egraven/zola
username: egraven
password:
from_secret: DOCKER_TOKEN
tags:
- latest
- "${DRONE_SEMVER}"
trigger:
branch:
- release

View file

@ -1,21 +1,28 @@
FROM rust:slim AS builder
FROM lukemathwalker/cargo-chef:latest-rust-slim AS chef
WORKDIR zola
RUN apt-get update -y && \
apt-get install -y python-pip make g++ python-setuptools libssl-dev pkg-config rsync && \
pip install dockerize && \
rustup target add x86_64-unknown-linux-gnu
FROM chef AS deps
#RUN rustup target add x86_64-unknown-linux-musl
RUN apt-get update && apt-get install -y make g++ pkg-config libssl-dev # musl-tools
WORKDIR /app
FROM deps AS recipe
COPY . .
RUN cargo chef prepare --recipe-path recipe.json
RUN cargo build --release --target x86_64-unknown-linux-gnu
FROM deps AS build
COPY --from=recipe /zola/recipe.json recipe.json
#RUN cargo chef cook --release --target x86_64-unknown-linux-musl --recipe-path recipe.json
RUN cargo chef cook --release --recipe-path recipe.json
RUN mv target/x86_64-unknown-linux-gnu/release/zola /usr/bin
RUN mkdir -p /workdir
WORKDIR /workdir
RUN dockerize -n -o /workdir /usr/bin/zola
COPY . .
#RUN cargo build --release --target x86_64-unknown-linux-musl --bin zola
RUN cargo build --release --bin zola
FROM debian:bullseye-slim AS runtime
WORKDIR zola
#COPY --from=build zola/target/x86_64-unknown-linux-musl/release/zola /usr/local/bin/
COPY --from=build zola/target/release/zola /usr/local/bin/
ENTRYPOINT ["/usr/local/bin/zola"]
LABEL org.opencontainers.image.authors="Emelie Graven <emelie@graven.dev>"
FROM scratch
COPY --from=builder /workdir .
ENTRYPOINT [ "/usr/bin/zola" ]