Giter VIP home page Giter VIP logo

astro's Introduction

Astro

Deploying the resources

Step 1: Connect to Azure and set the context. Replace subscriptionId with the subscription identifier.

Connect-AzAccount
Set-AzContext "subscriptionId"

Step 2: Create the storage account for the Terraform state. Copy the storage account name.

./scripts/New-StorageAccount.ps1

Step 3: Set the variables. Replace storage_account with the storage account name.

export STORAGE_ACCOUNT="storage_account"
export APP="astro"
export LOCATION="northeurope"
export ENVIRONMENT="staging"
export RESOURCE_GROUP="rg-state-astro-neu"
export TF_VAR_app=${APP}
export TF_VAR_location=${LOCATION}
export TF_VAR_environment=${ENVIRONMENT}
export TF_VAR_resource_group=${RESOURCE_GROUP}
export TF_VAR_storage_account=${STORAGE_ACCOUNT}

Step 4: Initialize Terraform for each section.

cd terraform/shared && \
terraform init \
  -backend-config="storage_account_name=${STORAGE_ACCOUNT}" \
  -backend-config="resource_group_name=${RESOURCE_GROUP}" \
  -backend-config="key=${LOCATION}.tfstate"
cd ../environment && \
terraform init \
  -backend-config="storage_account_name=${STORAGE_ACCOUNT}" \
  -backend-config="resource_group_name=${RESOURCE_GROUP}" \
  -backend-config="key=${ENVIRONMENT}.${LOCATION}.tfstate"

Step 5: Deploy the resources for each section.

cd ../shared && \
terraform apply -auto-approve
cd ../environment && \
terraform apply -auto-approve

Step 6: Connect to the cluster.

Step 7: Install the Flux CLI.

brew install fluxcd/tap/flux

Step 8: Create a GitHub personal access token with the repo scope.

Step 9: Set the variable. Replace gh_token with the personal access token.

export GITHUB_TOKEN="gh_token"

Step 10: Bootstrap Flux.

flux bootstrap github \
  --owner=smorenburg \
  --repository=astro-source \
  --branch=main \
  --path=clusters/${ENVIRONMENT} \
  --personal \
  --private=false

Destroying the resources

Step 1: Destroy the resources for each section.

cd terraform/environment && \
terraform destroy -auto-approve
cd ../shared && \
terraform destroy -auto-approve

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.