From 5bba2cb297007e410e74a3bbf55c634fd3676944 Mon Sep 17 00:00:00 2001 From: David Quintanel Date: Tue, 24 Jan 2023 16:16:01 +0100 Subject: [PATCH 1/4] upgrade clap --- gtfs2netexfr/Cargo.toml | 2 +- gtfs2netexfr/src/main.rs | 21 ++++++++++---------- gtfs2ntfs/Cargo.toml | 2 +- gtfs2ntfs/src/main.rs | 29 ++++++++++++++-------------- ntfs2gtfs/Cargo.toml | 4 ++-- ntfs2gtfs/src/main.rs | 10 +++++----- ntfs2netexfr/Cargo.toml | 2 +- ntfs2netexfr/src/main.rs | 15 +++++++------- ntfs2ntfs/Cargo.toml | 2 +- ntfs2ntfs/src/main.rs | 17 ++++++++-------- restrict-validity-period/Cargo.toml | 2 +- restrict-validity-period/src/main.rs | 15 +++++++------- 12 files changed, 58 insertions(+), 63 deletions(-) diff --git a/gtfs2netexfr/Cargo.toml b/gtfs2netexfr/Cargo.toml index 43c7aa36f..06d082429 100644 --- a/gtfs2netexfr/Cargo.toml +++ b/gtfs2netexfr/Cargo.toml @@ -13,7 +13,7 @@ keywords = ["gtfs", "netex", "transit"] [dependencies] chrono = { version = "0.4", default-features = false, features = ["std", "clock"] } -clap = { version = "3", features = ["derive"] } +clap = { version = "4", features = ["derive"] } tracing = { version = "0.1", features = ["log", "release_max_level_info"] } tracing-subscriber = { version = "0.3", features = ["env-filter"] } transit_model = { path = "../", features = ["proj"] } diff --git a/gtfs2netexfr/src/main.rs b/gtfs2netexfr/src/main.rs index 6dfc3a6c5..903a1950f 100644 --- a/gtfs2netexfr/src/main.rs +++ b/gtfs2netexfr/src/main.rs @@ -34,52 +34,51 @@ fn get_version() -> &'static str { } #[derive(Debug, Parser)] -#[clap(name = "gtfs2netexfr", about = "Convert a GTFS to NeTEx France.", version = get_version())] +#[command(name = "gtfs2netexfr", about = "Convert a GTFS to NeTEx France.", version = get_version())] struct Opt { /// Input directory. - #[clap(short, long, parse(from_os_str), default_value = ".")] + #[arg(short, long, default_value = ".")] input: PathBuf, /// Output directory. - #[clap(short, long, parse(from_os_str))] + #[arg(short, long)] output: PathBuf, /// JSON file containing additional configuration. /// /// For more information, see /// https://github.com/hove-io/transit_model/blob/master/documentation/common_ntfs_rules.md#configuration-of-each-converter - #[clap(short, long, parse(from_os_str))] + #[arg(short, long)] config: Option, /// Indicates if the input GTFS contains On-Demand Transport (ODT) /// information. - #[clap(short = 't', long = "on-demand-transport")] + #[arg(short = 't', long = "on-demand-transport")] odt: bool, /// On-Demand Transport GTFS comment - #[clap(long = "odt-comment")] + #[arg(long = "odt-comment")] odt_comment: Option, /// Name for the participant. /// /// For more information, see /// https://github.com/hove-io/transit_model/blob/master/documentation/ntfs_to_netex_france_specs.md#input-parameters - #[clap(short, long)] + #[arg(short, long)] participant: String, /// Code for the provider of stops. /// /// For more information, see /// https://github.com/hove-io/transit_model/blob/master/documentation/ntfs_to_netex_france_specs.md#input-parameters - #[clap(short, long)] + #[arg(short, long)] stop_provider: Option, /// Current datetime. - #[clap( + #[arg( short = 'x', long, - parse(try_from_str), - default_value = &transit_model::CURRENT_DATETIME + default_value = &**transit_model::CURRENT_DATETIME )] current_datetime: DateTime, } diff --git a/gtfs2ntfs/Cargo.toml b/gtfs2ntfs/Cargo.toml index ecc53d59a..039afbbe6 100644 --- a/gtfs2ntfs/Cargo.toml +++ b/gtfs2ntfs/Cargo.toml @@ -13,7 +13,7 @@ keywords = ["gtfs", "ntfs", "transit"] [dependencies] chrono = { version = "0.4", default-features = false, features = ["std", "clock"] } -clap = { version = "3", features = ["derive"] } +clap = { version = "4", features = ["derive"] } tracing = { version = "0.1", features = ["log", "release_max_level_info"] } tracing-subscriber = { version = "0.3", features = ["env-filter"] } transit_model = { path = "../" } diff --git a/gtfs2ntfs/src/main.rs b/gtfs2ntfs/src/main.rs index f2937bed6..08eb8b1f9 100644 --- a/gtfs2ntfs/src/main.rs +++ b/gtfs2ntfs/src/main.rs @@ -34,66 +34,65 @@ fn get_version() -> &'static str { } #[derive(Debug, Parser)] -#[clap(name = "gtfs2ntfs", about = "Convert a GTFS to an NTFS.", version = get_version())] +#[command(name = "gtfs2ntfs", about = "Convert a GTFS to an NTFS.", version = get_version())] struct Opt { /// Input directory. - #[clap(short, long, parse(from_os_str), default_value = ".")] + #[arg(short, long, default_value = ".")] input: PathBuf, /// Output directory. - #[clap(short, long, parse(from_os_str))] + #[arg(short, long)] output: PathBuf, /// JSON file containing additional configuration. /// /// For more information, see /// https://github.com/hove-io/transit_model/blob/master/documentation/common_ntfs_rules.md#configuration-of-each-converter - #[clap(short, long, parse(from_os_str))] + #[arg(short, long)] config: Option, /// Prefix added to all the identifiers (`123` turned into `prefix:123`). - #[clap(short, long)] + #[arg(short, long)] prefix: Option, /// Schedule subprefix added after the prefix on all scheduled objects (`123` turned into `prefix::schedule_subprefix::123`). - #[clap(long)] + #[arg(long)] schedule_subprefix: Option, /// Indicates if the input GTFS contains On-Demand Transport (ODT) /// information. - #[clap(long)] + #[arg(long)] odt: bool, /// On-Demand Transport GTFS comment. - #[clap(long = "odt-comment")] + #[arg(long = "odt-comment")] odt_comment: Option, /// If true, each GTFS `Route` will generate a different `Line`. /// Else we group the routes by `agency_id` and `route_short_name` /// (or `route_long_name` if the short name is empty) and create a `Line` for each group. - #[clap(long = "read-as-line")] + #[arg(long = "read-as-line")] read_as_line: bool, /// Current datetime. - #[clap( + #[arg( short = 'x', long, - parse(try_from_str), - default_value = &transit_model::CURRENT_DATETIME + default_value = &**transit_model::CURRENT_DATETIME )] current_datetime: DateTime, /// The maximum distance in meters to compute the tranfer. - #[clap(long, short = 'd', default_value = transit_model::TRANSFER_MAX_DISTANCE)] + #[arg(long, short = 'd', default_value = transit_model::TRANSFER_MAX_DISTANCE)] max_distance: f64, /// The walking speed in meters per second. You may want to divide your /// initial speed by sqrt(2) to simulate Manhattan distances. - #[clap(long, short = 's', default_value = transit_model::TRANSFER_WALKING_SPEED)] + #[arg(long, short = 's', default_value = transit_model::TRANSFER_WALKING_SPEED)] walking_speed: f64, /// Waiting time at stop in seconds. - #[clap(long, short = 't', default_value = transit_model::TRANSFER_WAITING_TIME)] + #[arg(long, short = 't', default_value = transit_model::TRANSFER_WAITING_TIME)] waiting_time: u32, } diff --git a/ntfs2gtfs/Cargo.toml b/ntfs2gtfs/Cargo.toml index fd6005f89..de6f39ae0 100644 --- a/ntfs2gtfs/Cargo.toml +++ b/ntfs2gtfs/Cargo.toml @@ -12,9 +12,9 @@ categories = ["command-line-utilities", "data-structures", "encoding", "parser-i keywords = ["gtfs", "ntfs", "transit"] [dependencies] -clap = { version = "3", features = ["derive"] } +clap = { version = "4", features = ["derive"] } tracing = { version = "0.1", features = ["log", "release_max_level_info"] } -tracing-subscriber = "0.3" +tracing-subscriber = { version = "0.3", features = ["env-filter"] } transit_model = { path = "../" } lazy_static = "1" diff --git a/ntfs2gtfs/src/main.rs b/ntfs2gtfs/src/main.rs index 1f1963a8b..bed1b04c0 100644 --- a/ntfs2gtfs/src/main.rs +++ b/ntfs2gtfs/src/main.rs @@ -34,21 +34,21 @@ fn get_version() -> &'static str { } #[derive(Debug, Parser)] -#[clap(name = "ntfs2gtfs", about = "Convert an NTFS to a GTFS.", version = get_version())] +#[command(name = "ntfs2gtfs", about = "Convert an NTFS to a GTFS.", version = get_version())] struct Opt { /// Input directory. - #[clap(short, long, parse(from_os_str), default_value = ".")] + #[arg(short, long, default_value = ".")] input: PathBuf, /// Output directory. - #[clap(short, long, parse(from_os_str))] + #[arg(short, long)] output: PathBuf, /// Add the commercial mode at the beginning of the route short name. - #[clap(short, long)] + #[arg(short, long)] mode_in_route_short_name: bool, - #[clap( + #[arg( long, help = "Support a more rich set of route types. \ For more information, see \ diff --git a/ntfs2netexfr/Cargo.toml b/ntfs2netexfr/Cargo.toml index b78c2de19..8b458e263 100644 --- a/ntfs2netexfr/Cargo.toml +++ b/ntfs2netexfr/Cargo.toml @@ -13,7 +13,7 @@ keywords = ["ntfs", "netex", "transit"] [dependencies] chrono = { version = "0.4", default-features = false, features = ["std", "clock"] } -clap = { version = "3", features = ["derive"] } +clap = { version = "4", features = ["derive"] } tracing = { version = "0.1", features = ["log", "release_max_level_info"] } tracing-subscriber = { version = "0.3", features = ["env-filter"] } transit_model = { path = "../", features = ["proj"] } diff --git a/ntfs2netexfr/src/main.rs b/ntfs2netexfr/src/main.rs index 50752d8d2..37e0894f6 100644 --- a/ntfs2netexfr/src/main.rs +++ b/ntfs2netexfr/src/main.rs @@ -34,36 +34,35 @@ fn get_version() -> &'static str { } #[derive(Debug, Parser)] -#[clap(name = "ntfs2netexfr", about = "Convert a NTFS to NeTEx France.", version = get_version())] +#[command(name = "ntfs2netexfr", about = "Convert a NTFS to NeTEx France.", version = get_version())] struct Opt { /// Input directory. - #[clap(short, long, parse(from_os_str), default_value = ".")] + #[arg(short, long, default_value = ".")] input: PathBuf, /// Output directory - #[clap(short, long, parse(from_os_str))] + #[arg(short, long)] output: PathBuf, /// Name for the participant. /// /// For more information, see /// https://github.com/hove-io/transit_model/blob/master/documentation/ntfs_to_netex_france_specs.md#input-parameters - #[clap(short, long)] + #[arg(short, long)] participant: String, /// Code for the provider of stops. /// /// For more information, see /// https://github.com/hove-io/transit_model/blob/master/documentation/ntfs_to_netex_france_specs.md#input-parameters - #[clap(short, long)] + #[arg(short, long)] stop_provider: Option, /// Current datetime. - #[clap( + #[arg( short = 'x', long, - parse(try_from_str), - default_value = &transit_model::CURRENT_DATETIME + default_value = &**transit_model::CURRENT_DATETIME )] current_datetime: DateTime, } diff --git a/ntfs2ntfs/Cargo.toml b/ntfs2ntfs/Cargo.toml index 6ba4e0bdf..8bae18023 100644 --- a/ntfs2ntfs/Cargo.toml +++ b/ntfs2ntfs/Cargo.toml @@ -13,7 +13,7 @@ keywords = ["ntfs", "transit"] [dependencies] chrono = { version = "0.4", default-features = false, features = ["std", "clock"] } -clap = { version = "3", features = ["derive"] } +clap = { version = "4", features = ["derive"] } tracing = { version = "0.1", features = ["log", "release_max_level_info"] } tracing-subscriber = { version = "0.3", features = ["env-filter"] } transit_model = { path = "../" } diff --git a/ntfs2ntfs/src/main.rs b/ntfs2ntfs/src/main.rs index e10878a7f..88aa7050f 100644 --- a/ntfs2ntfs/src/main.rs +++ b/ntfs2ntfs/src/main.rs @@ -34,36 +34,35 @@ fn get_version() -> &'static str { } #[derive(Debug, Parser)] -#[clap(name = "ntfs2ntfs", about = "Convert an NTFS to an NTFS.", version = get_version())] +#[command(name = "ntfs2ntfs", about = "Convert an NTFS to an NTFS.", version = get_version())] struct Opt { /// Input directory. - #[clap(short = 'i', long = "input", parse(from_os_str), default_value = ".")] + #[arg(short = 'i', long = "input", default_value = ".")] input: PathBuf, /// Output directory. - #[clap(short = 'o', long = "output", parse(from_os_str))] + #[arg(short = 'o', long = "output")] output: Option, /// Current datetime. - #[clap( + #[arg( short = 'x', long, - parse(try_from_str), - default_value = &transit_model::CURRENT_DATETIME + default_value = &**transit_model::CURRENT_DATETIME )] current_datetime: DateTime, /// The maximum distance in meters to compute the tranfer. - #[clap(long, short = 'd', default_value = transit_model::TRANSFER_MAX_DISTANCE)] + #[arg(long, short = 'd', default_value = transit_model::TRANSFER_MAX_DISTANCE)] max_distance: f64, /// The walking speed in meters per second. You may want to divide your /// initial speed by sqrt(2) to simulate Manhattan distances. - #[clap(long, short = 's', default_value = transit_model::TRANSFER_WALKING_SPEED)] + #[arg(long, short = 's', default_value = transit_model::TRANSFER_WALKING_SPEED)] walking_speed: f64, /// Waiting time at stop in seconds. - #[clap(long, short = 't', default_value = transit_model::TRANSFER_WAITING_TIME)] + #[arg(long, short = 't', default_value = transit_model::TRANSFER_WAITING_TIME)] waiting_time: u32, } diff --git a/restrict-validity-period/Cargo.toml b/restrict-validity-period/Cargo.toml index ff9676dcb..7df7b256f 100644 --- a/restrict-validity-period/Cargo.toml +++ b/restrict-validity-period/Cargo.toml @@ -13,7 +13,7 @@ keywords = ["ntfs", "transit"] [dependencies] chrono = { version = "0.4", default-features = false, features = ["std", "clock"] } -clap = { version = "3", features = ["derive"] } +clap = { version = "4", features = ["derive"] } tracing = { version = "0.1", features = ["log", "release_max_level_info"] } tracing-subscriber = { version = "0.3", features = ["env-filter"] } transit_model = { path = "../" } diff --git a/restrict-validity-period/src/main.rs b/restrict-validity-period/src/main.rs index 6017ec4e0..939e6b7dd 100644 --- a/restrict-validity-period/src/main.rs +++ b/restrict-validity-period/src/main.rs @@ -26,34 +26,33 @@ use tracing_subscriber::{ use transit_model::{Model, Result}; #[derive(Debug, Parser)] -#[clap( +#[command( name = "restrict-validity-period", about = "Restrict the validity period of a NTFS and purge out-of-date data.", rename_all = "kebab-case" )] struct Opt { /// input directory. - #[clap(short, long, parse(from_os_str), default_value = ".")] + #[arg(short, long, default_value = ".")] input: PathBuf, /// start of the desired validity period [included], e.g. 2019-01-01 - #[clap(short, long)] + #[arg(short, long)] start_validity_date: NaiveDate, /// end of the desired validity period [included], e.g. 2019-01-01 - #[clap(short, long)] + #[arg(short, long)] end_validity_date: NaiveDate, /// output directory - #[clap(short, long, parse(from_os_str))] + #[arg(short, long)] output: PathBuf, /// current datetime - #[clap( + #[arg( short = 'x', long, - parse(try_from_str), - default_value = &transit_model::CURRENT_DATETIME + default_value = &**transit_model::CURRENT_DATETIME )] current_datetime: DateTime, } From 5e20b7cc0eb5ff80eb04a4b2a3f310bff445e2cf Mon Sep 17 00:00:00 2001 From: David Quintanel Date: Tue, 24 Jan 2023 17:18:15 +0100 Subject: [PATCH 2/4] upgrade proj 9.3.0 --- .../continuous-integration-deb11.yml | 8 +- .github/workflows/continuous-integration.yml | 164 ------------------ Cargo.toml | 2 +- Dockerfile | 9 - Dockerfile_deb11 | 4 +- Makefile | 11 +- 6 files changed, 14 insertions(+), 184 deletions(-) delete mode 100644 .github/workflows/continuous-integration.yml delete mode 100644 Dockerfile diff --git a/.github/workflows/continuous-integration-deb11.yml b/.github/workflows/continuous-integration-deb11.yml index 2833bd091..3e984e1ed 100644 --- a/.github/workflows/continuous-integration-deb11.yml +++ b/.github/workflows/continuous-integration-deb11.yml @@ -29,7 +29,7 @@ jobs: name: Rust fmt check needs: aws_creds runs-on: [self-hosted, dataeng, sandbox] - container: + container: image: 162230498103.dkr.ecr.eu-west-1.amazonaws.com/mutable-rust-ci:latest-deb11 credentials: username: AWS @@ -43,7 +43,7 @@ jobs: needs: aws_creds runs-on: [self-hosted, dataeng, sandbox] container: - image: 162230498103.dkr.ecr.eu-west-1.amazonaws.com/mutable-rust-ci:latest-proj8.1.1-deb11 + image: 162230498103.dkr.ecr.eu-west-1.amazonaws.com/mutable-rust-ci:latest-proj9.3.0-deb11 credentials: username: AWS password: ${{ needs.aws_creds.outputs.token }} @@ -56,7 +56,7 @@ jobs: needs: aws_creds runs-on: [self-hosted, dataeng, sandbox] container: - image: 162230498103.dkr.ecr.eu-west-1.amazonaws.com/mutable-rust-ci:latest-proj8.1.1-deb11 + image: 162230498103.dkr.ecr.eu-west-1.amazonaws.com/mutable-rust-ci:latest-proj9.3.0-deb11 credentials: username: AWS password: ${{ needs.aws_creds.outputs.token }} @@ -71,7 +71,7 @@ jobs: needs: aws_creds runs-on: [self-hosted, dataeng, sandbox] container: - image: 162230498103.dkr.ecr.eu-west-1.amazonaws.com/mutable-rust-ci:latest-proj8.1.1-deb11 + image: 162230498103.dkr.ecr.eu-west-1.amazonaws.com/mutable-rust-ci:latest-proj9.3.0-deb11 credentials: username: AWS password: ${{ needs.aws_creds.outputs.token }} diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml deleted file mode 100644 index f93a741db..000000000 --- a/.github/workflows/continuous-integration.yml +++ /dev/null @@ -1,164 +0,0 @@ -name: Continuous Integration - -on: - push: - branches: [master] - tags: - - '*' - pull_request: - -env: - SBX_ECR_REGISTRY: "769000229800.dkr.ecr.eu-west-1.amazonaws.com" - PRD_ECR_REGISTRY: "162230498103.dkr.ecr.eu-west-1.amazonaws.com" - REGION: eu-west-1 - ECR_IMAGE: datahub-common-transit_model - -jobs: - aws_creds: - name: Get ECR Access - runs-on: [self-hosted, dataeng, sandbox] - outputs: - token: ${{ steps.ecr_token.outputs.token }} - steps: - - id: ecr_token - name: Get ECR Token - run: | - echo token=$(aws ecr get-login-password --region $REGION) >> $GITHUB_OUTPUT - - rustfmt: - name: Rust fmt check - needs: aws_creds - runs-on: [self-hosted, dataeng, sandbox] - container: - image: 162230498103.dkr.ecr.eu-west-1.amazonaws.com/mutable-rust-ci:latest - credentials: - username: AWS - password: ${{ needs.aws_creds.outputs.token }} - steps: - - uses: actions/checkout@v3 - - name: Format - run: make format - - name: Failure Slack notif - if: failure() - run: | - curl -s -X POST -H "Content-Type: application/json" -d '${{ env.SLACK_TEXT }}' ${{ secrets.SLACK_CORE_TOOLS_TEAM_URL }} - env: - SLACK_TEXT: '{"attachments":[{ - "pretext": "`transit_model CI` requires your attention", - "text":" :warning: Rust fmt check failed","color":"#D00000", - "fields":[{"title":"Action URL","value": "https://github.com${{ github.action_path }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"}]}]}' - clippy: - name: Clippy check - needs: aws_creds - runs-on: [self-hosted, dataeng, sandbox] - container: - image: 162230498103.dkr.ecr.eu-west-1.amazonaws.com/mutable-rust-ci:latest-proj8.1.0 - credentials: - username: AWS - password: ${{ needs.aws_creds.outputs.token }} - steps: - - uses: actions/checkout@v3 - - name: Lint - run: make lint - - name: Failure Slack notif - if: failure() - run: | - curl -s -X POST -H "Content-Type: application/json" -d '${{ env.SLACK_TEXT }}' ${{ secrets.SLACK_CORE_TOOLS_TEAM_URL }} - env: - SLACK_TEXT: '{"attachments":[{ - "pretext": "`transit_model CI` requires your attention", - "text":" :warning: Clippy check failed","color":"#D00000", - "fields":[{"title":"Action URL","value": "https://github.com${{ github.action_path }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"}]}]}' - audit: - name: Security audit - needs: aws_creds - runs-on: [self-hosted, dataeng, sandbox] - container: - image: 162230498103.dkr.ecr.eu-west-1.amazonaws.com/mutable-rust-ci:latest-proj8.1.0 - credentials: - username: AWS - password: ${{ needs.aws_creds.outputs.token }} - continue-on-error: true - steps: - - uses: actions/checkout@v3 - - name: Audit - run: | - cargo audit - - name: Failure Slack notif - if: failure() - run: | - curl -s -X POST -H "Content-Type: application/json" -d '${{ env.SLACK_TEXT }}' ${{ secrets.SLACK_CORE_TOOLS_TEAM_URL }} - env: - SLACK_TEXT: '{"attachments":[{ - "pretext": "`transit_model CI` requires your attention", - "text":" :warning: Security audit failed","color":"#D00000", - "fields":[{"title":"Action URL","value": "https://github.com${{ github.action_path }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"}]}]}' - tests: - name: Tests - needs: aws_creds - runs-on: [self-hosted, dataeng, sandbox] - container: - image: 162230498103.dkr.ecr.eu-west-1.amazonaws.com/mutable-rust-ci:latest-proj8.1.0 - credentials: - username: AWS - password: ${{ needs.aws_creds.outputs.token }} - steps: - - name: Checkout repository and submodules - uses: actions/checkout@v3 - with: - submodules: recursive # for tests/NeTEx - - name: Install xmllint - run: apt update && apt install --yes libxml2-utils - - name: Run tests with and without features - run: make test - - name: Failure Slack notif - if: failure() - run: | - curl -s -X POST -H "Content-Type: application/json" -d '${{ env.SLACK_TEXT }}' ${{ secrets.SLACK_CORE_TOOLS_TEAM_URL }} - env: - SLACK_TEXT: '{"attachments":[{ - "pretext": "`transit_model CI` requires your attention", - "text":" :warning: Tests failed","color":"#D00000", - "fields":[{"title":"Action URL","value": "https://github.com${{ github.action_path }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"}]}]}' - build-n-push: - needs: [rustfmt, clippy, audit, tests] - if: github.event_name == 'push' - runs-on: [self-hosted, dataeng, sandbox] - steps: - - name: CleanUp - run: | - sudo chown -R $USER . - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - clean: false - - name: Login to Amazon ECR sandbox - env: - AWS_REGION: eu-west-1 - uses: aws-actions/amazon-ecr-login@v1 - - name: Login to Amazon ECR shared - env: - AWS_REGION: eu-west-1 - uses: aws-actions/amazon-ecr-login@v1 - with: - registries: 162230498103 - - name: Build and Push to SBX ECR - if: success() - run: | - docker build -t ${SBX_ECR_REGISTRY}/${ECR_IMAGE}:latest . - docker push ${SBX_ECR_REGISTRY}/${ECR_IMAGE}:latest - - name: Push release to Prod ECR - if: success() && startsWith(github.ref, 'refs/tags/') - run: | - TAG=${GITHUB_REF_NAME} - docker tag ${SBX_ECR_REGISTRY}/${ECR_IMAGE}:latest ${PRD_ECR_REGISTRY}/${ECR_IMAGE}:${TAG} - docker push ${PRD_ECR_REGISTRY}/${ECR_IMAGE}:${TAG} - - name: Failure Slack notif - if: failure() - run: | - curl -s -X POST -H "Content-Type: application/json" -d '${{ env.SLACK_TEXT }}' ${{ secrets.SLACK_CORE_TOOLS_TEAM_URL }} - env: - SLACK_TEXT: '{"attachments":[{ - "pretext": "`transit_model Publish` requires your attention", - "text":" :warning: Publish on AWS failed","color":"#D00000", - "fields":[{"title":"Action URL","value": "https://github.com${{ github.action_path }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"}]}]}' diff --git a/Cargo.toml b/Cargo.toml index b9d2d1406..1dd83eca7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -54,7 +54,7 @@ minidom_ext = { git = "https://github.com/hove-io/minidom_ext", tag="v1"} minidom_writer = { git = "https://github.com/hove-io/minidom_writer", tag = "v1"} num-traits = "0.2" pretty_assertions = "1" -proj = { version = "0.25", optional = true } # libproj version used by 'proj' crate must be propagated to CI and makefile +proj = { version = "0.27", optional = true } # libproj version used by 'proj' crate must be propagated to CI and makefile relational_types = { git = "https://github.com/hove-io/relational_types", tag = "v2"} rust_decimal = "1" serde = { version = "1", features = ["derive"] } diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index afeb3b3a5..000000000 --- a/Dockerfile +++ /dev/null @@ -1,9 +0,0 @@ -FROM 162230498103.dkr.ecr.eu-west-1.amazonaws.com/mutable-rust-ci:latest-proj8.1.0 as builder -WORKDIR /usr/src/app -COPY . ./ -RUN git describe --tags --always && git status -RUN cargo build --workspace --release -RUN mkdir /usr/src/bin && for file in ls ${CARGO_TARGET_DIR:-./target}/release/*; do if test -f $file -a -x $file; then cp $file /usr/src/bin; fi; done - -FROM 162230498103.dkr.ecr.eu-west-1.amazonaws.com/mutable-proj-ci:8.1.0 -COPY --from=builder /usr/src/bin/* /usr/local/bin/ diff --git a/Dockerfile_deb11 b/Dockerfile_deb11 index d684cf69e..3b53c573f 100644 --- a/Dockerfile_deb11 +++ b/Dockerfile_deb11 @@ -1,9 +1,9 @@ -FROM 162230498103.dkr.ecr.eu-west-1.amazonaws.com/mutable-rust-ci:latest-proj8.1.1-deb11 as builder +FROM 162230498103.dkr.ecr.eu-west-1.amazonaws.com/mutable-rust-ci:latest-proj9.3.0-deb11 as builder WORKDIR /usr/src/app COPY . ./ RUN git describe --tags --always && git status RUN cargo build --workspace --release RUN mkdir /usr/src/bin && for file in ls ${CARGO_TARGET_DIR:-./target}/release/*; do if test -f $file -a -x $file; then cp $file /usr/src/bin; fi; done -FROM 162230498103.dkr.ecr.eu-west-1.amazonaws.com/mutable-proj-ci:8.1.1-deb11 +FROM 162230498103.dkr.ecr.eu-west-1.amazonaws.com/mutable-proj-ci:9.3.0-deb11 COPY --from=builder /usr/src/bin/* /usr/local/bin/ diff --git a/Makefile b/Makefile index 092e56ae6..c14e60b43 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ # Version required by `proj` crate used in cargo.toml -PROJ_VERSION = 8.1.0 +PROJ_VERSION = 9.3.0 install_proj_deps: ## Install dependencies the proj crate needs in order to build libproj from source sudo apt update @@ -14,9 +14,12 @@ install_proj: install_proj_deps ## Install PROJ on system (avoid PROJ recompilin wget https://github.com/OSGeo/proj.4/releases/download/$(PROJ_VERSION)/proj-$(PROJ_VERSION).tar.gz tar -xzvf proj-$(PROJ_VERSION).tar.gz - cd proj-$(PROJ_VERSION) && ./configure --prefix=/usr - make -C proj-$(PROJ_VERSION) - sudo make install -C proj-$(PROJ_VERSION) + cd proj-$(PROJ_VERSION) \ + && mkdir build \ + && cd build \ + && cmake .. \ + && cmake --build . -j11 \ + && sudo cmake --build . --target install rm -rf proj-$(PROJ_VERSION) proj-$(PROJ_VERSION).tar.gz fmt: format ## Check formatting of the code (alias for 'format') From 148f2db33173dd4044431c2e6ad32f476c561b2e Mon Sep 17 00:00:00 2001 From: David Quintanel Date: Thu, 23 Nov 2023 15:48:30 +0100 Subject: [PATCH 3/4] upgrade geo --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 1dd83eca7..01968f493 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -43,7 +43,7 @@ chrono = { version = "0.4", default-features = false, features = ["std", "clock" chrono-tz = { version = "0.8", features = ["serde"] } csv = "1" derivative = "2" -geo = "0.25" +geo = "0.27" iso4217 = "0.3" lazy_static = "1" md5 = "0.7" From 5f75cab95b27370073688b674a879e540dc05269 Mon Sep 17 00:00:00 2001 From: David Quintanel Date: Thu, 23 Nov 2023 15:48:47 +0100 Subject: [PATCH 4/4] bump 0.59.0 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 01968f493..ad1b0007b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] authors = ["Hove ", "Guillaume Pinot "] name = "transit_model" -version = "0.58.0" +version = "0.58.1" license = "AGPL-3.0-only" description = "Transit data management" repository = "https://github.com/hove-io/transit_model"