Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
baec4ab
Beanstalk basic setup
rudresh May 12, 2020
b90649d
updated image version
rudresh May 12, 2020
95a900e
Merge branch 'develop' of https://github.com/ProjectTides/tides into …
rudresh May 13, 2020
8341bef
updated the dockerrun version
rudresh May 13, 2020
1eafb90
Updated dockerfile
rudresh May 13, 2020
8f244c7
updated dockerrun
rudresh May 13, 2020
95472b8
port changed
rudresh May 13, 2020
eaa65c5
updated ports
rudresh May 14, 2020
963227c
added networks
rudresh May 14, 2020
b939a4a
port changed
rudresh May 14, 2020
e09b36b
modified dockerfiles
rudresh May 14, 2020
78cd376
added logs
rudresh May 14, 2020
c5715ec
modified docker compose file
rudresh May 14, 2020
97d9c4c
updated network name
rudresh May 14, 2020
667dced
added ebextensions
rudresh May 15, 2020
60cbc23
updated test db
rudresh May 16, 2020
0e3dc46
updated aws docker configs
rudresh May 16, 2020
02a7d45
update the config for multi-docker
rudresh May 16, 2020
4fb4b07
moved back to version 1
rudresh May 16, 2020
ab0715e
made change to see dashboard
rudresh May 16, 2020
434bb05
added buildspec
rudresh May 17, 2020
6682235
added buildspec
rudresh May 17, 2020
892356f
updated buildspec
rudresh May 17, 2020
a86f6a3
updated buildspec
rudresh May 17, 2020
7af96a4
updated for ecr-login
rudresh May 17, 2020
e11ec01
buildspec updated
rudresh May 17, 2020
d13b4b3
test commit for codepipeline
rudresh May 17, 2020
7bd1b5b
dashboard test
rudresh May 17, 2020
24c3712
updated for ecr image
rudresh May 17, 2020
048d2e3
updated release config file
rudresh May 17, 2020
117fa57
Merge branch 'master' of https://github.com/ProjectTides/tides into f…
Satendra-SR May 20, 2020
7d551fd
Added eb env config file to gitignor
Satendra-SR May 20, 2020
b32e328
Config changes
Satendra-SR May 20, 2020
db3825e
CI failure fix
Satendra-SR May 20, 2020
493a44b
Merge branch 'develop' of https://github.com/ProjectTides/tides into …
Satendra-SR May 23, 2020
bcc4aee
Removed .DS_Store
Satendra-SR May 24, 2020
8070d51
EB build check
Satendra-SR May 25, 2020
c140735
Removed config
Satendra-SR May 25, 2020
22c7f36
route test
Satendra-SR May 25, 2020
906031a
using System.fetch_env! instead of System.get_env
rudresh May 25, 2020
db6bb11
Reverted config changes
Satendra-SR May 25, 2020
e040776
test ci changes
Satendra-SR May 25, 2020
fd49cbc
revertd
Satendra-SR May 25, 2020
2a7526c
Merge pull request #17 from ProjectTides/feature/test-ci
Satendra-SR May 25, 2020
a7302c5
demo test cases
Satendra-SR May 26, 2020
8426ce2
Reverted demo testcases
Satendra-SR May 26, 2020
a3884b9
Merge pull request #18 from ProjectTides/feature/demo-test
Satendra-SR May 26, 2020
dd23ae3
Failure condition checks
Satendra-SR May 27, 2020
ed26d81
Reverted test cases
Satendra-SR May 27, 2020
914f1c1
Merge pull request #20 from ProjectTides/feature/cicd-test-demo
Satendra-SR May 27, 2020
73c9a69
formating-updates
Satendra-SR Jun 5, 2020
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
15 changes: 15 additions & 0 deletions .ebextensions/environment.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
option_settings:
- option_name: BASE_URL
value: tides.coloredcow.com
- option_name: DATABASE_USER
value: postgres
- option_name: DATABASE_PASSWORD
value: postgres
- option_name: POSTGRES_DB
value: tidesdb
- option_name: SECRET_KEY_BASE
value: qu7CXOpykb6wMdSJ6kYepIFxWevqByviwZZgOz03luuE4exd+vGSMG3WoThg1Vl7
- option_name: DATABASE_HOST
value: tidesdb.czpgx5pis6ka.ap-south-1.rds.amazonaws.com
- option_name: DATABASE_DB
value: tidesdb
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,11 @@ project_tides-*.tar
# this depending on your deployment strategy.
/priv/static/
.env
# Elastic Beanstalk Files
.elasticbeanstalk/*
!.elasticbeanstalk/*.cfg.yml
!.elasticbeanstalk/*.global.yml
# .ebextensions/environment.config

config/dev.exs
.DS_Store
.DS_Store
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM elixir:1.9-alpine as build
FROM elixir:1.10-alpine as build
MAINTAINER [email protected]

RUN mkdir /app
Expand All @@ -24,7 +24,7 @@ RUN mix compile
RUN mix release

# prepare release image
FROM alpine:3.9 AS app
FROM alpine:3.11 AS app

# install runtime dependencies
RUN apk add --update bash openssl postgresql-client
Expand Down
13 changes: 13 additions & 0 deletions Dockerrun.aws.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"AWSEBDockerrunVersion": 1,
"Image": {
"Name": "023004991146.dkr.ecr.ap-south-1.amazonaws.com/tides:latest",
"Update": "true"
},
"Ports": [
{
"HostPort": "80",
"ContainerPort": "4000"
}
]
}
16 changes: 8 additions & 8 deletions build_scripts/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
# starts the application.

# assign a default for the database_user / role
DB_ROLE=${POSTGRES_ROLE:-postgres}
DB_HOST=${DATABASE_HOST:-db}
# DB_ROLE=${DATABASE_ROLE:-postgres}
# DB_HOST=${DATABASE_HOST:-localhost}

# wait until Postgres is ready
while ! pg_isready -q -h $DB_HOST -p 5432 -U $DB_ROLE
do
echo "$(date) - waiting for database to start"
sleep 2
done
# # wait until Postgres is ready
# while ! pg_isready -q -h $DB_HOST -p 5432 -U $DB_ROLE
# do
# echo "$(date) - waiting for database to start"
# sleep 2
# done

bin="/app/bin/project_tides"
eval "$bin eval \"ProjectTides.Release.migrate\""
Expand Down
31 changes: 31 additions & 0 deletions buildspec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# buildspec.yml
version: 0.2

phases:

pre_build:
commands:
- echo Logging in to Amazon ECR.
- aws --version
- $(aws ecr get-login --no-include-email --region ap-south-1)
- REPOSITORY_URI=023004991146.dkr.ecr.ap-south-1.amazonaws.com/tides
- COMMIT_HASH=$(echo $CODEBUILD_RESOLVED_SOURCE_VERSION | cut -c 1-7)
- IMAGE_TAG=${COMMIT_HASH:=latest}
build:
commands:
- echo Build started on `date`
- docker build -t $REPOSITORY_URI:latest .
- docker tag $REPOSITORY_URI:latest $REPOSITORY_URI:$IMAGE_TAG
post_build:
commands:
- echo Build completed on `date`
- echo Pushing the Docker images...
- docker push $REPOSITORY_URI:latest
- docker push $REPOSITORY_URI:$IMAGE_TAG
# cache:
# paths:
# - '/**/*' - update as needed
artifacts:
files:
- '**/*'
name: project-tides-$(date +%Y-%m-%d)
5 changes: 2 additions & 3 deletions config/releases.exs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ db_database = System.get_env("DATABASE_DB") || "postgres"
db_username = System.get_env("DATABASE_USER") || "postgres"
db_password = System.get_env("DATABASE_PASSWORD") || "postgres"
db_url = "ecto://#{db_username}:#{db_password}@#{db_host}/#{db_database}"

