-
Notifications
You must be signed in to change notification settings - Fork 3
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 #5 from m8051/issues/3
Dockerize project to make development easier
- Loading branch information
Showing
7 changed files
with
104 additions
and
18 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,11 @@ | ||
version: '3.7' | ||
|
||
services: | ||
app: | ||
image: ruby:3.0.2 | ||
volumes: | ||
- .:/app | ||
working_dir: /app | ||
command: bash | ||
environment: | ||
BUNDLE_PATH: /app/.gems |
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 |
---|---|---|
|
@@ -4,5 +4,6 @@ | |
|
||
module Heartcheck | ||
module Cas | ||
# Check for a cas service | ||
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
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 @@ | ||
#!/bin/bash -e | ||
|
||
command_name=$1 | ||
command_args=${@:2} | ||
|
||
# we are relying on docker, adding a descriptive name here | ||
# will help when identifiying containers with docker ps | ||
image_name="heartcheck-cas" | ||
|
||
# helper to bring container alive | ||
run() { | ||
args=${@:1} | ||
docker-compose run --rm -v $PWD:/heartcheck-cas app $args | ||
} | ||
|
||
case $command_name in | ||
setup) | ||
docker-compose build | ||
run bundle install | ||
;; | ||
stop) | ||
docker-compose down -v --rmi all | ||
;; | ||
bash) | ||
run bash | ||
;; | ||
bundle) | ||
run bundle install | ||
;; | ||
console) | ||
run bin/console | ||
;; | ||
rspec) | ||
run bundle exec rspec | ||
;; | ||
usage) | ||
echo -e "Usage:\n" | ||
echo -e "heartcheck-cas bash - access docker sh console" | ||
echo -e "heartcheck-cas bundle - runs bundle install" | ||
echo -e "heartcheck-cas rspec - runs rspec" | ||
echo -e "heartcheck-cas setup - setups docker image" | ||
echo -e "heartcheck-cas stop - stops and removes containers, networks and volumes." | ||
;; | ||
*) | ||
echo -e "\n# Bootstrap Script to dockerize the hearthcheck-cas environment\n" | ||
$0 usage | ||
;; | ||
esac | ||
|