-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f25536c
commit cb38beb
Showing
1 changed file
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
#!/bin/bash | ||
# | ||
# | ||
# Sets up a dev env with all pre-reqs. This script is idempotent, it will | ||
# only attempt to install dependencies, if not exists. | ||
# | ||
# --------------------------------------------------------------------------------------- | ||
# | ||
|
||
set -e | ||
set -m | ||
|
||
echo "" | ||
echo "┌───────────────────────────────────┐" | ||
echo "│ Checking for package dependencies │" | ||
echo "└───────────────────────────────────┘" | ||
echo "" | ||
|
||
PACKAGES="" | ||
if ! dpkg -l | grep -q build-essential; then PACKAGES="build-essential"; fi | ||
if ! dpkg -l | grep -q pkg-config; then PACKAGES="$PACKAGES pkg-config"; fi | ||
if ! command -v openssl &> /dev/null; then PACKAGES="$PACKAGES openssl libssl-dev"; fi | ||
if [ ! -z "$PACKAGES" ]; then | ||
echo "Packages $PACKAGES not found - installing..." | ||
sudo apt-get update 2>&1 > /dev/null | ||
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y $PACKAGES 2>&1 > /dev/null | ||
fi | ||
|
||
echo "" | ||
echo "┌────────────────────────────────────┐" | ||
echo "│ Checking for language dependencies │" | ||
echo "└────────────────────────────────────┘" | ||
echo "" | ||
|
||
DOTNET_VERSION=8.0 | ||
|
||
if ! command -v dotnet &> /dev/null; then | ||
echo "dotnet not found - installing..." | ||
wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh | ||
chmod +x ./dotnet-install.sh | ||
./dotnet-install.sh --channel 8.0 | ||
rm dotnet-install.sh | ||
|
||
LINES="export DOTNET_ROOT=\$HOME/.dotnet\nexport PATH=\$PATH:\$DOTNET_ROOT:\$DOTNET_ROOT/tools" | ||
echo -e "$LINES" >> ~/.bashrc | ||
source ~/.bashrc | ||
fi | ||
|
||
if ! command -v cargo &> /dev/null; then | ||
echo "cargo not found - installing..." | ||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | ||
source ~/.bashrc | ||
fi | ||
|
||
echo "" | ||
echo "┌────────────────────────┐" | ||
echo "│ Checking for CLI tools │" | ||
echo "└────────────────────────┘" | ||
echo "" | ||
|
||
if ! command -v az &> /dev/null; then | ||
echo "az not found - installing..." | ||
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash | ||
fi | ||
|
||
echo "" | ||
echo "┌──────────┐" | ||
echo "│ Versions │" | ||
echo "└──────────┘" | ||
echo "" | ||
|
||
echo "Dotnet: $(dotnet --version)" | ||
echo "Cargo (Rust): $(cargo version)" | ||
echo "Azure CLI: $(az version)" |