config :project_tides, ProjectTides.Repo,
url: db_url,
pool_size: String.to_integer(System.get_env("POOL_SIZE") || "10"),
Expand All @@ -21,6 +22,4 @@ secret_key_base = System.get_env("SECRET_KEY_BASE") ||
"""
config :project_tides, ProjectTidesWeb.Endpoint,
server: true,
http: [:inet6, port: 4000],
secret_key_base: secret_key_base,
url: [host: System.get_env("BASE_URL"), port: 80]
http: [:inet6, port: 4000]
4 changes: 2 additions & 2 deletions lib/project_tides_web/router.ex
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ defmodule ProjectTidesWeb.Router do
# If your application does not have an admins-only section yet,
# you can use Plug.BasicAuth to set up some basic authentication
# as long as you are also using SSL (which you should anyway).
if Mix.env() in [:dev, :test] do
# if Mix.env() in [:dev, :test] do
import Phoenix.LiveDashboard.Router

scope "/" do
pipe_through [:fetch_session, :protect_from_forgery]
live_dashboard "/dashboard", metrics: ProjectTidesWeb.Telemetry
end
# end
end
end
1 change: 1 addition & 0 deletions test/project_tides_web/views/error_view_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ defmodule ProjectTidesWeb.ErrorViewTest do
assert render(ProjectTidesWeb.ErrorView, "500.json", []) ==
%{errors: %{detail: "Internal Server Error"}}
end

end