Skip to content
This repository has been archived by the owner on Jun 19, 2024. It is now read-only.

Commit

Permalink
feat: adds tutorial #2 for getting started with Atmos (#1)
Browse files Browse the repository at this point in the history
* feat: adds tutorial #2 for getting started with Atmos

* feat: updates tutorials repo with github/init target

* chore: adds lock files for terraform components

* chore: updates README to respectable state

* feat: slims down Dockerfile + removes cli/ folder + updates Makefile

* chore: applies suggestions from Erik's code review

Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <[email protected]>

* chore: cleans up Dockerfile

* chore: removes terraform.lock.hcl files

* feat: updates fetch-location to use data.http > data.external

* feat: updates to canonical stack definition

* feat: updates to use template file > templates HEREDOC

* feat: updates fetch-location to use different API

* feat: updates to use different fetch-weather API + date var > unit var

* feat: adds the weather_date to template + output

* feat: updates to latest geodesic, drops `--login` as atmos image CMD

* Update 02-atmos/README.md

Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <[email protected]>
  • Loading branch information
Gowiem and osterman authored Mar 25, 2021
1 parent f9f60e7 commit bf6bb3c
Show file tree
Hide file tree
Showing 23 changed files with 901 additions and 1 deletion.
25 changes: 25 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Use this file to define individuals or teams that are responsible for code in a repository.
# Read more: <https://help.github.com/articles/about-codeowners/>
#
# Order is important: the last matching pattern has the highest precedence

# These owners will be the default owners for everything
* @cloudposse/engineering @cloudposse/contributors

# Cloud Posse must review any changes to Makefiles
**/Makefile @cloudposse/engineering
**/Makefile.* @cloudposse/engineering

