diff --git a/.drone.jsonnet b/.drone.jsonnet index 06f90c3..053f251 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -12,9 +12,28 @@ local PipelineBuild(os='linux', arch='amd64') = { { name: 'binary', image: 'clux/muslrust:nightly-2019-12-19', + environment: { + 'DB': 'postgresql', + 'DEBIAN_FRONTEND': 'noninteractive', + 'LANG': 'C.UTF-8', + 'TZ': 'UTC', + }, commands: [ '[ -z "${DRONE_TAG}" ] && BITWARDEN_VERSION=master || BITWARDEN_VERSION=${DRONE_TAG%-*}', - 'curl -L https://github.com/dani-garcia/bitwarden_rs/archive/$BITWARDEN_VERSION.tar.gz | tar xz --strip-components=1', + 'mkdir -p source/', + 'apt-get update && apt-get install -y --no-install-recommends libpq-dev', + 'rustup set profile minimal', + 'curl -L https://github.com/dani-garcia/bitwarden_rs/archive/$BITWARDEN_VERSION.tar.gz | tar xz -C source/ --strip-components=1', + 'ls -lah source && id', + 'cargo new --bin app/ && cd app/', + 'cp ../source/Cargo.* .', + 'cp ../source/rust-toolchain .', + 'cp ../source/build.rs .', + 'rustup target add x86_64-unknown-linux-musl', + 'cargo build --features ${DB} --release', + 'find . -not -path "./target*" -delete', + 'ls -lah', + 'cp -rT ../source .', 'ls -lah' ], }, diff --git a/.drone.yml b/.drone.yml index bd34c86..831a406 100644 --- a/.drone.yml +++ b/.drone.yml @@ -11,7 +11,25 @@ steps: image: clux/muslrust:nightly-2019-12-19 commands: - "[ -z \"${DRONE_TAG}\" ] && BITWARDEN_VERSION=master || BITWARDEN_VERSION=${DRONE_TAG%-*}" - - curl -L https://github.com/dani-garcia/bitwarden_rs/archive/$BITWARDEN_VERSION.tar.gz | tar xz --strip-components=1 + - mkdir -p source/ + - apt-get update && apt-get install -y --no-install-recommends libpq-dev + - rustup set profile minimal + - curl -L https://github.com/dani-garcia/bitwarden_rs/archive/$BITWARDEN_VERSION.tar.gz | tar xz -C source/ --strip-components=1 + - ls -lah source && id + - cargo new --bin app/ && cd app/ + - cp ../source/Cargo.* . + - cp ../source/rust-toolchain . + - cp ../source/build.rs . + - rustup target add x86_64-unknown-linux-musl + - cargo build --features ${DB} --release + - find . -not -path "./target*" -delete - ls -lah + - cp -rT ../source . + - ls -lah + environment: + DB: postgresql + DEBIAN_FRONTEND: noninteractive + LANG: C.UTF-8 + TZ: UTC ...