0
Fork 0
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:
Andrey Antukh 2019-12-13 12:51:56 +01:00
parent b8050068d7
commit 17aa744b52
4 changed files with 28 additions and 31 deletions

View file

@ -1,5 +1,4 @@
#!/usr/bin/env bash
set -xe
sudo pg_ctlcluster 11 main start;
clojure -Adev -m uxbox.tests.main;

View file

@ -12,12 +12,12 @@ volumes:
user_data:
services:
devenv:
main:
privileged: true
build:
context: ./
hostname: 'uxbox-devenv'
container_name: 'uxbox-devenv-main'
hostname: 'uxboxdev-main'
container_name: 'uxboxdev-main'
command: "/home/uxbox/init.sh"
stop_signal: SIGINT
depends_on:
@ -40,7 +40,7 @@ services:
- UXBOX_DATABASE_PASSWORD="uxbox"
smtp:
container_name: 'uxbox-devenv-smtp'
container_name: 'uxboxdev-smtp'
image: mwader/postfix-relay
restart: always
environment:
@ -49,9 +49,9 @@ services:
postgres:
image: postgres:12
# command: postgres -c config_file=/etc/postgresql.conf
hostname: 'uxbox-devenv-postgres'
container_name: 'uxbox-devenv-postgres'
command: postgres -c config_file=/etc/postgresql.conf
hostname: 'uxboxdev-postgres'
container_name: 'uxboxdev-postgres'
restart: always
stop_signal: SIGINT
ports:
@ -62,5 +62,6 @@ services:
- POSTGRES_USER=uxbox
- POSTGRES_PASSWORD=uxbox
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

View file

@ -417,10 +417,10 @@ min_wal_size = 80MB
# - Where to Log -
log_destination = 'stderr' # Valid values are combinations of
# stderr, csvlog, syslog, and eventlog,
# depending on platform. csvlog
# requires logging_collector to be on.
#log_destination = 'stderr' # Valid values are combinations of
# stderr, csvlog, syslog, and eventlog,
# depending on platform. csvlog
# requires logging_collector to be on.
# This is used when logging to stderr:
#logging_collector = off # Enable capturing of stderr and csvlog
@ -489,7 +489,7 @@ log_destination = 'stderr' # Valid values are combinations of
# fatal
# 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
# statements running at least this number
# of milliseconds

View file

@ -2,7 +2,7 @@
set -e
REV=`git log -n 1 --pretty=format:%h -- docker/`
IMGNAME="uxbox_devenv"
IMGNAME="uxboxdev_main"
function remove-devenv-images {
echo "Clean old development image $IMGNAME..."
@ -13,7 +13,7 @@ function build-devenv {
echo "Building development image $IMGNAME:latest with UID $EXTERNAL_UID..."
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;
}
@ -25,19 +25,19 @@ function build-devenv-if-not-exists {
function start-devenv {
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 {
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 {
if [[ ! $(docker ps -f "name=uxbox-devenv-main" -q) ]]; then
if [[ ! $(docker ps -f "name=uxboxdev-main" -q) ]]; then
start-devenv
fi
docker exec -ti uxbox-devenv-main /home/uxbox/start.sh;
docker exec -ti uxboxdev-main /home/uxbox/start.sh;
}
function run-all-tests {
@ -96,15 +96,15 @@ function build-frontend-image {
echo "## START build 'uxbox-frontend' image. ##"
echo "#############################################"
build-frontend-local "dist" || exit 1;
# rm -rf docker/frontend/dist || exit 1;
# cp -vr frontend/dist docker/frontend/ || exit 1;
rm -rf docker/frontend/dist || exit 1;
cp -vr frontend/dist docker/frontend/ || exit 1;
# docker build --rm=true \
# -t uxbox-frontend:$REV \
# -t uxbox-frontend:latest \
# docker/frontend/;
docker build --rm=true \
-t uxbox-frontend:$REV \
-t uxbox-frontend:latest \
docker/frontend/;
# rm -rf docker/frontend/dist || exit 1;
rm -rf docker/frontend/dist || exit 1;
echo "#############################################"
echo "## END build 'uxbox-frontend' image. ##"
echo "#############################################"
@ -129,7 +129,6 @@ function build-frontend-dbg-image {
echo "#############################################"
echo "## END build 'uxbox-frontend-dbg' image. ##"
echo "#############################################"
}
function build-backend-local {
@ -161,11 +160,9 @@ function build-backend-image {
docker/backend/;
rm -rf docker/backend/dist || exit 1;
echo "#############################################"
echo "## END build 'uxbox-backend' image. ##"
echo "#############################################"
}
function build-images {
@ -201,7 +198,7 @@ function log {
}
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 {