mirror of
https://github.com/penpot/penpot.git
synced 2026-10-11 05:06:14 +00:00
commit
f93059412a
29
.dockerignore
Normal file
29
.dockerignore
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
# Ignorar Git y configuración
|
||||||
|
.git
|
||||||
|
.gitignore
|
||||||
|
.gitattributes
|
||||||
|
|
||||||
|
# Ignorar cachés de dependencias
|
||||||
|
node_modules
|
||||||
|
bower_components
|
||||||
|
tmp
|
||||||
|
.cache
|
||||||
|
|
||||||
|
# Ignorar archivos locales de desarrollo
|
||||||
|
.DS_Store
|
||||||
|
*.swp
|
||||||
|
*.swo
|
||||||
|
*.log
|
||||||
|
|
||||||
|
# Ignorar artefactos de builds
|
||||||
|
bundles/
|
||||||
|
frontend/target/
|
||||||
|
backend/target/
|
||||||
|
exporter/target/
|
||||||
|
docs/_dist/
|
||||||
|
|
||||||
|
# Ignorar configuración de CI no necesaria
|
||||||
|
.github/
|
||||||
|
.circleci/
|
||||||
|
.vscode/
|
||||||
|
.idea/
|
||||||
102
.github/workflows/build-bundles.yml
vendored
Normal file
102
.github/workflows/build-bundles.yml
vendored
Normal file
@ -0,0 +1,102 @@
|
|||||||
|
name: Build and Upload Penpot Bundles
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
zip_mode:
|
||||||
|
description: 'Bundle packaging mode'
|
||||||
|
required: false
|
||||||
|
default: 'individual'
|
||||||
|
type: choice
|
||||||
|
options:
|
||||||
|
- individual
|
||||||
|
- all
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- github-actions-bundle-build
|
||||||
|
env:
|
||||||
|
ZIP_MODE: ${{ github.event.inputs.zip_mode }}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-bundles:
|
||||||
|
name: Build frontend, backend, exporter and upload bundles
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Build Penpot CI Builder Image
|
||||||
|
run: |
|
||||||
|
docker build \
|
||||||
|
--build-arg EXTERNAL_UID=1000 \
|
||||||
|
--build-arg EXTERNAL_GID=1000 \
|
||||||
|
-t penpotapp/penpot-ci-builder:latest \
|
||||||
|
-f docker/devenv/Dockerfile \
|
||||||
|
docker/devenv
|
||||||
|
|
||||||
|
- name: Run manage.sh build-bundle from host
|
||||||
|
run: ./manage.sh build-bundle
|
||||||
|
|
||||||
|
- name: Create README and zip bundles
|
||||||
|
run: |
|
||||||
|
echo "📦 Generating bundle documentation and packaging..."
|
||||||
|
|
||||||
|
mkdir -p bundles
|
||||||
|
|
||||||
|
echo "# Penpot Frontend Bundle" > frontend/README.md
|
||||||
|
echo "This bundle contains the compiled frontend of Penpot. To deploy, serve it via a static file server like NGINX." >> frontend/README.md
|
||||||
|
|
||||||
|
echo "# Penpot Backend Bundle" > backend/README.md
|
||||||
|
echo "This bundle contains the backend services of Penpot. Deploy in a containerized or server environment supporting Clojure/Java." >> backend/README.md
|
||||||
|
|
||||||
|
echo "# Penpot Exporter Bundle" > exporter/README.md
|
||||||
|
echo "This bundle includes Penpot's export service. Use alongside backend for complete document conversion features." >> exporter/README.md
|
||||||
|
|
||||||
|
if [[ "${ZIP_MODE}" == "all" ]]; then
|
||||||
|
echo "Creating unified penpot-all-bundles.zip"
|
||||||
|
cp -r frontend backend exporter bundles/
|
||||||
|
echo "# Penpot Bundles" > bundles/README.md
|
||||||
|
echo "" >> bundles/README.md
|
||||||
|
echo "This package contains all Penpot components: frontend, backend, and exporter." >> bundles/README.md
|
||||||
|
echo "Refer to each subdirectory for specific deployment instructions." >> bundles/README.md
|
||||||
|
cd bundles
|
||||||
|
mkdir all-in-one
|
||||||
|
mv frontend backend exporter README.md all-in-one/
|
||||||
|
zip -r penpot-all-bundles.zip all-in-one
|
||||||
|
else
|
||||||
|
echo "Creating individual zip files"
|
||||||
|
zip -r frontend.zip frontend
|
||||||
|
zip -r backend.zip backend
|
||||||
|
zip -r exporter.zip exporter
|
||||||
|
fi
|
||||||
|
- name: Upload unified bundle
|
||||||
|
if: env.ZIP_MODE == 'all'
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: penpot-all-bundles
|
||||||
|
path: bundles/penpot-all-bundles.zip
|
||||||
|
|
||||||
|
- name: Upload frontend bundle
|
||||||
|
if: env.ZIP_MODE != 'all'
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: frontend-bundle
|
||||||
|
path: frontend.zip
|
||||||
|
|
||||||
|
- name: Upload backend bundle
|
||||||
|
if: env.ZIP_MODE != 'all'
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: backend-bundle
|
||||||
|
path: backend.zip
|
||||||
|
|
||||||
|
- name: Upload exporter bundle
|
||||||
|
if: env.ZIP_MODE != 'all'
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: exporter-bundle
|
||||||
|
path: exporter.zip
|
||||||
16
Dockerfile.ci
Normal file
16
Dockerfile.ci
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
# Dockerfile para Penpot CI Builder
|
||||||
|
|
||||||
|
FROM penpotapp/devenv:latest
|
||||||
|
|
||||||
|
USER root
|
||||||
|
|
||||||
|
RUN mkdir -p /home/penpot/.cache/node/corepack/v1 && \
|
||||||
|
chown -R 1000:1000 /home/penpot
|
||||||
|
|
||||||
|
USER penpot
|
||||||
|
ENV HOME=/home/penpot
|
||||||
|
WORKDIR /home/penpot/penpot
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
RUN corepack enable && corepack prepare yarn@stable --activate
|
||||||
@ -45,11 +45,18 @@ RUN set -ex; \
|
|||||||
locale-gen; \
|
locale-gen; \
|
||||||
rm -rf /var/lib/apt/lists/*;
|
rm -rf /var/lib/apt/lists/*;
|
||||||
|
|
||||||
|
ARG EXTERNAL_UID=1000
|
||||||
|
ARG EXTERNAL_GID=1000
|
||||||
|
|
||||||
RUN set -ex; \
|
RUN set -ex; \
|
||||||
usermod -l penpot -d /home/penpot -G users -s /bin/bash ubuntu; \
|
groupmod -g $EXTERNAL_GID ubuntu || true; \
|
||||||
passwd penpot -d; \
|
usermod -l penpot -d /home/penpot -u $EXTERNAL_UID -g $EXTERNAL_GID -m ubuntu || true; \
|
||||||
|
usermod -s /bin/bash penpot; \
|
||||||
|
mkdir -p /home/penpot; \
|
||||||
|
chown -R $EXTERNAL_UID:$EXTERNAL_GID /home/penpot; \
|
||||||
|
passwd -d penpot || true; \
|
||||||
echo "penpot 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; \
|
||||||
apt-get -qqy install --no-install-recommends \
|
apt-get -qqy install --no-install-recommends \
|
||||||
|
|||||||
20
manage.sh
20
manage.sh
@ -7,6 +7,9 @@ export DEVENV_PNAME="penpotdev";
|
|||||||
export CURRENT_USER_ID=$(id -u);
|
export CURRENT_USER_ID=$(id -u);
|
||||||
export CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD);
|
export CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD);
|
||||||
|
|
||||||
|
# Safe directory para evitar errores de ownership con Git
|
||||||
|
git config --global --add safe.directory /home/penpot/penpot || true
|
||||||
|
|
||||||
# Set default java options
|
# Set default java options
|
||||||
export JAVA_OPTS=${JAVA_OPTS:-"-Xmx1000m -Xms50m"};
|
export JAVA_OPTS=${JAVA_OPTS:-"-Xmx1000m -Xms50m"};
|
||||||
|
|
||||||
@ -111,14 +114,15 @@ function build {
|
|||||||
pull-devenv-if-not-exists;
|
pull-devenv-if-not-exists;
|
||||||
docker volume create ${DEVENV_PNAME}_user_data;
|
docker volume create ${DEVENV_PNAME}_user_data;
|
||||||
docker run -t --rm \
|
docker run -t --rm \
|
||||||
--mount source=${DEVENV_PNAME}_user_data,type=volume,target=/home/penpot/ \
|
--mount source=${DEVENV_PNAME}_user_data,type=volume,target=/home/penpot/ \
|
||||||
--mount source=`pwd`,type=bind,target=/home/penpot/penpot \
|
--mount source=`pwd`,type=bind,target=/home/penpot/penpot \
|
||||||
-e EXTERNAL_UID=$CURRENT_USER_ID \
|
-e EXTERNAL_UID=$CURRENT_USER_ID \
|
||||||
-e BUILD_STORYBOOK=$BUILD_STORYBOOK \
|
-e BUILD_STORYBOOK=$BUILD_STORYBOOK \
|
||||||
-e SHADOWCLJS_EXTRA_PARAMS=$SHADOWCLJS_EXTRA_PARAMS \
|
-e SHADOWCLJS_EXTRA_PARAMS=$SHADOWCLJS_EXTRA_PARAMS \
|
||||||
-e JAVA_OPTS="$JAVA_OPTS" \
|
-e JAVA_OPTS="$JAVA_OPTS" \
|
||||||
-w /home/penpot/penpot/$1 \
|
-w /home/penpot/penpot/$1 \
|
||||||
$DEVENV_IMGNAME:latest sudo -EH -u penpot ./scripts/build $version
|
$DEVENV_IMGNAME:latest sh -c "chown -R penpot:ubuntu /home/penpot && sudo -EH -u penpot ./scripts/build $version"
|
||||||
|
|
||||||
|
|
||||||
echo ">> build end: $1"
|
echo ">> build end: $1"
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user