forked from cerc-io/stack-orchestrator
Add --update option to deploy create
To allow updating an existing deployment - Check the deployment dir exists when updating - Write to temp dir, then safely copy tree - Don't overwrite data dir or config.env
This commit is contained in:
@@ -1,9 +1,6 @@
|
||||
FROM ubuntu:latest
|
||||
FROM alpine:latest
|
||||
|
||||
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive && export DEBCONF_NOWARNINGS="yes" && \
|
||||
apt-get install -y software-properties-common && \
|
||||
apt-get install -y nginx && \
|
||||
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
RUN apk add --no-cache nginx
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
#!/usr/bin/env sh
|
||||
set -e
|
||||
|
||||
if [ -n "$CERC_SCRIPT_DEBUG" ]; then
|
||||
@@ -8,14 +8,14 @@ fi
|
||||
echo "Test container starting"
|
||||
|
||||
DATA_DEVICE=$(df | grep "/data$" | awk '{ print $1 }')
|
||||
if [[ -n "$DATA_DEVICE" ]]; then
|
||||
if [ -n "$DATA_DEVICE" ]; then
|
||||
echo "/data: MOUNTED dev=${DATA_DEVICE}"
|
||||
else
|
||||
echo "/data: not mounted"
|
||||
fi
|
||||
|
||||
DATA2_DEVICE=$(df | grep "/data2$" | awk '{ print $1 }')
|
||||
if [[ -n "$DATA_DEVICE" ]]; then
|
||||
if [ -n "$DATA_DEVICE" ]; then
|
||||
echo "/data2: MOUNTED dev=${DATA2_DEVICE}"
|
||||
else
|
||||
echo "/data2: not mounted"
|
||||
@@ -23,7 +23,7 @@ fi
|
||||
|
||||
# Test if the container's filesystem is old (run previously) or new
|
||||
for d in /data /data2; do
|
||||
if [[ -f "$d/exists" ]];
|
||||
if [ -f "$d/exists" ];
|
||||
then
|
||||
TIMESTAMP=`cat $d/exists`
|
||||
echo "$d filesystem is old, created: $TIMESTAMP"
|
||||
@@ -52,7 +52,7 @@ fi
|
||||
if [ -d "/config" ]; then
|
||||
echo "/config: EXISTS"
|
||||
for f in /config/*; do
|
||||
if [[ -f "$f" ]] || [[ -L "$f" ]]; then
|
||||
if [ -f "$f" ] || [ -L "$f" ]; then
|
||||
echo "$f:"
|
||||
cat "$f"
|
||||
echo ""
|
||||
@@ -64,4 +64,4 @@ else
|
||||
fi
|
||||
|
||||
# Run nginx which will block here forever
|
||||
/usr/sbin/nginx -g "daemon off;"
|
||||
nginx -g "daemon off;"
|
||||
|
||||
Reference in New Issue
Block a user