forked from gothinkster/realworld-starter-kit
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Separate develop from test dependencies - Use entrypoints to run CI/CD tests - Fix #88 - Optimize CI/CD pipeline by restoring cache in build deps
- Loading branch information
1 parent
52b4a2e
commit 49f1701
Showing
7 changed files
with
123 additions
and
41 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
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,18 @@ | ||
Docker Entrypoints | ||
================== | ||
|
||
Entrypoints are used and a wrapper around the commands we want to run. | ||
Here we use entrypoint to invoke a shell with the appropriate environment | ||
and dependencies available to run the given commands. | ||
|
||
e.g. | ||
|
||
```bash | ||
/app/docker-entrypoints/run.sh some command | ||
``` | ||
|
||
We set the entrypoint in a docker image using the `ENTRYPOINT` instruction. | ||
|
||
We currently have three entrypoints: `run.sh`, `test.sh` and `develop.sh`. | ||
|
||
For more info, read the comments in the respective files. |
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,11 @@ | ||
#!/usr/bin/env nix-shell | ||
#!nix-shell --argstr type develop -i bash /app/shell.nix | ||
|
||
# This is the default environment for nix-shell and is used for | ||
# developing/debugging the app. It contains all the dependencies from `test` | ||
# and some extra dependencies such as `tmux`, `vim` etc. | ||
|
||
# This entrypoint can also be used in Heroku shell or CircleCI for debugging. | ||
# e.g. /app/docker-entrypoints/develop.sh vim | ||
|
||
poetry run "$@" |
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,11 @@ | ||
#!/usr/bin/env nix-shell | ||
#!nix-shell --argstr type run -i bash /app/shell.nix | ||
|
||
# This entrypoint is generally used by Heroku to run the already built app. | ||
# The given commands are run in an environment that has the least set of | ||
# dependencies available - only binaries and libraries required to run the | ||
# service. e.g. poetry, psql etc. | ||
# | ||
# This entrypoint also creates the SSH keys from the run-time variables in Heroku. | ||
|
||
poetry run "$@" |
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,9 @@ | ||
#!/usr/bin/env nix-shell | ||
#!nix-shell --argstr type test -i bash /app/shell.nix | ||
|
||
# This entrypoint is generally used by the CI/CD pipeline. | ||
# This runs the given commands in an environment that has all the dependencies | ||
# from `run` and some additional dependencies to run the tests. | ||
# e.g. geckodriver for browser tests. | ||
|
||
poetry run "$@" |
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