mirror of
https://github.com/penpot/penpot.git
synced 2025-01-08 07:50:43 -05:00
✨ Improve image build scripts (with many fixes).
This commit is contained in:
parent
b8050068d7
commit
17aa744b52
4 changed files with 28 additions and 31 deletions
|
@ -1,5 +1,4 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
set -xe
|
set -xe
|
||||||
sudo pg_ctlcluster 11 main start;
|
|
||||||
clojure -Adev -m uxbox.tests.main;
|
clojure -Adev -m uxbox.tests.main;
|
||||||
|
|
|
@ -12,12 +12,12 @@ volumes:
|
||||||
user_data:
|
user_data:
|
||||||
|
|
||||||
services:
|
services:
|
||||||
devenv:
|
main:
|
||||||
privileged: true
|
privileged: true
|
||||||
build:
|
build:
|
||||||
context: ./
|
context: ./
|
||||||
hostname: 'uxbox-devenv'
|
hostname: 'uxboxdev-main'
|
||||||
container_name: 'uxbox-devenv-main'
|
container_name: 'uxboxdev-main'
|
||||||
command: "/home/uxbox/init.sh"
|
command: "/home/uxbox/init.sh"
|
||||||
stop_signal: SIGINT
|
stop_signal: SIGINT
|
||||||
depends_on:
|
depends_on:
|
||||||
|
@ -40,7 +40,7 @@ services:
|
||||||
- UXBOX_DATABASE_PASSWORD="uxbox"
|
- UXBOX_DATABASE_PASSWORD="uxbox"
|
||||||
|
|
||||||
smtp:
|
smtp:
|
||||||
container_name: 'uxbox-devenv-smtp'
|
container_name: 'uxboxdev-smtp'
|
||||||
image: mwader/postfix-relay
|
image: mwader/postfix-relay
|
||||||
restart: always
|
restart: always
|
||||||
environment:
|
environment:
|
||||||
|
@ -49,9 +49,9 @@ services:
|
||||||
|
|
||||||
postgres:
|
postgres:
|
||||||
image: postgres:12
|
image: postgres:12
|
||||||
# command: postgres -c config_file=/etc/postgresql.conf
|
command: postgres -c config_file=/etc/postgresql.conf
|
||||||
hostname: 'uxbox-devenv-postgres'
|
hostname: 'uxboxdev-postgres'
|
||||||
container_name: 'uxbox-devenv-postgres'
|
container_name: 'uxboxdev-postgres'
|
||||||
restart: always
|
restart: always
|
||||||
stop_signal: SIGINT
|
stop_signal: SIGINT
|
||||||
ports:
|
ports:
|
||||||
|
@ -62,5 +62,6 @@ services:
|
||||||
- POSTGRES_USER=uxbox
|
- POSTGRES_USER=uxbox
|
||||||
- POSTGRES_PASSWORD=uxbox
|
- POSTGRES_PASSWORD=uxbox
|
||||||
volumes:
|
volumes:
|
||||||
# - ./files/postgresql.conf:/etc/postgresql.conf
|
- ./files/postgresql.conf:/etc/postgresql.conf
|
||||||
|
- ./files/postgresql_init.sql:/docker-entrypoint-initdb.d/init.sql
|
||||||
- postgres_data:/var/lib/postgresql/data
|
- postgres_data:/var/lib/postgresql/data
|
||||||
|
|
|
@ -417,10 +417,10 @@ min_wal_size = 80MB
|
||||||
|
|
||||||
# - Where to Log -
|
# - Where to Log -
|
||||||
|
|
||||||
log_destination = 'stderr' # Valid values are combinations of
|
#log_destination = 'stderr' # Valid values are combinations of
|
||||||
# stderr, csvlog, syslog, and eventlog,
|
# stderr, csvlog, syslog, and eventlog,
|
||||||
# depending on platform. csvlog
|
# depending on platform. csvlog
|
||||||
# requires logging_collector to be on.
|
# requires logging_collector to be on.
|
||||||
|
|
||||||
# This is used when logging to stderr:
|
# This is used when logging to stderr:
|
||||||
#logging_collector = off # Enable capturing of stderr and csvlog
|
#logging_collector = off # Enable capturing of stderr and csvlog
|
||||||
|
@ -489,7 +489,7 @@ log_destination = 'stderr' # Valid values are combinations of
|
||||||
# fatal
|
# fatal
|
||||||
# panic (effectively off)
|
# panic (effectively off)
|
||||||
|
|
||||||
log_min_duration_statement = 0 # -1 is disabled, 0 logs all statements
|
#log_min_duration_statement = 0 # -1 is disabled, 0 logs all statements
|
||||||
# and their durations, > 0 logs only
|
# and their durations, > 0 logs only
|
||||||
# statements running at least this number
|
# statements running at least this number
|
||||||
# of milliseconds
|
# of milliseconds
|
||||||
|
|
31
manage.sh
31
manage.sh
|
@ -2,7 +2,7 @@
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
REV=`git log -n 1 --pretty=format:%h -- docker/`
|
REV=`git log -n 1 --pretty=format:%h -- docker/`
|
||||||
IMGNAME="uxbox_devenv"
|
IMGNAME="uxboxdev_main"
|
||||||
|
|
||||||
function remove-devenv-images {
|
function remove-devenv-images {
|
||||||
echo "Clean old development image $IMGNAME..."
|
echo "Clean old development image $IMGNAME..."
|
||||||
|
@ -13,7 +13,7 @@ function build-devenv {
|
||||||
echo "Building development image $IMGNAME:latest with UID $EXTERNAL_UID..."
|
echo "Building development image $IMGNAME:latest with UID $EXTERNAL_UID..."
|
||||||
|
|
||||||
local EXTERNAL_UID=${1:-$(id -u)}
|
local EXTERNAL_UID=${1:-$(id -u)}
|
||||||
docker-compose -p uxbox-devenv -f docker/devenv/docker-compose.yaml \
|
docker-compose -p uxboxdev -f docker/devenv/docker-compose.yaml \
|
||||||
build --build-arg EXTERNAL_UID=$EXTERNAL_UID --force-rm;
|
build --build-arg EXTERNAL_UID=$EXTERNAL_UID --force-rm;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,19 +25,19 @@ function build-devenv-if-not-exists {
|
||||||
|
|
||||||
function start-devenv {
|
function start-devenv {
|
||||||
build-devenv-if-not-exists $@;
|
build-devenv-if-not-exists $@;
|
||||||
docker-compose -p uxbox-devenv -f docker/devenv/docker-compose.yaml up -d;
|
docker-compose -p uxboxdev -f docker/devenv/docker-compose.yaml up -d;
|
||||||
}
|
}
|
||||||
|
|
||||||
function stop-devenv {
|
function stop-devenv {
|
||||||
docker-compose -p uxbox-devenv -f docker/devenv/docker-compose.yaml stop -t 2;
|
docker-compose -p uxboxdev -f docker/devenv/docker-compose.yaml stop -t 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
function run-devenv {
|
function run-devenv {
|
||||||
if [[ ! $(docker ps -f "name=uxbox-devenv-main" -q) ]]; then
|
if [[ ! $(docker ps -f "name=uxboxdev-main" -q) ]]; then
|
||||||
start-devenv
|
start-devenv
|
||||||
fi
|
fi
|
||||||
|
|
||||||
docker exec -ti uxbox-devenv-main /home/uxbox/start.sh;
|
docker exec -ti uxboxdev-main /home/uxbox/start.sh;
|
||||||
}
|
}
|
||||||
|
|
||||||
function run-all-tests {
|
function run-all-tests {
|
||||||
|
@ -96,15 +96,15 @@ function build-frontend-image {
|
||||||
echo "## START build 'uxbox-frontend' image. ##"
|
echo "## START build 'uxbox-frontend' image. ##"
|
||||||
echo "#############################################"
|
echo "#############################################"
|
||||||
build-frontend-local "dist" || exit 1;
|
build-frontend-local "dist" || exit 1;
|
||||||
# rm -rf docker/frontend/dist || exit 1;
|
rm -rf docker/frontend/dist || exit 1;
|
||||||
# cp -vr frontend/dist docker/frontend/ || exit 1;
|
cp -vr frontend/dist docker/frontend/ || exit 1;
|
||||||
|
|
||||||
# docker build --rm=true \
|
docker build --rm=true \
|
||||||
# -t uxbox-frontend:$REV \
|
-t uxbox-frontend:$REV \
|
||||||
# -t uxbox-frontend:latest \
|
-t uxbox-frontend:latest \
|
||||||
# docker/frontend/;
|
docker/frontend/;
|
||||||
|
|
||||||
# rm -rf docker/frontend/dist || exit 1;
|
rm -rf docker/frontend/dist || exit 1;
|
||||||
echo "#############################################"
|
echo "#############################################"
|
||||||
echo "## END build 'uxbox-frontend' image. ##"
|
echo "## END build 'uxbox-frontend' image. ##"
|
||||||
echo "#############################################"
|
echo "#############################################"
|
||||||
|
@ -129,7 +129,6 @@ function build-frontend-dbg-image {
|
||||||
echo "#############################################"
|
echo "#############################################"
|
||||||
echo "## END build 'uxbox-frontend-dbg' image. ##"
|
echo "## END build 'uxbox-frontend-dbg' image. ##"
|
||||||
echo "#############################################"
|
echo "#############################################"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function build-backend-local {
|
function build-backend-local {
|
||||||
|
@ -161,11 +160,9 @@ function build-backend-image {
|
||||||
docker/backend/;
|
docker/backend/;
|
||||||
|
|
||||||
rm -rf docker/backend/dist || exit 1;
|
rm -rf docker/backend/dist || exit 1;
|
||||||
|
|
||||||
echo "#############################################"
|
echo "#############################################"
|
||||||
echo "## END build 'uxbox-backend' image. ##"
|
echo "## END build 'uxbox-backend' image. ##"
|
||||||
echo "#############################################"
|
echo "#############################################"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function build-images {
|
function build-images {
|
||||||
|
@ -201,7 +198,7 @@ function log {
|
||||||
}
|
}
|
||||||
|
|
||||||
function log-devenv {
|
function log-devenv {
|
||||||
docker-compose -p uxbox-devenv -f docker/devenv/docker-compose.yaml logs -f --tail=50
|
docker-compose -p uxboxdev -f docker/devenv/docker-compose.yaml logs -f --tail=50
|
||||||
}
|
}
|
||||||
|
|
||||||
function stop {
|
function stop {
|
||||||
|
|
Loading…
Reference in a new issue