Skip to content

Commit

Permalink
Merge pull request #61 from docksal/develop
Browse files Browse the repository at this point in the history
Release 1.9.0
  • Loading branch information
lmakarov authored Apr 7, 2020
2 parents fcfbb27 + 01869e5 commit e579f33
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 7 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -431,3 +431,7 @@ REMOTE_BUILD_DIR_CLEANUP=0
Such environments can be used for non-critical production-ish workloads, whenever an on-demand delayed start
(5-10s delay) is not a concern.
## Feature: Secrets in environment variables
It is best security practice not to store secrets such as API keys in a code repository. Many CI systems already have the ability to set such environment variables during the build process. Any environment variables set at build time whose name starts with `SECRET_` will be forwarded as-is to the built environment.
6 changes: 5 additions & 1 deletion base/bin/build-env
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@
# Configures build environment variables
# This file should be sources at the beginning of a build
#
# Usage source build-env
# Usage: source build-env

# IMPORTANT: This script is sourced in the build environment.
# Any settings set here using set/trap/etc. will propagate to all build steps.

# Ensure this script is sourced
# Credit: https://stackoverflow.com/a/28776166
(return 0 2>/dev/null) || (echo "This script must be sourced! (source build-env)"; exit 1)

# -------------------- Constants -------------------- #

DEBUG=${DEBUG:-0} # `DEBUG=1 build-env` to run with debugging turned ON
Expand Down
10 changes: 4 additions & 6 deletions base/bin/build-init
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,11 @@ fi
# inject each variable/value pair into docksal-$BUILD_ENVIRONMENT.env. This allows you to
# add secure variables to your project's repository that can be injected into
# each sandbox environment.
secrets="$(compgen -A variable | grep '^SECRET_')" || true
if [[ "${secrets}" != "" ]]; then
if secrets=$(compgen -v | grep '^SECRET_'); then
echo "Passing build secrets to sandbox..."
for secret in "$secrets"
do
build-exec "fin config set $secret='${!secret}' --env=${BUILD_ENVIRONMENT}"
done
while read secret; do
build-exec "fin config set ${secret}='${!secret}' --env=${BUILD_ENVIRONMENT}"
done <<< "${secrets}"
fi

set +e
2 changes: 2 additions & 0 deletions php/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ USER root

RUN set -xe; \
apk add --update --no-cache \
mysql-client \
php7 \
php7-ctype \
php7-curl \
Expand All @@ -13,6 +14,7 @@ RUN set -xe; \
php7-json \
php7-mbstring \
php7-openssl \
php7-pdo_mysql \
php7-phar \
php7-posix \
php7-simplexml \
Expand Down
3 changes: 3 additions & 0 deletions tests/php-modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ hash
json
libxml
mbstring
mysqlnd
openssl
pcre
PDO
pdo_mysql
Phar
posix
readline
Expand Down

0 comments on commit e579f33

Please sign in to comment.