From 28336586c19b7a3062bda1ebbf0769381fe566ce Mon Sep 17 00:00:00 2001 From: Dessalines Date: Wed, 31 Jul 2024 13:52:49 -0400 Subject: [PATCH] Fixing apt-key deprecation, and using apt-get. --- .woodpecker.yml | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index f67c1e44c..0fd45bf29 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -5,6 +5,14 @@ variables: - &rust_image "rust:1.80" - &rust_nightly_image "rustlang/rust:nightly" - &install_pnpm "corepack enable pnpm" + - &install_binstall "wget -O- https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-x86_64-unknown-linux-musl.tgz | tar -xvz -C /usr/local/cargo/bin" + - install_diesel_cli: &install_diesel_cli + - apt-get update && apt-get install -y lsb-release build-essential + - sh -c 'echo "deb https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' + - curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc|sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/postgresql.gpg + - apt-get update && apt-get install -y postgresql-client-16 + - cargo install diesel_cli --no-default-features --features postgres + - export PATH="$CARGO_HOME/bin:$PATH" - &slow_check_paths - event: pull_request path: @@ -25,17 +33,6 @@ variables: "diesel.toml", ".gitmodules", ] - - install_binstall: &install_binstall - - wget https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-x86_64-unknown-linux-musl.tgz - - tar -xvf cargo-binstall-x86_64-unknown-linux-musl.tgz - - cp cargo-binstall /usr/local/cargo/bin - - install_diesel_cli: &install_diesel_cli - - apt update && apt install -y lsb-release build-essential - - sh -c 'echo "deb https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' - - wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - - - apt update && apt install -y postgresql-client-16 - - cargo install diesel_cli --no-default-features --features postgres - - export PATH="$CARGO_HOME/bin:$PATH" steps: prepare_repo: @@ -82,7 +79,7 @@ steps: cargo_machete: image: *rust_nightly_image commands: - - <<: *install_binstall + - *install_binstall - cargo binstall -y cargo-machete - cargo machete when: @@ -205,10 +202,6 @@ steps: # Run all migrations - diesel migration run # Dump schema to before.sqldump (PostgreSQL apt repo is used to prevent pg_dump version mismatch error) - - apt update && apt install -y lsb-release - - sh -c 'echo "deb https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' - - wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - - - apt update && apt install -y postgresql-client-16 - psql -c "DROP SCHEMA IF EXISTS r CASCADE;" - pg_dump --no-owner --no-privileges --no-table-access-method --schema-only --no-sync -f before.sqldump # Make sure that the newest migration is revertable without the `r` schema @@ -232,7 +225,7 @@ steps: DO_WRITE_HOSTS_FILE: "1" commands: - *install_pnpm - - apt update && apt install -y bash curl postgresql-client + - apt-get update && apt-get install -y bash curl postgresql-client - bash api_tests/prepare-drone-federation-test.sh - cd api_tests/ - pnpm i @@ -279,7 +272,7 @@ steps: publish_to_crates_io: image: *rust_image commands: - - <<: *install_binstall + - *install_binstall # Install cargo-workspaces - cargo binstall -y cargo-workspaces - cp -r migrations crates/db_schema/