mkbrut 0.2.7 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/mkbrut/version.rb +1 -1
- data/templates/Base/docker-compose.dx.yml +1 -1
- data/templates/Base/dx/exec +17 -5
- data/templates/segments/Heroku/deploy/docker-entrypoint +15 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c82504e23c5bf5270d84b01b7717c8842cfbdec2a09c61976fdf3d2ec7d2d040
|
4
|
+
data.tar.gz: 4ac6e8c52d140a5e2b83378e9de8b79c0089a7612de3c3286c80d0dcaeb93357
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ff91f6a6f3297e9ae8eea8e82cdd2a689165bb57b41a81fc2246d8b1235131d506c56368b9cce9fb7a16da121cee83bc76dd0f7342756e88de2088b6b701cf9
|
7
|
+
data.tar.gz: 5b59bf2ed9c33a33f0e961e34b00195818dba5666bd7b92a00f008ee4b1556d79472921d4adc192e2ed08a3790d3f5e2c58585760d7c172bbe9ba6497cc7ed34
|
data/lib/mkbrut/version.rb
CHANGED
@@ -39,7 +39,7 @@ services:
|
|
39
39
|
target: "/var/run/docker.sock"
|
40
40
|
# This is what is started up when you run `dx/start`. It just
|
41
41
|
# waits forever keeping the container running.
|
42
|
-
|
42
|
+
command: /home/appuser/show-help-in-app-container-then-wait.sh
|
43
43
|
# The working directory for any command, this is the same as your
|
44
44
|
# project root.
|
45
45
|
working_dir: ${PWD}
|
data/templates/Base/dx/exec
CHANGED
@@ -9,17 +9,21 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${0}" )" > /dev/null 2>&1 && pwd )
|
|
9
9
|
require_command "docker"
|
10
10
|
load_docker_compose_env
|
11
11
|
|
12
|
-
usage_description="Execute a command inside the app's container."
|
13
|
-
usage_args="[-s service] command"
|
12
|
+
usage_description="Execute a command inside the app's container. Any command other than 'bash' will be run with bash -lc. Use -B to just run the command directly."
|
13
|
+
usage_args="[-s service] [-B] command"
|
14
14
|
usage_pre="exec.pre"
|
15
15
|
usage_on_help "${usage_description}" "${usage_args}" "${usage_pre}" "" "${@}"
|
16
16
|
|
17
17
|
SERVICE="${SERVICE_NAME:-${DEFAULT_SERVICE}}"
|
18
|
-
|
18
|
+
INCLUDE_PREFIX_FOR_NON_BASH=true
|
19
|
+
while getopts "s:B" opt "${@}"; do
|
19
20
|
case ${opt} in
|
20
21
|
s )
|
21
22
|
SERVICE="${OPTARG}"
|
22
23
|
;;
|
24
|
+
B )
|
25
|
+
INCLUDE_PREFIX_FOR_NON_BASH=false
|
26
|
+
;;
|
23
27
|
\? )
|
24
28
|
log "🛑" "Unknown option: ${opt}"
|
25
29
|
usage "${description}" "${usage_args}" "${usage_pre}"
|
@@ -42,7 +46,15 @@ if ! exec_hook_if_exists "exec.pre"; then
|
|
42
46
|
exit 1
|
43
47
|
fi
|
44
48
|
|
45
|
-
|
49
|
+
if [ "$#" -eq 1 ] && [ "$1" = "bash" ]; then
|
50
|
+
COMMAND=(bash)
|
51
|
+
elif [ "$INCLUDE_PREFIX_FOR_NON_BASH" = "true" ]; then
|
52
|
+
COMMAND=(bash -lc "$*")
|
53
|
+
else
|
54
|
+
COMMAND=("$@")
|
55
|
+
fi
|
56
|
+
|
57
|
+
log "🚂" "Running '${COMMAND[@]}' inside container with service name '${SERVICE}'"
|
46
58
|
|
47
59
|
docker \
|
48
60
|
compose \
|
@@ -51,6 +63,6 @@ docker \
|
|
51
63
|
--env-file "${ENV_FILE}" \
|
52
64
|
exec \
|
53
65
|
"${SERVICE}" \
|
54
|
-
"${@}"
|
66
|
+
"${COMMAND[@]}"
|
55
67
|
|
56
68
|
# vim: ft=bash
|
@@ -0,0 +1,15 @@
|
|
1
|
+
#!/bin/bash -e
|
2
|
+
|
3
|
+
# This is the Docker entrypoint, mean this script is used to execute
|
4
|
+
# the command given to the RUN directive.
|
5
|
+
#
|
6
|
+
# The reason this exists is to load jemalloc. If you don't want to use
|
7
|
+
# jemalloc, you can delete this script, as well as the ENTRYPOINT directive
|
8
|
+
# in deploy/Dockerfile.
|
9
|
+
|
10
|
+
# Enable jemalloc for reduced memory usage and latency.
|
11
|
+
if [ -z "${LD_PRELOAD+x}" ] && [ -f /usr/lib/*/libjemalloc.so.2 ]; then
|
12
|
+
export LD_PRELOAD="$(echo /usr/lib/*/libjemalloc.so.2)"
|
13
|
+
fi
|
14
|
+
|
15
|
+
exec "${@}"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mkbrut
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dave Copeland
|
@@ -181,6 +181,7 @@ files:
|
|
181
181
|
- templates/segments/Demo/specs/front_end/pages/new_guestbook_message_page.spec.rb
|
182
182
|
- templates/segments/Heroku/bin/deploy
|
183
183
|
- templates/segments/Heroku/deploy/Dockerfile
|
184
|
+
- templates/segments/Heroku/deploy/docker-entrypoint
|
184
185
|
- templates/segments/Heroku/deploy/heroku_config.rb
|
185
186
|
homepage: https://brutrb.com
|
186
187
|
licenses: []
|