-
-
Notifications
You must be signed in to change notification settings - Fork 887
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stop using a diesel_cli docker image, use cargo-install in woodpecker. #4723
Changes from 1 commit
42e2dfe
8f34d97
7cb5289
0549103
02036cf
5cf116b
e75d502
2c834be
b556975
0c9124e
1a913e1
7f73815
7b9db79
6f75705
eabc846
136f0f3
b05a53e
bc227d1
ca65ddc
f60c2df
332c7ef
3340ab3
6aafc20
5dad74b
ae8c062
4b8118d
16a0f39
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- The diesel_cli image is 500MB, and rebuilt daily. Much easier to use binstall to install it.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -79,9 +79,11 @@ steps: | |
cargo_machete: | ||
image: rustlang/rust:nightly | ||
commands: | ||
# Install cargo 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 cargo-machete | ||
- cargo binstall -y cargo-machete | ||
- cargo machete | ||
when: | ||
|
@@ -133,11 +135,17 @@ steps: | |
when: *slow_check_paths | ||
|
||
check_diesel_schema: | ||
image: willsquire/diesel-cli | ||
image: *rust_image | ||
environment: | ||
CARGO_HOME: .cargo_home | ||
DATABASE_URL: postgres://lemmy:password@database:5432/lemmy | ||
commands: | ||
# Install cargo 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 | ||
- cargo binstall -y diesel_cli --no-default-features --features postgres | ||
- diesel migration run | ||
- diesel print-schema --config-file=diesel.toml > tmp.schema | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. After #4673 is finished, this will be the only place where diesel cli is needed. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice. |
||
- diff tmp.schema crates/db_schema/src/schema.rs | ||
|
@@ -197,7 +205,12 @@ steps: | |
PGHOST: database | ||
PGDATABASE: lemmy | ||
commands: | ||
- cargo install diesel_cli | ||
# Install cargo 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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wget and tar should not need to be run again. It might be possible to also remove cp and replace |
||
# Install diesel_cli | ||
- cargo binstall -y diesel_cli --no-default-features --features postgres | ||
- export PATH="$CARGO_HOME/bin:$PATH" | ||
# Run all migrations | ||
- diesel migration run | ||
|
@@ -276,7 +289,12 @@ steps: | |
publish_to_crates_io: | ||
image: *rust_image | ||
commands: | ||
- cargo install cargo-workspaces | ||
# Install cargo 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 cargo-workspaces | ||
- cargo binstall -y cargo-workspaces | ||
- cp -r migrations crates/db_schema/ | ||
- cargo workspaces publish --token "$CARGO_API_TOKEN" --from-git --allow-dirty --no-verify --allow-branch "${CI_COMMIT_TAG}" --yes custom "${CI_COMMIT_TAG}" | ||
secrets: [cargo_api_token] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if there's a way to extract and run multiple lines in yaml... if anyone knows how to do this that'd be appreciated.