-
Notifications
You must be signed in to change notification settings - Fork 35
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 #72 from cfortier2/feature/migration-script
Update to handle no `CFG_` variables
- Loading branch information
Showing
2 changed files
with
19 additions
and
9 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,6 +1,9 @@ | ||
FROM behance/docker-nginx:1.2.4 | ||
MAINTAINER Bryan Latten <[email protected]> | ||
|
||
# Set TERM to suppress warning messages. | ||
ENV TERM=xterm-256color | ||
|
||
# Install pre-reqs for the next steps | ||
RUN apt-get update && apt-get -yq install \ | ||
build-essential \ | ||
|
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,12 +1,19 @@ | ||
#!/bin/bash | ||
|
||
# Adds docker environment variables where entering them as PHP-FPM environment variables | ||
VARS=`env | grep ^CFG_`; | ||
DEST_CONF=/etc/php5/fpm/pool.d/www.conf | ||
# Check if there are environment variables prefixed with `CFG_`. | ||
if [[ $(env | grep ^CFG_ | wc -l) -ne 0 ]] | ||
then | ||
# Adds docker environment variables where entering them as PHP-FPM environment variables | ||
VARS=`env | grep ^CFG_` | ||
DEST_CONF=/etc/php5/fpm/pool.d/www.conf | ||
|
||
echo '[env] importing environment variables (prefixed by CFG_)' | ||
for p in $VARS | ||
do | ||
ENV='env['${p/=/] = \"}\" | ||
echo $ENV >> $DEST_CONF | ||
done | ||
echo '[env] importing environment variables (prefixed by CFG_)' | ||
for p in $VARS | ||
do | ||
ENV='env['${p/=/] = \"}\" | ||
echo $ENV >> $DEST_CONF | ||
done | ||
|
||
else | ||
echo "[env] There were no environment variables found prefixed by CFG_" | ||
fi |