Skip to content

Commit

Permalink
feat: sync install
Browse files Browse the repository at this point in the history
  • Loading branch information
somehowchris authored Jun 5, 2022
1 parent ce1ac0f commit 7320c1e
Show file tree
Hide file tree
Showing 8 changed files with 69 additions and 47 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ jobs:
matrix:
dockerfile: ["Containerfile.codespaces", "Containerfile.gitpod"]
steps:
- name: Maximize build space
uses: easimon/maximize-build-space@master
with:
remove-dotnet: 'true'
remove-android: 'true'
- name: Checkout repository and submodules
uses: actions/checkout@v3
with:
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ jobs:
- path: "Containerfile.gitpod"
name: "gitpod"
steps:
- name: Maximize build space
uses: easimon/maximize-build-space@master
with:
remove-dotnet: 'true'
remove-android: 'true'
- name: Checkout repository and submodules
uses: actions/checkout@v3
with:
Expand Down
4 changes: 2 additions & 2 deletions Containerfile.codespaces
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ COPY scripts/install/rust_tooling.sh /setup/install/rust_tooling.sh
RUN bash /setup/install/rust_tooling.sh

COPY scripts/install/cargo_tooling.sh /setup/install/cargo_tooling.sh
RUN bash /setup/install/cargo_tooling.sh
RUN bash /setup/install/cargo_tooling.sh

COPY scripts/install/container_tooling.sh /setup/install/container_tooling.sh
RUN bash /setup/install/container_tooling.sh
RUN sudo bash /setup/install/container_tooling.sh

COPY scripts/install/act.sh /setup/install/act.sh
RUN bash /setup/install/act.sh
2 changes: 1 addition & 1 deletion Containerfile.gitpod
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ COPY scripts/install/cargo_tooling.sh /setup/install/cargo_tooling.sh
RUN bash /setup/install/cargo_tooling.sh

COPY scripts/install/container_tooling.sh /setup/install/container_tooling.sh
RUN bash /setup/install/container_tooling.sh
RUN sudo bash /setup/install/container_tooling.sh

