From 5340979d23da14a98dce7210a5f00821c62ff8f1 Mon Sep 17 00:00:00 2001 From: Max Audron Date: Sat, 15 May 2021 14:18:59 +0200 Subject: add container build --- .gitlab-ci.yml | 3 +++ Cargo.lock | 4 ++++ Cargo.toml | 4 ++-- Containerfile | 26 ++++++++++++++++++++++++++ 4 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 .gitlab-ci.yml create mode 100644 Containerfile diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..c01da3f --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,3 @@ +include: + - project: "cocainefarm/templates/ci" + file: "/container.tags.yaml" diff --git a/Cargo.lock b/Cargo.lock index f299a92..dcfd2d9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -353,6 +353,8 @@ dependencies = [ [[package]] name = "irc" version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5510c4c4631e53c57d6b05c44ab8447d1db6beef28fb9d12c4d6a46fad9dfcc" dependencies = [ "chrono", "encoding", @@ -375,6 +377,8 @@ dependencies = [ [[package]] name = "irc-proto" version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55fa0a52d825e59ba8aea5b7503890245aea000f77e68d9b1903f3491fa33643" dependencies = [ "bytes", "encoding", diff --git a/Cargo.toml b/Cargo.toml index acce7b1..85bd957 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,8 +7,8 @@ edition = "2018" [dependencies] macros = { path = "./macros" } -irc = { path = "/home/audron/repo/github.com/maxaudron/irc", version = "0.15", features = ["json", "tls-rust"], default_features = false } -irc-proto = { path = "/home/audron/repo/github.com/maxaudron/irc/irc-proto" } +irc = { version = "0.15", features = ["json", "tls-rust"], default_features = false } +irc-proto = "0.15" sasl = "0.5" base64 = "0.13" diff --git a/Containerfile b/Containerfile new file mode 100644 index 0000000..30802e3 --- /dev/null +++ b/Containerfile @@ -0,0 +1,26 @@ +# ------------------------------------------------------------------------------ +# Cargo Build Stage +# ------------------------------------------------------------------------------ + +FROM docker.io/rust:1.52-alpine as cargo-build + +RUN rustup default nightly && rustup update + +WORKDIR /work + +COPY . . + +RUN apk add --no-cache musl-dev +RUN cargo build --release + +# ------------------------------------------------------------------------------ +# Final Stage +# ------------------------------------------------------------------------------ + +FROM alpine:3.13 + +COPY --from=cargo-build /work/target/release/catinator /usr/local/bin + +ENV CATINATOR_CONFIG="/config.toml" + +CMD ["/usr/local/bin/catinator"] -- cgit v1.2.3