Skip to content
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

Cleanup and tooling fixes #54

Merged
merged 11 commits into from
Oct 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/target
/Cargo.lock
/bot.sqlite*
/data.ms
/*BotConfig.toml
Expand Down
18 changes: 17 additions & 1 deletion .gitpod.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM gitpod/workspace-rust:2023-03-24-22-45-37
FROM gitpod/workspace-base:2023-10-13-07-50-14

USER root

Expand All @@ -9,3 +9,19 @@ RUN target=/usr/bin/meilisearch \
&& chmod +x "${target}"

USER gitpod

ENV RUST_VERSION="nightly-2023-10-12"
ENV PATH=$HOME/.cargo/bin:$PATH

RUN curl -fsSL https://sh.rustup.rs | sh -s -- -y --no-modify-path --default-toolchain ${RUST_VERSION} \
-c rls rust-analysis rust-src rustfmt clippy \
&& for cmp in rustup cargo; do rustup completions bash "$cmp" > "$HOME/.local/share/bash-completion/completions/$cmp"; done \
&& printf '%s\n' 'export CARGO_HOME=/workspace/.cargo' \
'mkdir -m 0755 -p "$CARGO_HOME/bin" 2>/dev/null' \
'export PATH=$CARGO_HOME/bin:$PATH' \
'test ! -e "$CARGO_HOME/bin/rustup" && mv "$(command -v rustup)" "$CARGO_HOME/bin"' > $HOME/.bashrc.d/80-rust \
&& rm -rf "$HOME/.cargo/registry" # This registry cache is now useless as we change the CARGO_HOME path to `/workspace`

RUN rustup default ${RUST_VERSION} # not needed but anyway \
&& rustup component add clippy \
&& rustup component add rustfmt
11 changes: 3 additions & 8 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
image:
image:
file: .gitpod.Dockerfile

tasks:
- name: Project build (cache) and run instructions
init: |
cargo build

# workaround for https://github.com/gitpod-io/gitpod/issues/524
find target -exec stat --format='%.Y %n' {} + > /workspace/.ts

Expand All @@ -16,10 +16,6 @@ tasks:
# Fully cleanup terminal
printf "\033[3J\033c\033[3J"

# Install clippy and rustfmt
rustup component add clippy --toolchain nightly-2023-06-27
rustup component add rustfmt --toolchain nightly-2023-06-27

# Restore ProdBotConfig.toml
if test -n "${PROD_DISCORD_BOT_CONFIG_ENCODED:-}"; then {
base64 -d <<<"${PROD_DISCORD_BOT_CONFIG_ENCODED}" > ProdBotConfig.toml
Expand Down Expand Up @@ -62,6 +58,5 @@ tasks:
# meilisearch --no-analytics --master-key "${MEILISEARCH_API_KEY}" --env development --http-addr 0.0.0.0:7700 --db-path ./data.ms
vscode:
extensions:
- rust-lang.rust-analyzer
- https://github.com/rust-lang/rust-analyzer/releases/download/2023-10-09/rust-analyzer-linux-x64.vsix
- tamasfe.even-better-toml

2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"rust-analyzer.check.command": "clippy"
"rust-analyzer.check.command": "clippy",
}
Loading
Loading