-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #69 from ellie-app/aws-setup
AWS setup
- Loading branch information
Showing
63 changed files
with
2,045 additions
and
671 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,3 +36,8 @@ priv/docs_table | |
.local_tmp/ | ||
.DS_Store | ||
.env* | ||
|
||
*.pem | ||
*.tar.gz | ||
|
||
/config/*.toml |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
.PHONY: help | ||
|
||
VERSION ?= `grep 'version' mix.exs | sed -e 's/ //g' -e 's/version://' -e 's/[",]//g'` | ||
IMAGE_NAME ?= ellie | ||
PWD ?= `pwd` | ||
BUILD ?= `git rev-parse --short HEAD` | ||
|
||
help: | ||
@echo "$(IMAGE_NAME):$(VERSION)" | ||
@perl -nle'print $& if m{^[a-zA-Z_-]+:.*?## .*$$}' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' | ||
|
||
compile: ## Build the application | ||
mix do deps.get, compile | ||
mix do loadpaths, absinthe.schema.json priv/graphql/schema.json | ||
cd assets && \ | ||
npm install && \ | ||
npm run graphql && \ | ||
npm run build | ||
mix phx.digest | ||
|
||
clean: ## Clean up generated artifacts | ||
@rm -rf \ | ||
assets/node_modules \ | ||
assets/elm-stuff \ | ||
priv/graphql \ | ||
priv/bin \ | ||
mix clean --deps | ||
|
||
image: ## Mimic CodeBuild build | ||
$(MAKE) clean | ||
docker run --rm -e BUILD_DIR=/app -v $(PWD):/app -it centos:7 /app/scripts/build all | ||
|
||
release: ## Build a release of the application with MIX_ENV=prod | ||
MIX_ENV=prod mix do deps.get, compile | ||
MIX_ENV=prod mix do loadpaths, absinthe.schema.json priv/graphql/schema.json | ||
cd assets && \ | ||
NODE_ENV=production npm install && \ | ||
NODE_ENV=production npm run graphql && \ | ||
NODE_ENV=production npm run build | ||
MIX_ENV=prod mix phx.digest | ||
MIX_ENV=prod mix release --verbose --env=prod | ||
@cp _build/prod/rel/$(IMAGE_NAME)/releases/$(VERSION)/$(IMAGE_NAME).tar.gz $(IMAGE_NAME).tar.gz | ||
|
||
bootstrap: ## Setup the app dev | ||
$(MAKE) clean | ||
scripts/bootstrap | ||
|
||
server: ## Run the app locally for dev | ||
scripts/server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
version: 0.0 | ||
os: linux | ||
files: | ||
- source: . | ||
destination: /app | ||
hooks: | ||
ApplicationStop: | ||
- location: scripts/stop | ||
timeout: 300 | ||
AfterInstall: | ||
- location: scripts/unpack | ||
- location: scripts/postunpack | ||
runas: root | ||
ApplicationStart: | ||
- location: scripts/binstall | ||
runas: ec2-user | ||
- location: scripts/migrate | ||
runas: ec2-user | ||
timeout: 300 | ||
- location: scripts/start | ||
timeout: 3600 | ||
ValidateService: | ||
- location: scripts/healthz | ||
timeout: 3600 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
version: 0.2 | ||
|
||
env: | ||
variables: | ||
MIX_ENV: "prod" | ||
|
||
phases: | ||
install: | ||
commands: | ||
- chmod +x scripts/build | ||
- scripts/build install | ||
pre_build: | ||
commands: | ||
- scripts/build pre_build | ||
build: | ||
commands: | ||
- scripts/build build | ||
post_build: | ||
commands: | ||
- scripts/build post_build | ||
|
||
artifacts: | ||
files: | ||
- ellie.tar.gz | ||
- appspec.yml | ||
- templates/infra.yml | ||
- scripts/unpack | ||
- scripts/postunpack | ||
- scripts/stop | ||
- scripts/migrate | ||
- scripts/start | ||
- scripts/healthz | ||
- scripts/binstall | ||
discard-paths: no |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.