# Cloud Posse must review any changes to GitHub actions
.github/* @cloudposse/engineering

# Cloud Posse must review any changes to standard context definition,
# but some changes can be rubber-stamped.
**/*.tf @cloudposse/engineering @cloudposse/approvers
README.yaml @cloudposse/engineering @cloudposse/approvers
README.md @cloudposse/engineering @cloudposse/contributors @cloudposse/approvers
docs/*.md @cloudposse/engineering @cloudposse/contributors @cloudposse/approvers

# Cloud Posse Admins must review all changes to CODEOWNERS or the mergify configuration
.github/mergify.yml @cloudposse/admins
.github/CODEOWNERS @cloudposse/admins
37 changes: 37 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: 'bug'
assignees: ''

---

Found a bug? Maybe our [Slack Community](https://slack.cloudposse.com) can help.

[![Slack Community](https://slack.cloudposse.com/badge.svg)](https://slack.cloudposse.com)

## Describe the Bug
A clear and concise description of what the bug is.

## Expected Behavior
A clear and concise description of what you expected to happen.

## Steps to Reproduce
Steps to reproduce the behavior:
1. Go to '...'
2. Run '....'
3. Enter '....'
4. See error

## Screenshots
If applicable, add screenshots or logs to help explain your problem.

## Environment (please complete the following information):

Anything that will help us triage the bug will help. Here are some ideas:
- OS: [e.g. Linux, OSX, WSL, etc]
- Version [e.g. 10.15]

## Additional Context
Add any other context about the problem here.
18 changes: 18 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
blank_issues_enabled: false

contact_links:

- name: Community Slack Team
url: https://cloudposse.com/slack/
about: |-
Please ask and answer questions here.
- name: Office Hours
url: https://cloudposse.com/office-hours/
about: |-
Join us every Wednesday for FREE Office Hours (lunch & learn).
- name: DevOps Accelerator Program
url: https://cloudposse.com/accelerate/
about: |-
Own your infrastructure in record time. We build it. You drive it.
36 changes: 36 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: Feature Request
about: Suggest an idea for this project
title: ''
labels: 'feature request'
assignees: ''

---

Have a question? Please checkout our [Slack Community](https://slack.cloudposse.com) or visit our [Slack Archive](https://archive.sweetops.com/).

[![Slack Community](https://slack.cloudposse.com/badge.svg)](https://slack.cloudposse.com)

## Describe the Feature

A clear and concise description of what the bug is.

## Expected Behavior

A clear and concise description of what you expected to happen.

## Use Case

Is your feature request related to a problem/challenge you are trying to solve? Please provide some additional context of why this feature or capability will be valuable.

## Describe Ideal Solution

A clear and concise description of what you want to happen. If you don't know, that's okay.

## Alternatives Considered

Explain what alternative solutions or features you've considered.

## Additional Context

Add any other context or screenshots about the feature request here.
Empty file.
13 changes: 13 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## what
* Describe high-level what changed as a result of these commits (i.e. in plain-english, what do these changes mean?)
* Use bullet points to be concise and to the point.

## why
* Provide the justifications for the changes (e.g. business case).
* Describe why these changes were made (e.g. why do these commits fix the problem?)
* Use bullet points to be concise and to the point.

## references
* Link to any supporting github issues or helpful documentation to add some context (e.g. stackoverflow).
* Use `closes #123`, if this PR closes a GitHub issue `#123`

53 changes: 53 additions & 0 deletions .github/auto-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name-template: 'v$RESOLVED_VERSION'
tag-template: '$RESOLVED_VERSION'
version-template: '$MAJOR.$MINOR.$PATCH'
version-resolver:
major:
labels:
- 'major'
minor:
labels:
- 'minor'
- 'enhancement'
patch:
labels:
- 'auto-update'
- 'patch'
- 'fix'
- 'bugfix'
- 'bug'
- 'hotfix'
default: 'minor'

categories:
- title: '🚀 Enhancements'
labels:
- 'enhancement'
- 'patch'
- title: '🐛 Bug Fixes'
labels:
- 'fix'
- 'bugfix'
- 'bug'
- 'hotfix'
- title: '🤖 Automatic Updates'
labels:
- 'auto-update'

change-template: |
<details>
<summary>$TITLE @$AUTHOR (#$NUMBER)</summary>
$BODY
</details>
template: |
$CHANGES
replacers:
# Remove irrelevant information from Renovate bot
- search: '/---\s+^#.*Renovate configuration(?:.|\n)*?This PR has been generated .*/gm'
replace: ''
# Remove Renovate bot banner image
- search: '/\[!\[[^\]]*Renovate\][^\]]*\](\([^)]*\))?\s*\n+/gm'
replace: ''
25 changes: 25 additions & 0 deletions .github/workflows/auto-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: auto-release

on:
push:
branches:
- master

jobs:
publish:
runs-on: ubuntu-latest
steps:
# Get PR from merged commit to master
- uses: actions-ecosystem/action-get-merged-pull-request@v1
id: get-merged-pull-request
with:
github_token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}
# Drafts your next Release notes as Pull Requests are merged into "master"
- uses: release-drafter/release-drafter@v5
if: "!contains(steps.get-merged-pull-request.outputs.labels, 'no-release')"
with:
publish: true
prerelease: false
config-name: auto-release.yml
env:
GITHUB_TOKEN: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}
25 changes: 25 additions & 0 deletions .github/workflows/validate-codeowners.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Validate Codeowners
on:
pull_request:

jobs:
validate-codeowners:
runs-on: ubuntu-latest
steps:
- name: "Checkout source code at current commit"
uses: actions/checkout@v2
- uses: mszostok/[email protected]
if: github.event.pull_request.head.repo.full_name == github.repository
name: "Full check of CODEOWNERS"
with:
# For now, remove "files" check to allow CODEOWNERS to specify non-existent
# files so we can use the same CODEOWNERS file for Terraform and non-Terraform repos
# checks: "files,syntax,owners,duppatterns"
checks: "syntax,owners,duppatterns"
# GitHub access token is required only if the `owners` check is enabled
github_access_token: "${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}"
- uses: mszostok/[email protected]
if: github.event.pull_request.head.repo.full_name != github.repository
name: "Syntax check of CODEOWNERS"
with:
checks: "syntax,duppatterns"
41 changes: 41 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
.build-harness
build-harness/
aws-assumed-role/
.idea/
*.iml

# Compiled and auto-generated files
# Note that the leading "**/" appears necessary for Docker even if not for Git
**/nohup.out
**/*.tfstate
**/*.tfstate.*
**/planfile
**/*.planfile
**/*.kubeconfig
**/terraform.tfvars.json
**/terraform.auto.tfvars.json
**/*.terraform.tfvars.json
**/*.terraform.auto.tfvars.json
**/*.helmfile.vars.yaml
**/vendir.lock.yml

# Module directory
# Note that the leading "**/" appears necessary for Docker even if not for Git
**/.terraform/
**/.module/
**/.helmfile/


# Draft or auto-saved version
# Note that the leading "**/" appears necessary for Docker even if not for Git
**/*.draft.*
**/*.draft
**/*.orig
**/*.bak
**/*~

# macOS special files and folders
**/.DS_Store
**/.CFUserTextEncoding
**/.Trash/
**/$RECYCLE.BIN/
44 changes: 44 additions & 0 deletions 02-atmos/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Things that could be checked into Git but need not be in the Docker image
.git
.editorconfig

# Below here should be pretty much a copy of .gitignore
.build-harness
build-harness/
aws-assumed-role/
.idea/
*.iml

# Compiled and auto-generated files
**/nohup.out
**/*.tfstate
**/*.tfstate.*
**/planfile
**/*.planfile
**/*.kubeconfig
**/terraform.tfvars.json
**/terraform.auto.tfvars.json
**/*.terraform.tfvars.json
**/*.terraform.auto.tfvars.json
**/*.helmfile.vars.yaml
**/vendir.lock.yml

# Module directory
**/.terraform/
**/.module/
**/.helmfile/


# Draft or auto-saved version
# Note that the leading "**/" appears necessary for Docker even if not for Git
**/*.draft.*
**/*.draft
**/*.orig
**/*.bak
**/*~

# macOS special files and folders
**/.DS_Store
**/.CFUserTextEncoding
**/.Trash/
**/$RECYCLE.BIN/
27 changes: 27 additions & 0 deletions 02-atmos/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
ARG VERSION=latest
ARG OS=alpine
ARG CLI_NAME=atmos

FROM cloudposse/geodesic:$VERSION-$OS

# Geodesic message of the Day
ENV MOTD_URL="https://geodesic.sh/motd"

ENV DOCKER_IMAGE="cloudposse/atmos"
ENV DOCKER_TAG="latest"

# Geodesic banner
ENV BANNER="Atmos Tutorial"

# Install terraform.
RUN apk add -u terraform-0.14@cloudposse
# Set Terraform 0.14.x as the default `terraform`.
RUN update-alternatives --set terraform /usr/share/terraform/0.14/bin/terraform

# Install Atmos
RUN apk add atmos@cloudposse

COPY components/ /components/
COPY stacks/ /stacks/

WORKDIR /
26 changes: 26 additions & 0 deletions 02-atmos/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
export DOCKER_ORG ?= cloudposse
export DOCKER_IMAGE ?= $(DOCKER_ORG)/atmos
export DOCKER_TAG ?= latest
export DOCKER_IMAGE_NAME ?= $(DOCKER_IMAGE):$(DOCKER_TAG)

-include $(shell curl -sSL -o .build-harness "https://git.io/build-harness"; echo .build-harness)

## Initialize build-harness, install deps, build docker container, install wrapper script and run shell
all: init deps build run
@exit 0

## Install dependencies (if any)
deps:
@exit 0

## Build docker image
build:
@make --no-print-directory docker/build

run:
@docker run -it \
--rm \
--volume "$$HOME":/localhost \
--volume "$$PWD"/stacks:/stacks \
--volume "$$PWD"/components:/components \
cloudposse/atmos:latest;
3 changes: 3 additions & 0 deletions 02-atmos/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Tutorial #2: Atmos

The code in this directory is an accompaniment to the [Getting started with Atmos](https://docs.cloudposse.com/tutorials/atmos-getting-started/) tutorial on SweetOps.
Loading

0 comments on commit bf6bb3c

Please sign in to comment.