0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-21 06:02:32 -05:00

🎉 Rename to penpot all devenv docker related files.

This commit is contained in:
Andrey Antukh 2020-11-10 12:41:20 +01:00 committed by Hirunatan
parent 3cd0d9636f
commit 132e99ab71
6 changed files with 65 additions and 65 deletions

View file

@ -31,9 +31,9 @@ RUN set -ex; \
rm -rf /var/lib/apt/lists/*;
RUN set -ex; \
useradd -m -g users -s /bin/bash -u $EXTERNAL_UID uxbox; \
passwd uxbox -d; \
echo "uxbox ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
useradd -m -g users -s /bin/bash -u $EXTERNAL_UID penpot; \
passwd penpot -d; \
echo "penpot ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
RUN set -ex; \
apt-get -qq update; \
@ -124,8 +124,8 @@ COPY files/start-tmux.sh /home/start-tmux.sh
COPY files/entrypoint.sh /home/entrypoint.sh
COPY files/init.sh /home/init.sh
USER uxbox
WORKDIR /home/uxbox
USER penpot
WORKDIR /home/penpot
RUN set -ex; \
git clone https://github.com/creationix/nvm.git .nvm; \

View file

@ -14,10 +14,10 @@ volumes:
services:
main:
privileged: true
image: "uxbox-devenv"
image: "penpot-devenv"
build:
context: "."
container_name: "uxbox-devenv-main"
container_name: "penpot-devenv-main"
stop_signal: SIGINT
depends_on:
@ -26,8 +26,8 @@ services:
- redis
volumes:
- "user_data:/home/uxbox/"
- "${PWD}:/home/uxbox/uxbox"
- "user_data:/home/penpot/"
- "${PWD}:/home/penpot/penpot"
- ./files/nginx.conf:/etc/nginx/nginx.conf
ports:
@ -39,32 +39,32 @@ services:
- 9090:9090
environment:
- APP_DATABASE_URI=postgresql://postgres/uxbox
- APP_DATABASE_USERNAME=uxbox
- APP_DATABASE_PASSWORD=uxbox
- APP_DATABASE_URI=postgresql://postgres/penpot
- APP_DATABASE_USERNAME=penpot
- APP_DATABASE_PASSWORD=penpot
- APP_SENDMAIL_BACKEND=console
- APP_SMTP_HOST=smtp
- APP_SMTP_PORT=25
smtp:
container_name: "uxbox-devenv-smtp"
container_name: "penpot-devenv-smtp"
image: mwader/postfix-relay:latest
restart: always
environment:
- POSTFIX_myhostname=smtp.uxbox.io
- OPENDKIM_DOMAINS=smtp.uxbox.io
- POSTFIX_myhostname=smtp.penpot.io
- OPENDKIM_DOMAINS=smtp.penpot.io
postgres:
image: postgres:13
command: postgres -c config_file=/etc/postgresql.conf
container_name: "uxbox-devenv-postgres"
container_name: "penpot-devenv-postgres"
restart: always
stop_signal: SIGINT
environment:
- POSTGRES_INITDB_ARGS=--data-checksums
- POSTGRES_DB=uxbox
- POSTGRES_USER=uxbox
- POSTGRES_PASSWORD=uxbox
- POSTGRES_DB=penpot
- POSTGRES_USER=penpot
- POSTGRES_PASSWORD=penpot
volumes:
- ./files/postgresql.conf:/etc/postgresql.conf
- ./files/postgresql_init.sql:/docker-entrypoint-initdb.d/init.sql
@ -72,6 +72,6 @@ services:
redis:
image: redis:6
hostname: "uxbox-devenv-redis"
container_name: "uxbox-devenv-redis"
hostname: "penpot-devenv-redis"
container_name: "penpot-devenv-redis"
restart: always

View file

@ -2,11 +2,11 @@
set -e
sudo cp /root/.bashrc /home/uxbox/.bashrc
sudo cp /root/.vimrc /home/uxbox/.vimrc
sudo cp /root/.tmux.conf /home/uxbox/.tmux.conf
sudo cp /root/.bashrc /home/penpot/.bashrc
sudo cp /root/.vimrc /home/penpot/.vimrc
sudo cp /root/.tmux.conf /home/penpot/.tmux.conf
source /home/uxbox/.bashrc
sudo chown uxbox:users /home/uxbox
source /home/penpot/.bashrc
sudo chown penpot:users /home/penpot
exec "$@"

View file

@ -1 +1 @@
CREATE DATABASE uxbox_test;
CREATE DATABASE penpot_test;

View file

@ -6,36 +6,36 @@ set -e;
source ~/.bashrc
echo "[start-tmux.sh] Installing node dependencies"
pushd ~/uxbox/frontend/
pushd ~/penpot/frontend/
yarn install
popd
pushd ~/uxbox/exporter/
pushd ~/penpot/exporter/
yarn install
popd
tmux -2 new-session -d -s uxbox
tmux -2 new-session -d -s penpot
tmux new-window -t uxbox:1 -n 'shadow watch'
tmux select-window -t uxbox:1
tmux send-keys -t uxbox 'cd uxbox/frontend' enter C-l
tmux send-keys -t uxbox 'npx shadow-cljs watch main' enter
tmux new-window -t penpot:1 -n 'shadow watch'
tmux select-window -t penpot:1
tmux send-keys -t penpot 'cd penpot/frontend' enter C-l
tmux send-keys -t penpot 'npx shadow-cljs watch main' enter
tmux new-window -t uxbox:2 -n 'exporter'
tmux select-window -t uxbox:2
tmux send-keys -t uxbox 'cd uxbox/exporter' enter C-l
tmux send-keys -t uxbox 'npx shadow-cljs watch main' enter
tmux new-window -t penpot:2 -n 'exporter'
tmux select-window -t penpot:2
tmux send-keys -t penpot 'cd penpot/exporter' enter C-l
tmux send-keys -t penpot 'npx shadow-cljs watch main' enter
tmux split-window -v
tmux send-keys -t uxbox 'cd uxbox/exporter' enter C-l
tmux send-keys -t uxbox './scripts/wait-and-start.sh' enter
tmux send-keys -t penpot 'cd penpot/exporter' enter C-l
tmux send-keys -t penpot './scripts/wait-and-start.sh' enter
tmux new-window -t uxbox:3 -n 'backend'
tmux select-window -t uxbox:3
tmux send-keys -t uxbox 'cd uxbox/backend' enter C-l
tmux send-keys -t uxbox './scripts/start-dev' enter
tmux new-window -t penpot:3 -n 'backend'
tmux select-window -t penpot:3
tmux send-keys -t penpot 'cd penpot/backend' enter C-l
tmux send-keys -t penpot './scripts/start-dev' enter
tmux rename-window -t uxbox:0 'gulp'
tmux select-window -t uxbox:0
tmux send-keys -t uxbox 'cd uxbox/frontend' enter C-l
tmux send-keys -t uxbox 'npx gulp --theme=${UXBOX_THEME} watch' enter
tmux rename-window -t penpot:0 'gulp'
tmux select-window -t penpot:0
tmux send-keys -t penpot 'cd penpot/frontend' enter C-l
tmux send-keys -t penpot 'npx gulp --theme=${PENPOT_THEME} watch' enter
tmux -2 attach-session -t uxbox
tmux -2 attach-session -t penpot

View file

@ -2,12 +2,12 @@
set -e
REV=`git log -n 1 --pretty=format:%h -- docker/`
DEVENV_IMGNAME="uxbox-devenv"
DEVENV_IMGNAME="penpot-devenv"
function build-devenv {
echo "Building development image $DEVENV_IMGNAME:latest with UID $EXTERNAL_UID..."
local EXTERNAL_UID=${1:-$(id -u)}
docker-compose -p uxboxdev -f docker/devenv/docker-compose.yaml build \
docker-compose -p penpotdev -f docker/devenv/docker-compose.yaml build \
--force-rm --build-arg EXTERNAL_UID=$EXTERNAL_UID
}
@ -19,39 +19,39 @@ function build-devenv-if-not-exists {
function start-devenv {
build-devenv-if-not-exists $@;
docker-compose -p uxboxdev -f docker/devenv/docker-compose.yaml up -d;
docker-compose -p penpotdev -f docker/devenv/docker-compose.yaml up -d;
}
function stop-devenv {
docker-compose -p uxboxdev -f docker/devenv/docker-compose.yaml stop -t 2;
docker-compose -p penpotdev -f docker/devenv/docker-compose.yaml stop -t 2;
}
function drop-devenv {
docker-compose -p uxboxdev -f docker/devenv/docker-compose.yaml down -t 2 -v;
docker-compose -p penpotdev -f docker/devenv/docker-compose.yaml down -t 2 -v;
echo "Clean old development image $DEVENV_IMGNAME..."
docker images $DEVENV_IMGNAME -q | awk '{print $3}' | xargs --no-run-if-empty docker rmi
}
function run-devenv {
if [[ ! $(docker ps -f "name=uxbox-devenv-main" -q) ]]; then
if [[ ! $(docker ps -f "name=penpot-devenv-main" -q) ]]; then
start-devenv
fi
docker exec -ti uxbox-devenv-main /home/start-tmux.sh
docker exec -ti penpot-devenv-main /home/start-tmux.sh
}
function build {
build-devenv-if-not-exists;
local IMAGE=$DEVENV_IMGNAME:latest;
docker volume create uxboxdev_user_data;
docker volume create penpotdev_user_data;
echo "Running development image $IMAGE to build frontend."
docker run -t --rm \
--mount source=uxboxdev_user_data,type=volume,target=/home/uxbox/ \
--mount source=`pwd`,type=bind,target=/home/uxbox/uxbox \
-w /home/uxbox/uxbox/$1 \
--mount source=penpotdev_user_data,type=volume,target=/home/penpot/ \
--mount source=`pwd`,type=bind,target=/home/penpot/penpot \
-w /home/penpot/penpot/$1 \
$IMAGE ./scripts/build.sh
}
@ -79,7 +79,7 @@ function build-bundle {
mv ./backend/target/dist ./bundle/backend
mv ./exporter/target ./bundle/exporter
NAME="uxbox-$(date '+%Y.%m.%d-%H%M')"
NAME="penpot-$(date '+%Y.%m.%d-%H%M')"
pushd bundle/
tar -cvf ../$NAME.tar *;
@ -89,7 +89,7 @@ function build-bundle {
}
function log-devenv {
docker-compose -p uxboxdev -f docker/devenv/docker-compose.yaml logs -f --tail=50
docker-compose -p penpotdev -f docker/devenv/docker-compose.yaml logs -f --tail=50
}
function build-testenv {
@ -110,18 +110,18 @@ function build-testenv {
popd
pushd ./docker/testenv;
docker-compose -p uxbox-testenv -f ./docker-compose.yaml build
docker-compose -p penpot-testenv -f ./docker-compose.yaml build
popd
}
function start-testenv {
pushd ./docker/testenv;
docker-compose -p uxbox-testenv -f ./docker-compose.yaml up
docker-compose -p penpot-testenv -f ./docker-compose.yaml up
popd
}
function usage {
echo "UXBOX build & release manager v$REV"
echo "PENPOT build & release manager v$REV"
echo "USAGE: $0 OPTION"
echo "Options:"
# echo "- clean Stop and clean up docker containers"