commit da70fd80d7e39e2353aa5e5a34d9d256944836c3 Author: Anton Zadvorny Date: Fri Jan 3 03:40:10 2020 +0300 Initial commit diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..adf6a1f --- /dev/null +++ b/.drone.yml @@ -0,0 +1,17 @@ +kind: pipeline +name: default + +clone: + depth: 50 + +steps: +- name: docker + image: plugins/docker + settings: + username: + from_secret: docker_username + password: + from_secret: docker_password + registry: r.pkg.cx + repo: r.pkg.cx/build/rust + auto_tag: true diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..26e0ac9 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,51 @@ +FROM debian:buster-slim + +ENV TZ=Europe/Moscow +ENV TERM=xterm-color + +ENV RUSTUP_HOME=/usr/local/rustup +ENV CARGO_HOME=/usr/local/cargo +ENV PATH=/usr/local/cargo/bin:$PATH + +ENV RUST_ARCH=x86_64-unknown-linux-gnu +ENV RUST_VERSION=1.40.0 +ENV RUSTUP_VERSION=1.21.1 +ENV RUSTUP_SHA256=ad1f8b5199b3b9e231472ed7aa08d2e5d1d539198a15c5b1e53c746aad81d27b +ENV CARGO_CACHE_VERSION=0.3.3 +ENV CARGO_OUTDATED_VERSION=v0.9.1 +ENV CARGO_TREE_VERSION=v0.28.0 + +RUN \ + apt-get update && \ + apt-get install -y --no-install-recommends ca-certificates curl gcc git libc6-dev && \ + rm -rf /var/lib/apt/lists/* + +RUN \ + cp /usr/share/zoneinfo/${TZ} /etc/localtime && \ + echo "${TZ}" > /etc/timezone && date + +RUN \ + # download rustup + curl --silent --show-error --location https://static.rust-lang.org/rustup/archive/${RUSTUP_VERSION}/${RUST_ARCH}/rustup-init --output rustup-init && \ + echo "${RUSTUP_SHA256} *rustup-init" | sha256sum -c - && \ + chmod +x rustup-init && \ + # install rust + ./rustup-init -y --no-modify-path --profile minimal --default-host ${RUST_ARCH} --default-toolchain ${RUST_VERSION} && \ + rm rustup-init && \ + chmod -R a+w ${RUSTUP_HOME} ${CARGO_HOME} && \ + # add clippy component + rustup component add clippy && \ + # add rustfmt component + rustup component add rustfmt && \ + # install cargo-cache + cargo install cargo-cache --force --git https://github.com/matthiaskrgr/cargo-cache.git --tag ${CARGO_CACHE_VERSION} && \ + # install cargo-outdated + cargo install cargo-outdated --force --git https://github.com/kbknapp/cargo-outdated.git --tag ${CARGO_OUTDATED_VERSION} && \ + # install cargo-tree + cargo install cargo-tree --force --git https://github.com/sfackler/cargo-tree.git --tag ${CARGO_TREE_VERSION} && \ + # cleanup + cargo cache -r all && \ + # print versions + rustup --version && \ + cargo --version && \ + rustc --version diff --git a/README.md b/README.md new file mode 100644 index 0000000..5f2556b --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +[![Build Status](https://ci.pkg.cx/api/badges/build/rust/status.svg)](https://ci.pkg.cx/build/rust)