mirror of
https://github.com/penpot/penpot.git
synced 2025-02-01 11:59:17 -05:00
🎉 Rename to penpot all devenv docker related files.
This commit is contained in:
parent
3cd0d9636f
commit
132e99ab71
6 changed files with 65 additions and 65 deletions
|
@ -31,9 +31,9 @@ RUN set -ex; \
|
||||||
rm -rf /var/lib/apt/lists/*;
|
rm -rf /var/lib/apt/lists/*;
|
||||||
|
|
||||||
RUN set -ex; \
|
RUN set -ex; \
|
||||||
useradd -m -g users -s /bin/bash -u $EXTERNAL_UID uxbox; \
|
useradd -m -g users -s /bin/bash -u $EXTERNAL_UID penpot; \
|
||||||
passwd uxbox -d; \
|
passwd penpot -d; \
|
||||||
echo "uxbox ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
|
echo "penpot ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
|
||||||
|
|
||||||
RUN set -ex; \
|
RUN set -ex; \
|
||||||
apt-get -qq update; \
|
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/entrypoint.sh /home/entrypoint.sh
|
||||||
COPY files/init.sh /home/init.sh
|
COPY files/init.sh /home/init.sh
|
||||||
|
|
||||||
USER uxbox
|
USER penpot
|
||||||
WORKDIR /home/uxbox
|
WORKDIR /home/penpot
|
||||||
|
|
||||||
RUN set -ex; \
|
RUN set -ex; \
|
||||||
git clone https://github.com/creationix/nvm.git .nvm; \
|
git clone https://github.com/creationix/nvm.git .nvm; \
|
||||||
|
|
|
@ -14,10 +14,10 @@ volumes:
|
||||||
services:
|
services:
|
||||||
main:
|
main:
|
||||||
privileged: true
|
privileged: true
|
||||||
image: "uxbox-devenv"
|
image: "penpot-devenv"
|
||||||
build:
|
build:
|
||||||
context: "."
|
context: "."
|
||||||
container_name: "uxbox-devenv-main"
|
container_name: "penpot-devenv-main"
|
||||||
stop_signal: SIGINT
|
stop_signal: SIGINT
|
||||||
|
|
||||||
depends_on:
|
depends_on:
|
||||||
|
@ -26,8 +26,8 @@ services:
|
||||||
- redis
|
- redis
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
- "user_data:/home/uxbox/"
|
- "user_data:/home/penpot/"
|
||||||
- "${PWD}:/home/uxbox/uxbox"
|
- "${PWD}:/home/penpot/penpot"
|
||||||
- ./files/nginx.conf:/etc/nginx/nginx.conf
|
- ./files/nginx.conf:/etc/nginx/nginx.conf
|
||||||
|
|
||||||
ports:
|
ports:
|
||||||
|
@ -39,32 +39,32 @@ services:
|
||||||
- 9090:9090
|
- 9090:9090
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
- APP_DATABASE_URI=postgresql://postgres/uxbox
|
- APP_DATABASE_URI=postgresql://postgres/penpot
|
||||||
- APP_DATABASE_USERNAME=uxbox
|
- APP_DATABASE_USERNAME=penpot
|
||||||
- APP_DATABASE_PASSWORD=uxbox
|
- APP_DATABASE_PASSWORD=penpot
|
||||||
- APP_SENDMAIL_BACKEND=console
|
- APP_SENDMAIL_BACKEND=console
|
||||||
- APP_SMTP_HOST=smtp
|
- APP_SMTP_HOST=smtp
|
||||||
- APP_SMTP_PORT=25
|
- APP_SMTP_PORT=25
|
||||||
|
|
||||||
smtp:
|
smtp:
|
||||||
container_name: "uxbox-devenv-smtp"
|
container_name: "penpot-devenv-smtp"
|
||||||
image: mwader/postfix-relay:latest
|
image: mwader/postfix-relay:latest
|
||||||
restart: always
|
restart: always
|
||||||
environment:
|
environment:
|
||||||
- POSTFIX_myhostname=smtp.uxbox.io
|
- POSTFIX_myhostname=smtp.penpot.io
|
||||||
- OPENDKIM_DOMAINS=smtp.uxbox.io
|
- OPENDKIM_DOMAINS=smtp.penpot.io
|
||||||
|
|
||||||
postgres:
|
postgres:
|
||||||
image: postgres:13
|
image: postgres:13
|
||||||
command: postgres -c config_file=/etc/postgresql.conf
|
command: postgres -c config_file=/etc/postgresql.conf
|
||||||
container_name: "uxbox-devenv-postgres"
|
container_name: "penpot-devenv-postgres"
|
||||||
restart: always
|
restart: always
|
||||||
stop_signal: SIGINT
|
stop_signal: SIGINT
|
||||||
environment:
|
environment:
|
||||||
- POSTGRES_INITDB_ARGS=--data-checksums
|
- POSTGRES_INITDB_ARGS=--data-checksums
|
||||||
- POSTGRES_DB=uxbox
|
- POSTGRES_DB=penpot
|
||||||
- POSTGRES_USER=uxbox
|
- POSTGRES_USER=penpot
|
||||||
- POSTGRES_PASSWORD=uxbox
|
- POSTGRES_PASSWORD=penpot
|
||||||
volumes:
|
volumes:
|
||||||
- ./files/postgresql.conf:/etc/postgresql.conf
|
- ./files/postgresql.conf:/etc/postgresql.conf
|
||||||
- ./files/postgresql_init.sql:/docker-entrypoint-initdb.d/init.sql
|
- ./files/postgresql_init.sql:/docker-entrypoint-initdb.d/init.sql
|
||||||
|
@ -72,6 +72,6 @@ services:
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
image: redis:6
|
image: redis:6
|
||||||
hostname: "uxbox-devenv-redis"
|
hostname: "penpot-devenv-redis"
|
||||||
container_name: "uxbox-devenv-redis"
|
container_name: "penpot-devenv-redis"
|
||||||
restart: always
|
restart: always
|
||||||
|
|
|
@ -2,11 +2,11 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
sudo cp /root/.bashrc /home/uxbox/.bashrc
|
sudo cp /root/.bashrc /home/penpot/.bashrc
|
||||||
sudo cp /root/.vimrc /home/uxbox/.vimrc
|
sudo cp /root/.vimrc /home/penpot/.vimrc
|
||||||
sudo cp /root/.tmux.conf /home/uxbox/.tmux.conf
|
sudo cp /root/.tmux.conf /home/penpot/.tmux.conf
|
||||||
|
|
||||||
source /home/uxbox/.bashrc
|
source /home/penpot/.bashrc
|
||||||
sudo chown uxbox:users /home/uxbox
|
sudo chown penpot:users /home/penpot
|
||||||
|
|
||||||
exec "$@"
|
exec "$@"
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
CREATE DATABASE uxbox_test;
|
CREATE DATABASE penpot_test;
|
||||||
|
|
|
@ -6,36 +6,36 @@ set -e;
|
||||||
source ~/.bashrc
|
source ~/.bashrc
|
||||||
|
|
||||||
echo "[start-tmux.sh] Installing node dependencies"
|
echo "[start-tmux.sh] Installing node dependencies"
|
||||||
pushd ~/uxbox/frontend/
|
pushd ~/penpot/frontend/
|
||||||
yarn install
|
yarn install
|
||||||
popd
|
popd
|
||||||
pushd ~/uxbox/exporter/
|
pushd ~/penpot/exporter/
|
||||||
yarn install
|
yarn install
|
||||||
popd
|
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 new-window -t penpot:1 -n 'shadow watch'
|
||||||
tmux select-window -t uxbox:1
|
tmux select-window -t penpot:1
|
||||||
tmux send-keys -t uxbox 'cd uxbox/frontend' enter C-l
|
tmux send-keys -t penpot 'cd penpot/frontend' enter C-l
|
||||||
tmux send-keys -t uxbox 'npx shadow-cljs watch main' enter
|
tmux send-keys -t penpot 'npx shadow-cljs watch main' enter
|
||||||
|
|
||||||
tmux new-window -t uxbox:2 -n 'exporter'
|
tmux new-window -t penpot:2 -n 'exporter'
|
||||||
tmux select-window -t uxbox:2
|
tmux select-window -t penpot:2
|
||||||
tmux send-keys -t uxbox 'cd uxbox/exporter' enter C-l
|
tmux send-keys -t penpot 'cd penpot/exporter' enter C-l
|
||||||
tmux send-keys -t uxbox 'npx shadow-cljs watch main' enter
|
tmux send-keys -t penpot 'npx shadow-cljs watch main' enter
|
||||||
tmux split-window -v
|
tmux split-window -v
|
||||||
tmux send-keys -t uxbox 'cd uxbox/exporter' enter C-l
|
tmux send-keys -t penpot 'cd penpot/exporter' enter C-l
|
||||||
tmux send-keys -t uxbox './scripts/wait-and-start.sh' enter
|
tmux send-keys -t penpot './scripts/wait-and-start.sh' enter
|
||||||
|
|
||||||
tmux new-window -t uxbox:3 -n 'backend'
|
tmux new-window -t penpot:3 -n 'backend'
|
||||||
tmux select-window -t uxbox:3
|
tmux select-window -t penpot:3
|
||||||
tmux send-keys -t uxbox 'cd uxbox/backend' enter C-l
|
tmux send-keys -t penpot 'cd penpot/backend' enter C-l
|
||||||
tmux send-keys -t uxbox './scripts/start-dev' enter
|
tmux send-keys -t penpot './scripts/start-dev' enter
|
||||||
|
|
||||||
tmux rename-window -t uxbox:0 'gulp'
|
tmux rename-window -t penpot:0 'gulp'
|
||||||
tmux select-window -t uxbox:0
|
tmux select-window -t penpot:0
|
||||||
tmux send-keys -t uxbox 'cd uxbox/frontend' enter C-l
|
tmux send-keys -t penpot 'cd penpot/frontend' enter C-l
|
||||||
tmux send-keys -t uxbox 'npx gulp --theme=${UXBOX_THEME} watch' enter
|
tmux send-keys -t penpot 'npx gulp --theme=${PENPOT_THEME} watch' enter
|
||||||
|
|
||||||
tmux -2 attach-session -t uxbox
|
tmux -2 attach-session -t penpot
|
||||||
|
|
32
manage.sh
32
manage.sh
|
@ -2,12 +2,12 @@
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
REV=`git log -n 1 --pretty=format:%h -- docker/`
|
REV=`git log -n 1 --pretty=format:%h -- docker/`
|
||||||
DEVENV_IMGNAME="uxbox-devenv"
|
DEVENV_IMGNAME="penpot-devenv"
|
||||||
|
|
||||||
function build-devenv {
|
function build-devenv {
|
||||||
echo "Building development image $DEVENV_IMGNAME:latest with UID $EXTERNAL_UID..."
|
echo "Building development image $DEVENV_IMGNAME:latest with UID $EXTERNAL_UID..."
|
||||||
local EXTERNAL_UID=${1:-$(id -u)}
|
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
|
--force-rm --build-arg EXTERNAL_UID=$EXTERNAL_UID
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,39 +19,39 @@ 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 uxboxdev -f docker/devenv/docker-compose.yaml up -d;
|
docker-compose -p penpotdev -f docker/devenv/docker-compose.yaml up -d;
|
||||||
}
|
}
|
||||||
|
|
||||||
function stop-devenv {
|
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 {
|
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..."
|
echo "Clean old development image $DEVENV_IMGNAME..."
|
||||||
docker images $DEVENV_IMGNAME -q | awk '{print $3}' | xargs --no-run-if-empty docker rmi
|
docker images $DEVENV_IMGNAME -q | awk '{print $3}' | xargs --no-run-if-empty docker rmi
|
||||||
}
|
}
|
||||||
|
|
||||||
function run-devenv {
|
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
|
start-devenv
|
||||||
fi
|
fi
|
||||||
|
|
||||||
docker exec -ti uxbox-devenv-main /home/start-tmux.sh
|
docker exec -ti penpot-devenv-main /home/start-tmux.sh
|
||||||
}
|
}
|
||||||
|
|
||||||
function build {
|
function build {
|
||||||
build-devenv-if-not-exists;
|
build-devenv-if-not-exists;
|
||||||
local IMAGE=$DEVENV_IMGNAME:latest;
|
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."
|
echo "Running development image $IMAGE to build frontend."
|
||||||
docker run -t --rm \
|
docker run -t --rm \
|
||||||
--mount source=uxboxdev_user_data,type=volume,target=/home/uxbox/ \
|
--mount source=penpotdev_user_data,type=volume,target=/home/penpot/ \
|
||||||
--mount source=`pwd`,type=bind,target=/home/uxbox/uxbox \
|
--mount source=`pwd`,type=bind,target=/home/penpot/penpot \
|
||||||
-w /home/uxbox/uxbox/$1 \
|
-w /home/penpot/penpot/$1 \
|
||||||
$IMAGE ./scripts/build.sh
|
$IMAGE ./scripts/build.sh
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,7 +79,7 @@ function build-bundle {
|
||||||
mv ./backend/target/dist ./bundle/backend
|
mv ./backend/target/dist ./bundle/backend
|
||||||
mv ./exporter/target ./bundle/exporter
|
mv ./exporter/target ./bundle/exporter
|
||||||
|
|
||||||
NAME="uxbox-$(date '+%Y.%m.%d-%H%M')"
|
NAME="penpot-$(date '+%Y.%m.%d-%H%M')"
|
||||||
|
|
||||||
pushd bundle/
|
pushd bundle/
|
||||||
tar -cvf ../$NAME.tar *;
|
tar -cvf ../$NAME.tar *;
|
||||||
|
@ -89,7 +89,7 @@ function build-bundle {
|
||||||
}
|
}
|
||||||
|
|
||||||
function log-devenv {
|
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 {
|
function build-testenv {
|
||||||
|
@ -110,18 +110,18 @@ function build-testenv {
|
||||||
popd
|
popd
|
||||||
|
|
||||||
pushd ./docker/testenv;
|
pushd ./docker/testenv;
|
||||||
docker-compose -p uxbox-testenv -f ./docker-compose.yaml build
|
docker-compose -p penpot-testenv -f ./docker-compose.yaml build
|
||||||
popd
|
popd
|
||||||
}
|
}
|
||||||
|
|
||||||
function start-testenv {
|
function start-testenv {
|
||||||
pushd ./docker/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
|
popd
|
||||||
}
|
}
|
||||||
|
|
||||||
function usage {
|
function usage {
|
||||||
echo "UXBOX build & release manager v$REV"
|
echo "PENPOT build & release manager v$REV"
|
||||||
echo "USAGE: $0 OPTION"
|
echo "USAGE: $0 OPTION"
|
||||||
echo "Options:"
|
echo "Options:"
|
||||||
# echo "- clean Stop and clean up docker containers"
|
# echo "- clean Stop and clean up docker containers"
|
||||||
|
|
Loading…
Add table
Reference in a new issue