Skip to content

Commit f930594

Browse files
authored
Merge pull request penpot#6463 from sancfc/develop
add new configurations
2 parents 294ce7b + a65aa5e commit f930594

File tree

5 files changed

+169
-11
lines changed

5 files changed

+169
-11
lines changed

.dockerignore

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Ignorar Git y configuración
2+
.git
3+
.gitignore
4+
.gitattributes
5+
6+
# Ignorar cachés de dependencias
7+
node_modules
8+
bower_components
9+
tmp
10+
.cache
11+
12+
# Ignorar archivos locales de desarrollo
13+
.DS_Store
14+
*.swp
15+
*.swo
16+
*.log
17+
18+
# Ignorar artefactos de builds
19+
bundles/
20+
frontend/target/
21+
backend/target/
22+
exporter/target/
23+
docs/_dist/
24+
25+
# Ignorar configuración de CI no necesaria
26+
.github/
27+
.circleci/
28+
.vscode/
29+
.idea/
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: Build and Upload Penpot Bundles
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
zip_mode:
7+
description: 'Bundle packaging mode'
8+
required: false
9+
default: 'individual'
10+
type: choice
11+
options:
12+
- individual
13+
- all
14+
push:
15+
branches:
16+
- github-actions-bundle-build
17+
env:
18+
ZIP_MODE: ${{ github.event.inputs.zip_mode }}
19+
20+
jobs:
21+
build-bundles:
22+
name: Build frontend, backend, exporter and upload bundles
23+
runs-on: ubuntu-latest
24+
25+
steps:
26+
- name: Checkout repository
27+
uses: actions/checkout@v4
28+
29+
- name: Set up Docker Buildx
30+
uses: docker/setup-buildx-action@v3
31+
32+
- name: Build Penpot CI Builder Image
33+
run: |
34+
docker build \
35+
--build-arg EXTERNAL_UID=1000 \
36+
--build-arg EXTERNAL_GID=1000 \
37+
-t penpotapp/penpot-ci-builder:latest \
38+
-f docker/devenv/Dockerfile \
39+
docker/devenv
40+
41+
- name: Run manage.sh build-bundle from host
42+
run: ./manage.sh build-bundle
43+
44+
- name: Create README and zip bundles
45+
run: |
46+
echo "📦 Generating bundle documentation and packaging..."
47+
48+
mkdir -p bundles
49+
50+
echo "# Penpot Frontend Bundle" > frontend/README.md
51+
echo "This bundle contains the compiled frontend of Penpot. To deploy, serve it via a static file server like NGINX." >> frontend/README.md
52+
53+
echo "# Penpot Backend Bundle" > backend/README.md
54+
echo "This bundle contains the backend services of Penpot. Deploy in a containerized or server environment supporting Clojure/Java." >> backend/README.md
55+
56+
echo "# Penpot Exporter Bundle" > exporter/README.md
57+
echo "This bundle includes Penpot's export service. Use alongside backend for complete document conversion features." >> exporter/README.md
58+
59+
if [[ "${ZIP_MODE}" == "all" ]]; then
60+
echo "Creating unified penpot-all-bundles.zip"
61+
cp -r frontend backend exporter bundles/
62+
echo "# Penpot Bundles" > bundles/README.md
63+
echo "" >> bundles/README.md
64+
echo "This package contains all Penpot components: frontend, backend, and exporter." >> bundles/README.md
65+
echo "Refer to each subdirectory for specific deployment instructions." >> bundles/README.md
66+
cd bundles
67+
mkdir all-in-one
68+
mv frontend backend exporter README.md all-in-one/
69+
zip -r penpot-all-bundles.zip all-in-one
70+
else
71+
echo "Creating individual zip files"
72+
zip -r frontend.zip frontend
73+
zip -r backend.zip backend
74+
zip -r exporter.zip exporter
75+
fi
76+
- name: Upload unified bundle
77+
if: env.ZIP_MODE == 'all'
78+
uses: actions/upload-artifact@v4
79+
with:
80+
name: penpot-all-bundles
81+
path: bundles/penpot-all-bundles.zip
82+
83+
- name: Upload frontend bundle
84+
if: env.ZIP_MODE != 'all'
85+
uses: actions/upload-artifact@v4
86+
with:
87+
name: frontend-bundle
88+
path: frontend.zip
89+
90+
- name: Upload backend bundle
91+
if: env.ZIP_MODE != 'all'
92+
uses: actions/upload-artifact@v4
93+
with:
94+
name: backend-bundle
95+
path: backend.zip
96+
97+
- name: Upload exporter bundle
98+
if: env.ZIP_MODE != 'all'
99+
uses: actions/upload-artifact@v4
100+
with:
101+
name: exporter-bundle
102+
path: exporter.zip

