Skip to content

Commit

Permalink
upd
Browse files Browse the repository at this point in the history
  • Loading branch information
MikailBag committed May 16, 2021
1 parent f2eebed commit 9a6bc29
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 22 deletions.
47 changes: 29 additions & 18 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions build-env/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,13 @@ ENV PYTHONUNBUFFERED=1
RUN python3 ./build-env/make.py --out /build-env

FROM rust:slim as build-pps
ARG BUILD_DATE=''
ARG GIT_HASH=''
COPY . /pps
WORKDIR /pps
ENV JJS_BUILD_INFO_VERIFY_FULL=1
ENV JJS_BUILD_INFO_DATE=${BUILD_DATE}
ENV JJS_BUILD_INFO_GIT_COMMIT=${GIT_HASH}}
RUN cargo install --path cli

FROM ubuntu:focal
Expand Down
2 changes: 1 addition & 1 deletion ci/publish-build.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
set -euxo pipefail
export DOCKER_BUILDKIT=1
docker build -f build-env/Dockerfile -t pps-cli .
docker build -f build-env/Dockerfile -t pps-cli --build-arg "BUILD_DATE=$(date)" --build-arg "GIT_HASH=$(git rev-parse HEAD)" .
3 changes: 2 additions & 1 deletion cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ authors = ["Mikail Bagishov <[email protected]>"]
edition = "2018"

[dependencies]
serde = { version = "1.0.125", features = ["derive"] }
serde = { version = "1.0.126", features = ["derive"] }
serde_json = "1.0.64"
anyhow = "1.0.40"
tokio = { version = "1.5.0", features = ["process", "macros", "rt-multi-thread", "fs"] }
clap = "3.0.0-beta.2"
pps-engine = { path = "../engine" }
tracing = "0.1.25"
tracing-subscriber = "0.2.17"
buildinfo = { git = "https://github.com/jjs-dev/commons" }
7 changes: 5 additions & 2 deletions cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ mod import;
mod progress_notifier;

use anyhow::Context as _;
use clap::Clap;
use clap::{Clap, FromArgMatches, IntoApp};
use std::path::Path;

#[derive(Clap, Debug)]
Expand Down Expand Up @@ -31,7 +31,10 @@ async fn main() -> anyhow::Result<()> {
tracing_subscriber::fmt()
.with_env_filter(tracing_subscriber::EnvFilter::from_default_env())
.init();
let args = Args::parse();
let args = Args::into_app();
let args = buildinfo::BuildInfo::wrap_clap(args);
let args = args.get_matches();
let args = Args::from_arg_matches(&args);
process_args(args).await.context("failed to process args")?;
Ok(())
}
Expand Down

0 comments on commit 9a6bc29

Please sign in to comment.