Skip to content
Open

Pr6 #423

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
f7feec3
Initial commit
Jul 26, 2017
8846c37
readme
lkysow Mar 27, 2023
a40bcaf
whitespace change
bhoggard-sothebys Mar 3, 2026
1640bb6
rename resource
bhoggard-sothebys Mar 4, 2026
3d668cd
atlantis server WIP
bhoggard-sothebys Mar 4, 2026
c6aa533
set up environments
bhoggard-sothebys Mar 4, 2026
db10dbc
Merge branch 'master' into example
bhoggard-sothebys Mar 4, 2026
52fe307
Add CLAUDE.md for Claude Code guidance
bhoggard-sothebys Mar 4, 2026
c04770b
Add Atlantis config for plan-only workflow on prod
bhoggard-sothebys Mar 4, 2026
413eed8
Add server-side config to allow workflow overrides
bhoggard-sothebys Mar 4, 2026
2f0d6f0
whitespace change
bhoggard-sothebys Mar 4, 2026
fd4c0e7
Restrict prod apply to @sothebys/identity team
bhoggard-sothebys Mar 4, 2026
59474d6
whitespace change
bhoggard-sothebys Mar 4, 2026
4ebf969
Merge pull request #1 from bhoggard-sothebys/example
bhoggard-sothebys Mar 4, 2026
d0e1542
change resource names
bhoggard-sothebys Mar 5, 2026
240cbbe
added README for helm setup
bhoggard-sothebys Mar 5, 2026
4a20938
whitespace
bhoggard-sothebys Mar 5, 2026
09bd776
describe env vars
bhoggard-sothebys Mar 5, 2026
8a5b8c0
Merge pull request #3 from bhoggard-sothebys/infrastructure
bhoggard-sothebys Mar 5, 2026
d82c14c
Merge pull request #2 from bhoggard-sothebys/pr2
bhoggard-sothebys Mar 6, 2026
cae7fd1
resource name change
bhoggard-sothebys Mar 6, 2026
c1e2d38
test running a script as part of plan step
bhoggard-sothebys Mar 19, 2026
53c67c1
whitespace change
bhoggard-sothebys Mar 19, 2026
d7f48f6
fix script path
bhoggard-sothebys Mar 19, 2026
c1987d1
fix script path
bhoggard-sothebys Mar 19, 2026
079702f
print just dev/staging/prod
bhoggard-sothebys Mar 19, 2026
008cdc8
set up test dirs with same structure as auth0
bhoggard-sothebys Mar 19, 2026
e61be9c
disable apply and set up ingress
bhoggard-sothebys Mar 19, 2026
f81ae84
rename script and set up auth0-type paths
bhoggard-sothebys Mar 19, 2026
3f15cc6
workflow fix
bhoggard-sothebys Mar 19, 2026
99be6c2
fix script path
bhoggard-sothebys Mar 19, 2026
3c6aee3
add back init
bhoggard-sothebys Mar 19, 2026
c5fad7c
add script to set up env
bhoggard-sothebys Mar 20, 2026
ce12c2e
fix setup-env for mounted secrets
bhoggard-sothebys Mar 20, 2026
51b7dce
use secrets for all atlantis cnfig
bhoggard-sothebys Mar 20, 2026
950b184
add in auth0 secret setup
bhoggard-sothebys Mar 20, 2026
2e1a4af
setup auth0 domain too
bhoggard-sothebys Mar 20, 2026
5634511
don't use secrets for client IDs
bhoggard-sothebys Mar 20, 2026
5a464a7
fix disabling of appy
bhoggard-sothebys Mar 20, 2026
5a3a23c
use env var for disable apply
bhoggard-sothebys Mar 20, 2026
af89595
whitespace change
bhoggard-sothebys Mar 20, 2026
abf7071
ok really disable apply
bhoggard-sothebys Mar 20, 2026
4cc551a
get rid of disable all flag
bhoggard-sothebys Mar 20, 2026
9b1d90b
try disabling apply with a command
bhoggard-sothebys Mar 20, 2026
d7a9ed5
Merge pull request #4 from bhoggard-sothebys/pr3
bhoggard-sothebys Mar 20, 2026
bb7c8b5
changes
bhoggard-sothebys Mar 23, 2026
f88c428
fix paths
bhoggard-sothebys Mar 23, 2026
8f919e1
fix paths
bhoggard-sothebys Mar 23, 2026
505e47d
use proper script setup
bhoggard-sothebys Mar 23, 2026
c549c57
new location for atlantis
bhoggard-sothebys Mar 26, 2026
b1d8f58
fix paths
bhoggard-sothebys Mar 26, 2026
308eccb
path fix again
bhoggard-sothebys Mar 26, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Require @sothebys/identity team approval for prod changes
/prod/ @sothebys/identity
26 changes: 26 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## Overview