Dockerfile.ci

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Dockerfile para Penpot CI Builder
2+
3+
FROM penpotapp/devenv:latest
4+
5+
USER root
6+
7+
RUN mkdir -p /home/penpot/.cache/node/corepack/v1 && \
8+
chown -R 1000:1000 /home/penpot
9+
10+
USER penpot
11+
ENV HOME=/home/penpot
12+
WORKDIR /home/penpot/penpot
13+
14+
COPY . .
15+
16+
RUN corepack enable && corepack prepare yarn@stable --activate

docker/devenv/Dockerfile

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,18 @@ RUN set -ex; \
4545
locale-gen; \
4646
rm -rf /var/lib/apt/lists/*;
4747

48+
ARG EXTERNAL_UID=1000
49+
ARG EXTERNAL_GID=1000
50+
4851
RUN set -ex; \
49-
usermod -l penpot -d /home/penpot -G users -s /bin/bash ubuntu; \
50-
passwd penpot -d; \
52+
groupmod -g $EXTERNAL_GID ubuntu || true; \
53+
usermod -l penpot -d /home/penpot -u $EXTERNAL_UID -g $EXTERNAL_GID -m ubuntu || true; \
54+
usermod -s /bin/bash penpot; \
55+
mkdir -p /home/penpot; \
56+
chown -R $EXTERNAL_UID:$EXTERNAL_GID /home/penpot; \
57+
passwd -d penpot || true; \
5158
echo "penpot ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
52-
59+
5360
RUN set -ex; \
5461
apt-get -qq update; \
5562
apt-get -qqy install --no-install-recommends \

manage.sh

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ export DEVENV_PNAME="penpotdev";
77
export CURRENT_USER_ID=$(id -u);
88
export CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD);
99

10+
# Safe directory para evitar errores de ownership con Git
11+
git config --global --add safe.directory /home/penpot/penpot || true
12+
1013
# Set default java options
1114
export JAVA_OPTS=${JAVA_OPTS:-"-Xmx1000m -Xms50m"};
1215

@@ -111,14 +114,15 @@ function build {
111114
pull-devenv-if-not-exists;
112115
docker volume create ${DEVENV_PNAME}_user_data;
113116
docker run -t --rm \
114-
--mount source=${DEVENV_PNAME}_user_data,type=volume,target=/home/penpot/ \
115-
--mount source=`pwd`,type=bind,target=/home/penpot/penpot \
116-
-e EXTERNAL_UID=$CURRENT_USER_ID \
117-
-e BUILD_STORYBOOK=$BUILD_STORYBOOK \
118-
-e SHADOWCLJS_EXTRA_PARAMS=$SHADOWCLJS_EXTRA_PARAMS \
119-
-e JAVA_OPTS="$JAVA_OPTS" \
120-
-w /home/penpot/penpot/$1 \
121-
$DEVENV_IMGNAME:latest sudo -EH -u penpot ./scripts/build $version
117+
--mount source=${DEVENV_PNAME}_user_data,type=volume,target=/home/penpot/ \
118+
--mount source=`pwd`,type=bind,target=/home/penpot/penpot \
119+
-e EXTERNAL_UID=$CURRENT_USER_ID \
120+
-e BUILD_STORYBOOK=$BUILD_STORYBOOK \
121+
-e SHADOWCLJS_EXTRA_PARAMS=$SHADOWCLJS_EXTRA_PARAMS \
122+
-e JAVA_OPTS="$JAVA_OPTS" \
123+
-w /home/penpot/penpot/$1 \
124+
$DEVENV_IMGNAME:latest sh -c "chown -R penpot:ubuntu /home/penpot && sudo -EH -u penpot ./scripts/build $version"
125+
122126

123127
echo ">> build end: $1"
124128
}

0 commit comments

Comments
 (0)