jeuko's picture
Sync from GitHub (main)
8018595 verified
#!/usr/bin/env bash
set -ex
# Update package lists
apt-get update
# ----- Linux Packages ----- #
apt-get install -y curl wget
# ----- Locales ----- #
# Install locales and configure
apt-get install -y locales
echo "en_US.UTF-8 UTF-8" > /etc/locale.gen
locale-gen en_US.UTF-8
update-locale LANG=en_US.UTF-8
# ----------------- Python -----------------
# Update package lists
apt-get update
# Install necessary packages
apt-get install -y ssh locales git
# Configure locale
echo "en_US.UTF-8 UTF-8" > /etc/locale.gen
locale-gen
# Git configuration
git config --global --add safe.directory /workspaces/sentinel
# Install Python package in editable mode
pip install --editable .
# Stash any changes before rebuilding the container
git stash push -m "Stashed changes before (re)building the container"
git stash apply 0
# ----------------- Docker -----------------
apt-get update && apt-get install -y docker.io && apt-get clean -y
# ----------------- Google Cloud SDK -----------------
# Install prerequisites for Google Cloud SDK
apt-get install -y apt-transport-https ca-certificates gnupg curl
# Import the Google Cloud public key
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg
# Add the Google Cloud SDK repository
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | tee /etc/apt/sources.list.d/google-cloud-sdk.list
# Update package lists again with new repository
apt-get update
# Install Google Cloud CLI
apt-get install -y google-cloud-cli
# Authenticate Docker with Google Cloud
gcloud auth configure-docker -q gcr.io
# gcloud auth login --project <sentinel> --no-launch-browser