-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e8bb2d3
commit 3b8ecae
Showing
8 changed files
with
135 additions
and
30 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,22 +1,45 @@ | ||
# Ignore version control files | ||
# This file excludes paths from the Docker build context. | ||
# | ||
# By default, Docker's build context includes all files (and folders) in the | ||
# current directory. Even if a file isn't copied into the container it is still sent to | ||
# the Docker daemon. | ||
# | ||
# There are multiple reasons to exclude files from the build context: | ||
# | ||
# 1. Prevent nested folders from being copied into the container (ex: exclude | ||
# /assets/node_modules when copying /assets) | ||
# 2. Reduce the size of the build context and improve build time (ex. /build, /deps, /doc) | ||
# 3. Avoid sending files containing sensitive information | ||
# | ||
# More information on using .dockerignore is available here: | ||
# https://docs.docker.com/engine/reference/builder/#dockerignore-file | ||
|
||
.dockerignore | ||
|
||
# Ignore git, but keep git HEAD and refs to access current commit hash if needed: | ||
# | ||
# $ cat .git/HEAD | awk '{print ".git/"$2}' | xargs cat | ||
# d0b8727759e1e0e7aa3d41707d12376e373d5ecc | ||
.git | ||
.gitignore | ||
!.git/HEAD | ||
!.git/refs | ||
|
||
# Common development/test artifacts | ||
/cover/ | ||
/doc/ | ||
/test/ | ||
/tmp/ | ||
.elixir_ls | ||
|
||
# Mix artifacts | ||
/_build/ | ||
/deps/ | ||
*.ez | ||
|
||
# Ignore build artifacts | ||
_build | ||
deps | ||
# Generated on crash by the VM | ||
erl_crash.dump | ||
|
||
# Ignore editor files | ||
*.swp | ||
*.swo | ||
*.swn | ||
*.swm | ||
*.swl | ||
*.swk | ||
*.swc | ||
*.swo | ||
*.beam | ||
*.iml | ||
.idea | ||
.vscode | ||
.editorconfig | ||
# Static artifacts - These should be fetched and built inside the Docker image | ||
/assets/node_modules/ | ||
/priv/static/assets/ | ||
/priv/static/cache_manifest.json |
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,28 @@ | ||
defmodule TimecopsyncProjectsApi.Release do | ||
@moduledoc """ | ||
Used for executing DB release tasks when run in production without Mix | ||
installed. | ||
""" | ||
@app :timecopsync_projects_api | ||
|
||
def migrate do | ||
load_app() | ||
|
||
for repo <- repos() do | ||
{:ok, _, _} = Ecto.Migrator.with_repo(repo, &Ecto.Migrator.run(&1, :up, all: true)) | ||
end | ||
end | ||
|
||
def rollback(repo, version) do | ||
load_app() | ||
{:ok, _, _} = Ecto.Migrator.with_repo(repo, &Ecto.Migrator.run(&1, :down, to: version)) | ||
end | ||
|
||
defp repos do | ||
Application.fetch_env!(@app, :ecto_repos) | ||
end | ||
|
||
defp load_app do | ||
Application.load(@app) | ||
end | ||
end |
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,5 @@ | ||
#!/bin/sh | ||
set -eu | ||
|
||
cd -P -- "$(dirname -- "$0")" | ||
exec ./timecopsync_projects_api eval TimecopsyncProjectsApi.Release.migrate |
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 @@ | ||
call "%~dp0\timecopsync_projects_api" eval TimecopsyncProjectsApi.Release.migrate |
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,5 @@ | ||
#!/bin/sh | ||
set -eu | ||
|
||
cd -P -- "$(dirname -- "$0")" | ||
PHX_SERVER=true exec ./timecopsync_projects_api start |
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,2 @@ | ||
set PHX_SERVER=true | ||
call "%~dp0\timecopsync_projects_api" start |