Skip to content

Commit

Permalink
Fixes: persistent storage
Browse files Browse the repository at this point in the history
Fixes: SC2094 Make sure not to read and write the same file in the same pipeline
  • Loading branch information
b23prodtm committed Feb 21, 2021
1 parent 4345ab8 commit 251371f
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 23 deletions.
5 changes: 2 additions & 3 deletions Dockerfile.armhf
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,12 @@ RUN chmod -R gu+xs deploy.sh configure.sh migrate-database.sh Scripts/
# Password Hash Verbose
# RUN cat app/webroot/php-cms/e13/etc/export_hash_password.sh | awk -F= '{print $2}' | tail -n 1

# just containers configuration
COPY etc /etc
RUN chmod 0755 *.sh
RUN ./deploy.sh ${DKR_ARCH} --nobuild --exit \
&& ./configure.sh --openshift -a -m -c -h -p pass -s word --development

# just containers configuration
COPY etc /etc

# RUN [ "cross-build-end" ]

ENTRYPOINT ./migrate-database.sh -o -u -i ${MIGRATE_OPTION} \
Expand Down
5 changes: 2 additions & 3 deletions Dockerfile.template
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,12 @@ RUN chmod -R gu+xs deploy.sh configure.sh migrate-database.sh Scripts/
# Password Hash Verbose
# RUN cat app/webroot/php-cms/e13/etc/export_hash_password.sh | awk -F= '{print $2}' | tail -n 1

# just containers configuration
COPY etc /etc
RUN chmod 0755 *.sh
RUN ./deploy.sh ${DKR_ARCH} --nobuild --exit \
&& ./configure.sh --openshift -a -m -c -h -p pass -s word --development

# just containers configuration
COPY etc /etc

# RUN [ "cross-build-end" ]

ENTRYPOINT ./migrate-database.sh -o -u -i ${MIGRATE_OPTION} \
Expand Down
5 changes: 2 additions & 3 deletions Dockerfile.x86_64
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,12 @@ RUN chmod -R gu+xs deploy.sh configure.sh migrate-database.sh Scripts/
# Password Hash Verbose
# RUN cat app/webroot/php-cms/e13/etc/export_hash_password.sh | awk -F= '{print $2}' | tail -n 1

# just containers configuration
COPY etc /etc
RUN chmod 0755 *.sh
RUN ./deploy.sh ${DKR_ARCH} --nobuild --exit \
&& ./configure.sh --openshift -a -m -c -h -p pass -s word --development

# just containers configuration
COPY etc /etc

# RUN [ "cross-build-end" ]

ENTRYPOINT ./migrate-database.sh -o -u -i ${MIGRATE_OPTION} \
Expand Down
4 changes: 3 additions & 1 deletion Scripts/config_a2ensite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ else
fi
log_daemon_msg "Add /etc/hosts $SERVER_NAME"
if [ -w "/etc/hosts" ]; then
sed -E -e "/127.0.0.1/s/(localhost)/\\1 ${SERVER_NAME} www.${SERVER_NAME}/" /etc/hosts > /etc/hosts
tmpfile=$(mktemp)
sed -E -e "/127.0.0.1/s/(localhost)/\\1 ${SERVER_NAME} www.${SERVER_NAME}/" /etc/hosts > "$tmpfile"
cat "$tmpfile" > /etc/hosts
else
log_warning_msg "/etc/hosts file not found"
fi
11 changes: 7 additions & 4 deletions Scripts/lib/shell_prompt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,17 @@ show_password_status() {
#; export -f show_password_status
patches() {
for f in "$@"; do
sed -i.old -E -f "$(dirname "${BASH_SOURCE[0]}")/../$f.sed" "$TOPDIR/$f"
file="$(basename "${f}")"
dir="$(dirname "${f}")"
[ ! -f "$dir/$file" ] && file="${file,,}"
[ ! -f "$dir/$file" ] && dir="${dir,,}"
sed -i.old -E -f "$(dirname "${BASH_SOURCE[0]}")/../${f}.sed" "$dir/$file"
done
}
#; export -f patches
cakephp() {
CAKE="lib/Cake"
APP="app"
php -q "$TOPDIR/${APP}/Console/cake.php" -working "$TOPDIR/$APP" "$@"
APP="$TOPDIR/app/Console/cake.php"
php -q "${CAKE,,}" -working "$TOPDIR/app" "$@"
}
#; export -f cakephp
docker_name() {
Expand Down
2 changes: 1 addition & 1 deletion configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ usage=("" \
" -d, --mig-database [options]" \
" Migrate Database (see $0 --mig-database --help)" \
" --development Install composer dependencies" \
" -a, --apache2 Make apache2 VirtualHost configuration from templates: etc/apache2/site.tpl..." \
" -a, --apache2 Make apache2 VirtualHost configuration from templates: etc/apache2/site.tpl..." \
"")
composer_args="require --no-interaction --update-no-dev"
saved=("$@")
Expand Down
6 changes: 3 additions & 3 deletions docker-compose.armhf
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ services:
volumes:
- db-data:/config
- db-socket:/var/run/mysqld
- data:/var/www
- db-config:/var/www/htdocs/localhost/app/Config
ports:
- "3306:3306"
restart: unless-stopped
Expand All @@ -44,7 +44,7 @@ services:
labels:
io.balena.features.dbus: "1"
volumes:
- data:/var/www
- db-config:/var/www/htdocs/localhost/app/Config
- db-socket:/var/run/mysqld
ports:
- "80:80"
Expand All @@ -63,7 +63,7 @@ services:
#start_period: 40s
volumes:
hostapcache:
data:
db-config:
external: false
db-data:
external: false
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.x86_64
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ services:
volumes:
- db-data:/config
- db-socket:/var/run/mysqld
- data:/var/www
- db-config:/var/www/htdocs/localhost/app/Config
ports:
- "3306:3306"
restart: unless-stopped
Expand All @@ -44,7 +44,7 @@ services:
labels:
io.balena.features.dbus: "1"
volumes:
- data:/var/www
- db-config:/var/www/htdocs/localhost/app/Config
- db-socket:/var/run/mysqld
ports:
- "80:80"
Expand Down
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ services:
volumes:
- db-data:/config
- db-socket:/var/run/mysqld
- data:/var/www
- db-config:/var/www/htdocs/localhost/app/Config
ports:
- "3306:3306"
restart: unless-stopped
Expand All @@ -44,7 +44,7 @@ services:
labels:
io.balena.features.dbus: "1"
volumes:
- data:/var/www
- db-config:/var/www/htdocs/localhost/app/Config
- db-socket:/var/run/mysqld
ports:
- "80:80"
Expand All @@ -63,7 +63,7 @@ services:
#start_period: 40s
volumes:
hostapcache:
data:
db-config:
external: false
db-data:
external: false
Expand Down

0 comments on commit 251371f

Please sign in to comment.