COPY scripts/install/act.sh /setup/install/act.sh
RUN bash /setup/install/act.sh
1 change: 1 addition & 0 deletions scripts/install/apt_packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ sudo wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd6
valgrind\
build-essential\
apt-utils\
libclang-dev\
&& sudo rm -rf /var/lib/apt/lists/*
59 changes: 33 additions & 26 deletions scripts/install/cargo_tooling.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,41 @@ set -o pipefail
sudo wget https://github.com/ryankurte/cargo-binstall/releases/latest/download/cargo-binstall-$(uname -m)-unknown-linux-musl.tgz -O /usr/local/bin/cargo-binstall.tgz
sudo tar -xf /usr/local/bin/cargo-binstall.tgz -C /usr/local/bin/

# TODO use cargo-binstall once its fixed
# install cargo subcommands via cargo-binstall
install_via_cargo_binstall() {
cargo-binstall $1 --no-confirm
cargo install $1 --force
}

install_via_cargo_binstall cargo-watch &\
install_via_cargo_binstall cargo-outdated &\
install_via_cargo_binstall cargo-audit &\
install_via_cargo_binstall cargo-udeps &\
install_via_cargo_binstall cargo-geiger &\
install_via_cargo_binstall cargo-all-features &\
install_via_cargo_binstall cargo-whatfeatures &\
install_via_cargo_binstall cargo-spellcheck &\
install_via_cargo_binstall cargo-expand &\
install_via_cargo_binstall flamegraph &\
install_via_cargo_binstall cargo-tarpaulin &\
install_via_cargo_binstall cargo-nextest &\
install_via_cargo_binstall cargo-benchcmp &\
install_via_cargo_binstall cargo-tomlfmt &\
install_via_cargo_binstall cargo-sort &\
install_via_cargo_binstall cargo-license &\
install_via_cargo_binstall cargo-modules &\
install_via_cargo_binstall cargo-profiler &\
install_via_cargo_binstall cargo-deps &\
install_via_cargo_binstall cargo-deadlinks &\
install_via_cargo_binstall cargo-bloat &\
install_via_cargo_binstall cargo-linked &\
install_via_cargo_binstall cargo-grammarly &\
install_via_cargo_binstall cargo-watch
install_via_cargo_binstall cargo-outdated
install_via_cargo_binstall cargo-audit
install_via_cargo_binstall cargo-udeps
install_via_cargo_binstall cargo-geiger
install_via_cargo_binstall cargo-all-features
install_via_cargo_binstall cargo-whatfeatures
install_via_cargo_binstall cargo-spellcheck
install_via_cargo_binstall cargo-expand
install_via_cargo_binstall flamegraph
install_via_cargo_binstall cargo-tarpaulin
install_via_cargo_binstall cargo-nextest
install_via_cargo_binstall cargo-benchcmp
install_via_cargo_binstall cargo-tomlfmt
install_via_cargo_binstall cargo-sort
install_via_cargo_binstall cargo-license
install_via_cargo_binstall cargo-modules
install_via_cargo_binstall cargo-profiler
install_via_cargo_binstall cargo-deps
install_via_cargo_binstall cargo-deadlinks
install_via_cargo_binstall cargo-bloat
install_via_cargo_binstall cargo-linked
install_via_cargo_binstall cargo-grammarly
install_via_cargo_binstall trunk
install_via_cargo_binstall wasm-bindgen-cli
install_via_cargo_binstall minifier

sudo wget -O /usr/local/bin/minify https://wilsonl.in/minify-html/bin/0.8.0-linux-x86_64
sudo chmod +x /usr/local/bin/minify

# cargo binstall does not use features
cargo install diesel_cli --features=default,postgres,sqlite,mysql --force &\
& wait
cargo install diesel_cli --features=default,postgres,sqlite,mysql --force
36 changes: 19 additions & 17 deletions scripts/install/container_tooling.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ fi
sudo apt-get update
sudo apt-get upgrade -y
# needs to be installed before podman...
sudo apt-get install -y fuse-overlayfs
sudo apt-get install -y fuse-overlayfs qemu-user-static
sudo apt-get install podman -y

# setting up podman
Expand All @@ -32,28 +32,30 @@ sudo sed -i '/^driver = "overlay"/ c\driver = "vfs"' /etc/containers/storage.con
# && sed -i '/^# events_logger = "journald"/ a events_logger = "file"' /etc/containers/containers.conf \


# TODO rootless docker & docker buildx
# docker
sudo apt install kmod -y
echo "export XDG_RUNTIME_DIR=$HOME/.docker/run" | sudo tee -a ~/.bashrc
echo "export PATH=$HOME/bin:$PATH" | sudo tee -a ~/.bashrc
echo "export DOCKER_HOST=unix:///var/run/docker.sock" | sudo tee -a ~/.bashrc
#sudo apt install -y kmod dbus-user-session fuse-overlayfs slirp4netns
#echo "export XDG_RUNTIME_DIR=$HOME/.docker/run" | sudo tee -a ~/.bashrc
#echo "export PATH=$HOME/bin:$PATH" | sudo tee -a ~/.bashrc
#echo "export DOCKER_HOST=unix:///var/run/docker.sock" | sudo tee -a ~/.bashrc
#echo "export FORCE_ROOTLESS_INSTALL=true" | sudo tee -a ~/.bashrc

export XDG_RUNTIME_DIR=$HOME/.docker/run
export PATH=$HOME/bin:$PATH
export DOCKER_HOST=unix:///var/run/docker.sock
#export XDG_RUNTIME_DIR=$HOME/.docker/run
#export PATH=$HOME/bin:$PATH
#export DOCKER_HOST=unix:///var/run/docker.sock

mkdir -p $XDG_RUNTIME_DIR
#mkdir -p $XDG_RUNTIME_DIR

sudo echo "$USER:100000:65536" >> /etc/subuid
sudo echo "$USER:100000:65536" >> /etc/subgid
#echo "$USER:100000:65536" >> /etc/subuid
#echo "$USER:100000:65536" >> /etc/subgid

export FORCE_ROOTLESS_INSTALL="true"
#export FORCE_ROOTLESS_INSTALL="false"
#printenv
#curl -fsSL https://get.docker.com/rootless | sh

curl -fsSL https://get.docker.com/rootless | sh

rm -f /etc/subgid
rm -f /etc/subuid
#rm -f /etc/subgid
#rm -f /etc/subuid

# setup docker buildx
docker buildx create --use
#docker buildx create --use

4 changes: 3 additions & 1 deletion scripts/install/rust_tooling.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@ install_rustup_channel_with_components stable-musl &\
install_rustup_channel_with_components beta-gnu &\
install_rustup_channel_with_components nightly-gnu &\
install_rustup_channel_with_components stable-gnu &\
wait
wait

rustup target add wasm32-unknown-unknown

0 comments on commit 7320c1e

Please sign in to comment.