-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
251 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: Build Container Image | ||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
- develop | ||
tags: | ||
- "*" | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Entire Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
with: | ||
platforms: linux/amd64 | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Set Branch | ||
run: | | ||
export APPS_JSON='[{"url": "https://github.com/frappe/print_designer","branch": "${{ github.ref_name }}"}{"url": "https://github.com/frappe/erpnext","branch": "${{ github.ref_type == 'tag' || github.ref_name == 'main' && 'version-15' || 'develop' }}"}]' | ||
echo "APPS_JSON_BASE64=$(echo $APPS_JSON | base64 -w 0)" >> $GITHUB_ENV | ||
echo "FRAPPE_BRANCH=${{ github.ref_type == 'tag' || github.ref_name == 'main' && 'version-15' || 'develop' }}" >> $GITHUB_ENV | ||
- name: Set Image Tag | ||
run: | | ||
echo "IMAGE_TAG=${{ github.ref_name == 'develop' && 'develop' || 'stable' }}" >> $GITHUB_ENV | ||
- uses: actions/checkout@v4 | ||
with: | ||
repository: frappe/frappe_docker | ||
path: builds | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v6 | ||
with: | ||
push: true | ||
context: builds | ||
file: builds/images/layered/Containerfile | ||
tags: > | ||
ghcr.io/${{ github.repository }}:${{ github.ref_name }}, | ||
ghcr.io/${{ github.repository }}:${{ env.IMAGE_TAG }} | ||
build-args: | | ||
"FRAPPE_BRANCH=${{ env.FRAPPE_BRANCH }}" | ||
"APPS_JSON_BASE64=${{ env.APPS_JSON_BASE64 }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
version: "3.7" | ||
services: | ||
mariadb: | ||
image: mariadb:10.8 | ||
command: | ||
- --character-set-server=utf8mb4 | ||
- --collation-server=utf8mb4_unicode_ci | ||
- --skip-character-set-client-handshake | ||
- --skip-innodb-read-only-compressed # Temporary fix for MariaDB 10.6 | ||
environment: | ||
MYSQL_ROOT_PASSWORD: 123 | ||
volumes: | ||
- mariadb-data:/var/lib/mysql | ||
|
||
redis: | ||
image: redis:alpine | ||
|
||
frappe: | ||
image: frappe/bench:latest | ||
command: bash /workspace/init.sh | ||
environment: | ||
- SHELL=/bin/bash | ||
working_dir: /home/frappe | ||
volumes: | ||
- .:/workspace | ||
ports: | ||
- 8000:8000 | ||
- 9000:9000 | ||
- 8080:8080 | ||
|
||
volumes: | ||
mariadb-data: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!bin/bash | ||
|
||
if [ -d "/home/frappe/frappe-bench/apps/frappe" ]; then | ||
echo "Bench already exists, skipping init" | ||
cd frappe-bench | ||
bench start | ||
else | ||
echo "Creating new bench..." | ||
fi | ||
|
||
bench init --skip-redis-config-generation frappe-bench --version version-15 | ||
|
||
cd frappe-bench | ||
|
||
# Use containers instead of localhost | ||
bench set-mariadb-host mariadb | ||
bench set-redis-cache-host redis:6379 | ||
bench set-redis-queue-host redis:6379 | ||
bench set-redis-socketio-host redis:6379 | ||
|
||
# Remove redis, watch from Procfile | ||
sed -i '/redis/d' ./Procfile | ||
sed -i '/watch/d' ./Procfile | ||
|
||
bench get-app erpnext --branch develop | ||
bench get-app print_designer --branch develop | ||
|
||
bench new-site print-designer.localhost \ | ||
--force \ | ||
--mariadb-root-password 123 \ | ||
--admin-password admin \ | ||
--no-mariadb-socket | ||
|
||
bench --site print-designer.localhost install-app erpnext | ||
bench --site print-designer.localhost install-app print_designer | ||
bench --site print-designer.localhost set-config developer_mode 1 | ||
bench --site print-designer.localhost clear-cache | ||
bench --site print-designer.localhost set-config mute_emails 1 | ||
bench use print-designer.localhost | ||
|
||
bench start |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.