Skip to content

Instantly share code, notes, and snippets.

@ifuller1
Created November 11, 2018 18:03
Show Gist options
  • Save ifuller1/f33541f8c008bd085ffb90c92c20e4d2 to your computer and use it in GitHub Desktop.
Save ifuller1/f33541f8c008bd085ffb90c92c20e4d2 to your computer and use it in GitHub Desktop.
#!/bin/zsh
if [[ $1 == "" ]]; then
echo "Please provide a project id e.g. ./scripts/setup your-project-id"
exit
fi
#define variables
PROJECT_ID=$1
COMPOSER_ID="$1-composer"
# required for composer
gcloud components install kubectl
# Setup the project
gcloud beta composer environments create --project $PROJECT_ID $COMPOSER_ID --location europe-west1 --image-version=composer-1.3.0-airflow-1.9.0 --python-version=3
# Provide some env variables
gcloud composer environments run --project $PROJECT_ID $COMPOSER_ID --location europe-west1 variables -- --set gcp_project $PROJECT_ID
gcloud composer environments run --project $PROJECT_ID $COMPOSER_ID --location europe-west1 variables -- --set gce_zone europe-west1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment