mirror of
https://github.com/frappe/frappe_docker.git
synced 2026-06-25 08:55:08 +00:00
Update build_system_image.yml
This commit is contained in:
parent
f00facab6c
commit
a6dccdc2b0
1 changed files with 11 additions and 29 deletions
38
.github/workflows/build_system_image.yml
vendored
38
.github/workflows/build_system_image.yml
vendored
|
|
@ -15,38 +15,15 @@ jobs:
|
||||||
- self-hosted
|
- self-hosted
|
||||||
# - ubuntu-latest
|
# - ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
# - name: Checkout Repository
|
|
||||||
# uses: actions/checkout@v2
|
|
||||||
# - name: build image
|
|
||||||
# run: |
|
|
||||||
# rm -rf remittance_image_builder
|
|
||||||
# - name: build image
|
|
||||||
# run: |
|
|
||||||
# git clone --recursive https://${{ secrets._GITHUB_TOKEN }}@github.com/malnozili/remittance_image_builder.git
|
|
||||||
# cd remittance_image_builder
|
|
||||||
# ./build_network_company_image.sh --tag="remittance_network_agent/${{ github.event.pull_request.head.ref }}:latest" --token="${{ secrets.TOCKEN }}" --frappe-path="https://github.com/fintechsys/frappe.git" --frappe-branch=version-14 --fintech-branch=develop
|
|
||||||
# docker image ls
|
|
||||||
# docker tag remittance_network_agent/${{ vars.BRANCH_NAME }}:latest harbor.fintechsys.net/frappe-systems/${{ vars.BRANCH_NAME }}:latest
|
|
||||||
# docker push harbor.fintechsys.net/frappe-systems/remittance_network_agent/${{ vars.BRANCH_NAME }}:latest
|
|
||||||
#Creat Bench and sites
|
|
||||||
# sed -i 's/ERPNEXT_VERSION=/ERPNEXT_VERSION=${{ github.event.pull_request.head.ref }}/g' ~/gitops/${{ github.event.pull_request.head.ref }}.env
|
|
||||||
- name: Create directory
|
- name: Create directory
|
||||||
run: |
|
run: |
|
||||||
mkdir ~/gitops
|
mkdir ~/gitops
|
||||||
|
|
||||||
- name: Generate Random Ports
|
|
||||||
run: |
|
|
||||||
# Generate random ports between 1024 and 65535
|
|
||||||
port1=$((RANDOM%64311+1024))
|
|
||||||
echo "Random Port 1: $port1"
|
|
||||||
- name: Create first bench
|
- name: Create first bench
|
||||||
run: |
|
run: |
|
||||||
port1=$((RANDOM%64311+1024))
|
|
||||||
echo "Random Port 1: $port1"
|
|
||||||
cp example.env ~/gitops/${{ github.event.pull_request.head.ref }}.env
|
cp example.env ~/gitops/${{ github.event.pull_request.head.ref }}.env
|
||||||
sed -i 's/FRAPPE_SITE_NAME_HEADER=/FRAPPE_SITE_NAME_HEADER=${{ github.event.pull_request.head.ref }}/g' ~/gitops/${{ github.event.pull_request.head.ref }}.env
|
sed -i 's/FRAPPE_SITE_NAME_HEADER=/FRAPPE_SITE_NAME_HEADER=${{ github.event.pull_request.head.ref }}/g' ~/gitops/${{ github.event.pull_request.head.ref }}.env
|
||||||
echo "PORTS=$port1" >> ~/gitops/${{ github.event.pull_request.head.ref }}.env
|
|
||||||
sed -i 's/DB_PASSWORD=123/DB_PASSWORD=${{ vars.MARIADB_PASSWORD }}/g' ~/gitops/${{ github.event.pull_request.head.ref }}.env
|
sed -i 's/DB_PASSWORD=123/DB_PASSWORD=${{ vars.MARIADB_PASSWORD }}/g' ~/gitops/${{ github.event.pull_request.head.ref }}.env
|
||||||
|
echo "PORTS= $((8081 + RANDOM % 919))" >> ~/gitops/${{ github.event.pull_request.head.ref }}.env
|
||||||
# sed -i 's/DBPASSWORD=/DP=DBPASSWORD=${{ vars.MARIADB_PASSWORD }}/g' ~/gitops/${{ github.event.pull_request.head.ref }}.env
|
# sed -i 's/DBPASSWORD=/DP=DBPASSWORD=${{ vars.MARIADB_PASSWORD }}/g' ~/gitops/${{ github.event.pull_request.head.ref }}.env
|
||||||
# sed -i 's/PORTS=/PORTS= $port1 /g' ~/gitops/${{ github.event.pull_request.head.ref }}.env
|
# sed -i 's/PORTS=/PORTS= $port1 /g' ~/gitops/${{ github.event.pull_request.head.ref }}.env
|
||||||
# sed -i 's/DB_PASSWORD=123/DB_PASSWORD=${{ vars.MARIADB_PASSWORD }}/g' ~/gitops/${{ github.event.pull_request.head.ref }}.env
|
# sed -i 's/DB_PASSWORD=123/DB_PASSWORD=${{ vars.MARIADB_PASSWORD }}/g' ~/gitops/${{ github.event.pull_request.head.ref }}.env
|
||||||
|
|
@ -60,12 +37,17 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
docker-compose --project-name ${{ github.event.pull_request.head.ref }} \
|
docker-compose --project-name ${{ github.event.pull_request.head.ref }} \
|
||||||
--env-file ~/gitops/${{ github.event.pull_request.head.ref }}.env \
|
--env-file ~/gitops/${{ github.event.pull_request.head.ref }}.env \
|
||||||
-f pwd.yml config > ~/gitops/${{ github.event.pull_request.head.ref }}.yaml
|
-f pwd.yml config > ~/gitops/${{ github.event.pull_request.head.ref }}.yaml
|
||||||
|
|
||||||
|
|
||||||
# - name: Deploy the container
|
- name: Deploy the container
|
||||||
# run: |
|
run: |
|
||||||
# docker-compose --project-name ${{ github.event.pull_request.head.ref }} -f ~/gitops/${{ github.event.pull_request.head.ref }}.yaml up -d
|
docker-compose --project-name ${{ github.event.pull_request.head.ref }} -f ~/gitops/${{ github.event.pull_request.head.ref }}.yaml up -d
|
||||||
|
|
||||||
|
- name: Create the site
|
||||||
|
run: |
|
||||||
|
docker-compose --project-name ${{ github.event.pull_request.head.ref }} exec -T backend \
|
||||||
|
bench new-site --no-mariadb-socket --admin-password=${{ vars.MARIADB_PASSWORD }} --db-root-password=${{ vars.MARIADB_PASSWORD }} --install-app erpnext --set-default ${{ github.event.pull_request.head.ref }}
|
||||||
|
|
||||||
|
|
||||||
# - name: Create the site
|
# - name: Create the site
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue