Skip to content

Commit

Permalink
Feat/terraform (#1)
Browse files Browse the repository at this point in the history
* terraform migration
  • Loading branch information
chammock authored Jul 29, 2023
1 parent 1e7b5f2 commit 574a263
Show file tree
Hide file tree
Showing 34 changed files with 420 additions and 96 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# name: Terraform
# run-name: Terraform
# on: [push]
# jobs:
# Plan:
# runs-on: ubuntu-latest
# defaults:
# run:
# working-directory: terraform
# steps:
# - uses: Scalr/scalr-action@v1.3.3
# with:
# scalr_hostname: "chammock.scalr.io"
# scalr_token: ${{ secrets.SCALR_TOKEN }}
# scalr_workspace: ws-v0o0gjm3bn049ettu
# terraform_output: true
# - name: Checkout
# uses: actions/checkout@v3.5.3
# - run: ls
# - run: terraform init
# - run: terraform plan
# - run: echo "${{ steps.plan.outputs.stdout }}"
# - run: echo "${{ steps.plan.outputs.stderr }}"
# - run: echo "${{ steps.plan.outputs.exitcode }}"
44 changes: 43 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,44 @@
# Generated files by hugo
public/
.hugo_build.lock
resources/_gen/
assets/jsconfig.json
hugo_stats.json
# Temporary lock file while building
.hugo_build.lock

.terraform.lock.hcl

# Local .terraform directories
**/.terraform/*

# .tfstate files
*.tfstate
*.tfstate.*

# Crash log files
crash.log
crash.*.log

# Exclude all .tfvars files, which are likely to contain sensitive data, such as
# password, private keys, and other secrets. These should not be part of version
# control as they are data points which are potentially sensitive and subject
# to change depending on the environment.
*.tfvars
*.tfvars.json

# Ignore override files as they are usually used to override resources locally and so
# are not checked in
override.tf
override.tf.json
*_override.tf
*_override.tf.json

# Include override files you do wish to add to version control using negated pattern
# !example_override.tf

# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan
# example: *tfplan*

# Ignore CLI configuration files
.terraformrc
terraform.rc
7 changes: 2 additions & 5 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "themes/hugo-coder"]
path = themes/hugo-coder
url = https://github.com/luizdepra/hugo-coder.git
[submodule "themes/coder"]
path = themes/coder
[submodule "src/themes/hugo-coder"]
path = src/themes/hugo-coder
url = https://github.com/luizdepra/hugo-coder.git
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
# chammock.dev
This repo contains the code for my chammock.dev website.


Directories
- terraform - Contains Terraform code to build resources to host website and setup DNS records
- src - Contains website source files build with Hugo


This project was built using [Hugo](https://gohugo.io/) with the theme of [hugo-coder](https://themes.gohugo.io/hugo-coder/).

88 changes: 0 additions & 88 deletions config.toml

This file was deleted.

3 changes: 3 additions & 0 deletions src/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Required Hugo-Extended

To build `hugo --cleanDestinationDir --ignoreCache`
76 changes: 76 additions & 0 deletions src/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
title = "Curtis Hammock | Engineer"
theme = "hugo-coder"
languagecode = "en"
defaultcontentlanguage = "en"
paginate = 20
canonifyurls = true
pygmentsstyle = "dracula"
pygmentscodefences = true
pygmentscodefencesguesssyntax = true

[markup.highlight]
style = "github-dark"

[markup.goldmark.renderer]
unsafe = true

[params]
author = "Curtis Hammock"
info = "Cloud Engineer"
description = "Curtis Hammock's website"
keywords = "blog,developer,engineer,cloud"
avatarurl = "images/avatar.jpg"

favicon_32 = "/images/favicon-32x32.png"
favicon_16 = "/images/favicon-16x16.png"

colorscheme = "dark"

hidecredits = false
hidecopyright = false

rtl = false

math = true
certs = [
"57aab318-9800-4745-912f-9e9960ff2eb9",
"8451e386-e81d-4af0-8491-1606448b697f",
"f0d899ce-82b5-45cf-92b1-89cfc9dc60d5",
"6b0b5b71-e5ac-499a-9c5f-0c7c865ba763",
"607cafba-5178-4bb1-b6c9-945373d93df3",
"134da1c6-60ba-4c5b-9e19-f4595c6df5f2",
"ba38a5b1-e3c2-4ad6-acbc-53629b025858",
"b00222d3-cf35-4255-8739-5041194e8ff6",
"f96dcbda-6f62-4155-ad05-380a3c27687c",
]

# Social links
[[params.social]]
name = "Github"
icon = "fa fa-github fa-2x"
weight = 1
url = "https://github.com/chammock/"
[[params.social]]
name = "Gitlab"
icon = "fa fa-linkedin fa-2x"
weight = 2
url = "https://www.linkedin.com/in/curtishammock/"


# Menu links
[[menu.main]]
name = "About"
weight = 10
url = "/about/"
[[menu.main]]
name = "Certs"
weight = 20
url = "/certs/"
[[menu.main]]
name = "Blog"
weight = 30
url = "/posts/"
[[menu.main]]
name = "Contact"
weight = 40
url = "/contact/"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file added src/static/images/android-chrome-96x96.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file added src/static/images/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/static/images/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/static/images/favicon.ico
Binary file not shown.
26 changes: 26 additions & 0 deletions src/static/images/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions src/static/site.webmanifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "Chammock.dev",
"short_name": "Chammock",
"icons": [
{
"src": "/images/android-chrome-96x96.png",
"sizes": "96x96",
"type": "image/png"
}
],
"theme_color": "#ffffff",
"background_color": "#ffffff",
"display": "standalone"
}
1 change: 1 addition & 0 deletions src/themes/hugo-coder
Submodule hugo-coder added at c3df12
Binary file removed static/images/favicon-16x16.png
Binary file not shown.
Binary file removed static/images/favicon-32x32.png
Binary file not shown.
Binary file removed static/images/favicon.ico
Binary file not shown.
11 changes: 11 additions & 0 deletions terraform/backend.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

terraform {
backend "remote" {
hostname = "chammock.scalr.io"
organization = "env-v0o0gghiuf44rumsf"

workspaces {
prefix = "chammock-dev-"
}
}
}
15 changes: 15 additions & 0 deletions terraform/cloudfront_function.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
function handler(event) {
var request = event.request;
var uri = request.uri;

// Check whether the URI is missing a file name.
if (uri.endsWith('/')) {
request.uri += 'index.html';
}
// Check whether the URI is missing a file extension.
else if (!uri.includes('.')) {
request.uri += '/index.html';
}

return request;
}
Loading

0 comments on commit 574a263

Please sign in to comment.