This is a simple Terraform example repository designed for use with [Atlantis](https://www.runatlantis.io/) testdrive mode. It contains minimal Terraform configurations across three environments (dev, staging, prod) for demonstrating Atlantis Pull Request automation.

## Repository Structure

- `dev/`, `staging/`, `prod/` - Terraform configurations per environment
- `bin/a-server` - Local Atlantis server startup script (requires `ATLANTIS_WEBHOOK_SECRET` and `ATLANTIS_TOKEN` environment variables)

## Working with Terraform

```bash
# Initialize Terraform in an environment
cd dev && terraform init

# Plan changes
terraform plan

# Apply changes
terraform apply
```

14 changes: 14 additions & 0 deletions bin/a-server
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

export ATLANTIS_GH_USER="bhoggard-sothebys"
export ATLANTIS_GH_WEBHOOK_SECRET="$ATLANTIS_WEBHOOK_SECRET"
export ATLANTIS_GH_TOKEN="$ATLANTIS_TOKEN"
export ATLANTIST_GH_WEBHOOK_SECRET="$ATLANTIS_WEBHOOK_SECRET"
# export ATLANTIST_GH_TEAM_ALLOWLIST=":plan,:policy_check,@sothebys/identity:apply"
export ATLANTIST_GH_TEAM_ALLOWLIST=":plan,:policy_check,@sothebys/nobody:apply"

atlantis server \
--atlantis-url="https://956c-100-38-10-160.ngrok-free.app" \
--repo-allowlist="github.com/bhoggard-sothebys/atlantis-example" \
--repo-config="$(dirname "$0")/../repos.yaml"

1 change: 1 addition & 0 deletions infrastructure/helm/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
charts/
19 changes: 19 additions & 0 deletions infrastructure/helm/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Atlantis Helm setup

## Setup

The following environment variables must be defined:

- ATLANTIS_TOKEN - a fine-grained GitHub token - details TBD
- ATLANTIS_WEBHOOK_SECRET - see https://github.com/bhoggard-sothebys/atlantis-example/settings/hooks

Then run

```bash
helm upgrade --install atlantis runatlantis/atlantis \
--kubeconfig "$HOME/kube_config_cluster.yml" \
-f values.yaml \
--set github.user="bhoggard-sothebys" \
--set github.token="$ATLANTIS_TOKEN" \
--set github.secret="$ATLANTIS_WEBHOOK_SECRET"
```
17 changes: 17 additions & 0 deletions infrastructure/helm/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: atlantis
spec:
ingressClassName: traefik
rules:
- host: atlantis.lvh.me
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: atlantis
port:
number: 80
55 changes: 55 additions & 0 deletions infrastructure/helm/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
orgAllowlist: "github.com/bhoggard-sothebys/atlantis-example"

environment:
ATLANTIS_WEB_BASIC_AUTH: "true"
ATLANTIS_GH_USER: bhoggard-sothebys
DEV_AUTH0_DOMAIN: sothelabs.auth0.com
STAGING_AUTH0_DOMAIN: sothebys-stg.auth0.com
PROD_AUTH0_DOMAIN: sothebys.auth0.com
DEV_AUTH0_CLIENT_ID: rhqbwencyHvtCTouEqLd76Iippucb8De
STAGING_AUTH0_CLIENT_ID: CDTuWIVBChmrTkHtO4q3cx1cxlTVLW1b
PROD_AUTH0_CLIENT_ID: xtFW63CtGXxydb6LGPWYp30FwLncl2oL

ingress:
enabled: true
ingressClassName: traefik
host: atlantis.lvh.me
path: /
pathType: Prefix

environmentSecrets:
- name: ATLANTIS_WEB_USERNAME
secretKeyRef:
name: atlantis
key: basic-auth-username
- name: ATLANTIS_WEB_PASSWORD
secretKeyRef:
name: atlantis
key: basic-auth-password
- name: ATLANTIS_GH_TOKEN
secretKeyRef:
name: atlantis
key: github-token
- name: ATLANTIS_GH_WEBHOOK_SECRET
secretKeyRef:
name: atlantis
key: github-secret
- name: DEV_AUTH0_CLIENT_SECRET
secretKeyRef:
name: atlantis
key: dev-auth0-client-secret
- name: STAGING_AUTH0_CLIENT_SECRET
secretKeyRef:
name: atlantis
key: staging-auth0-client-secret
- name: PROD_AUTH0_CLIENT_SECRET
secretKeyRef:
name: atlantis
key: prod-auth0-client-secret

repoConfig: |
repos:
- id: /.*/
allowed_overrides: [workflow, apply_requirements]
allow_custom_workflows: true
repo_config_file: standalone/auth0/atlantis.yaml
9 changes: 9 additions & 0 deletions scripts/setup-env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
# Outputs an environment-specific variable value based on the project directory.
# Used as an Atlantis env step command — stdout becomes the variable value.
# Usage: setup-env.sh <VARIABLE_SUFFIX>
# Example: setup-env.sh AUTH0_CLIENT_ID → resolves DEV_AUTH0_CLIENT_ID for dev

ENV="${REPO_REL_DIR##*/}"
ENV_UPPER=$(echo "${ENV}" | tr '[:lower:]' '[:upper:]')
eval echo "\$${ENV_UPPER}_${1}"
3 changes: 3 additions & 0 deletions scripts/verify-env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
echo "AUTH0_CLIENT_ID: ${AUTH0_CLIENT_ID}"
echo "AUTH0_DOMAIN: ${AUTH0_DOMAIN}"
19 changes: 19 additions & 0 deletions standalone/auth0/atlantis.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
version: 3
projects:
- name: dev
dir: standalone/auth0/settings/dev
workflow: custom
- name: staging
dir: standalone/auth0/settings/staging
workflow: custom
- name: prod
dir: standalone/auth0/settings/prod
workflow: custom
apply_requirements: [approved]
workflows:
custom:
plan:
steps:
- run: ../../scripts/setup-env.sh
- init
- plan
3 changes: 3 additions & 0 deletions standalone/auth0/settings/dev/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
resource "null_resource" "example1" {
}

3 changes: 3 additions & 0 deletions standalone/auth0/settings/prod/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
resource "null_resource" "example1" {
}

3 changes: 3 additions & 0 deletions standalone/auth0/settings/staging/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
resource "null_resource" "example1" {
}