Update build_system_image.yml

This commit is contained in:
fal7w 2023-12-09 16:34:32 +03:00 committed by GitHub
parent ba6a2bf152
commit c644fb734e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,10 +4,10 @@ name: build system Image base on json config provided
on: on:
workflow_dispatch: workflow_dispatch:
# pull_request: pull_request:
# types: [opened, reopened] types: [opened, reopened]
# branches: [main] branches: [main]
# workflow_call: workflow_call:
# on: # on:
@ -27,9 +27,9 @@ jobs:
steps: steps:
- name: Checkout Repository - name: Checkout Repository
uses: actions/checkout@v2 uses: actions/checkout@v2
with: # with:
repository: malnozili/remittance_image_builder # repository: malnozili/remittance_image_builder
token: ${{ secrets.GITHUB_TOKEN }} # token: ${{ secrets.GITHUB_TOKEN }}
- name: login to harb - name: login to harb
uses: docker/login-action@v1 uses: docker/login-action@v1
@ -42,7 +42,7 @@ jobs:
git clone https://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@github.com/malnozili/remittance_image_builder.git git clone https://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@github.com/malnozili/remittance_image_builder.git
cd remittance_image_builder cd remittance_image_builder
../build_network_company_image.sh --tag="remittance_network_agent/${{ vars.BRANCH_NAME }}:latest" --token="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" --frappe-path="https://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@github.com/fintechsys/frappe.git" --frappe-branch=latest ../build_network_company_image.sh --tag="remittance_network_agent/${{ github.event.pull_request.head.ref }}:latest" --token="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" --frappe-path="https://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@github.com/fintechsys/frappe.git" --frappe-branch=${{ github.event.pull_request.head.ref }}
# docker image ls # docker image ls
# docker tag remittance_network_agent/${{ vars.BRANCH_NAME }}:latest harbor.fintechsys.net/frappe-systems/${{ vars.BRANCH_NAME }}:latest # docker tag remittance_network_agent/${{ vars.BRANCH_NAME }}:latest harbor.fintechsys.net/frappe-systems/${{ vars.BRANCH_NAME }}:latest
@ -52,36 +52,35 @@ jobs:
- name: Create first bench - name: Create first bench
run: | run: |
echo 'The branch name is' $BRANCH_NAME cp example.env ~/gitops/${{ github.event.pull_request.head.ref }}.env
cp example.env ~/gitopss/erpnext-one.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' ~/gitopss/erpnext-one.env sed -i 's/DB_HOST=/DB_HOST=mariadb-database/g' ~/gitops/${{ github.event.pull_request.head.ref }}.env
sed -i 's/DB_HOST=/DB_HOST=mariadb-database/g' ~/gitopss/erpnext-one.env sed -i 's/DB_PORT=/DB_PORT=3306/g' ~/gitops/${{ github.event.pull_request.head.ref }}.env
sed -i 's/DB_PORT=/DB_PORT=3306/g' ~/gitopss/erpnext-one.env sed -i 's/SITES=`erp.fintechsys.net`/SITES=\`${{ github.event.pull_request.head.ref }}\`/g' ~/gitops/${{ github.event.pull_request.head.ref }}.env
sed -i 's/SITES=`erp.fintechsys.net`/SITES=\`${{ vars.SITE_NAME }}\`/g' ~/gitopss/erpnext-one.env echo 'ROUTER=${{ github.event.pull_request.head.ref }}' >> ~/gitops/erpnext-one.env
echo 'ROUTER=erpnext-one' >> ~/gitopss/erpnext-one.env echo "BENCH_NETWORK=${{ github.event.pull_request.head.ref }}" >> ~/gitops/${{ github.event.pull_request.head.ref }}.env
echo "BENCH_NETWORK=${{ vars.BRANCH_NAME }}" >> ~/gitopss/erpnext-one.env
- name: Create a yaml file to deploy container - name: Create a yaml file to deploy container
run: | run: |
docker compose --project-name ${{ vars.BRANCH_NAME }} \ docker-compose --project-name ${{ vars.BRANCH_NAME }} \
--env-file ~/gitopss/erpnext-one.env \ --env-file ~/gitops/${{ github.event.pull_request.head.ref }}.env \
-f compose.yaml \ -f compose.yaml \
-f overrides/compose.redis.yaml \ -f overrides/compose.redis.yaml \
-f overrides/compose.multi-bench.yaml \ -f overrides/compose.multi-bench.yaml \
-f overrides/compose.multi-bench-ssl.yaml config > ~/gitopss/erpnext-one.yaml -f overrides/compose.multi-bench-ssl.yaml config > ~/gitops/${{ github.event.pull_request.head.ref }}.yaml
- name: Deploy the container - name: Deploy the container
run: | run: |
docker compose --project-name ${{ vars.BRANCH_NAME }} -f ~/gitopss/erpnext-one.yaml up -d docker-compose --project-name ${{ vars.BRANCH_NAME }} -f ~/gitops/${{ github.event.pull_request.head.ref }}.yaml up -d
- name: Create the site - name: Create the site
run: | run: |
docker compose --project-name ${{ vars.BRANCH_NAME }} exec -T backend \ docker-compose --project-name ${{ github.event.pull_request.head.ref }} exec -T backend \
bench new-site --no-mariadb-socket --mariadb-root-password ${{ vars.MARIADB_PASSWORD }} --install-app hrms --set-default \ bench new-site --no-mariadb-socket --mariadb-root-password ${{ vars.MARIADB_PASSWORD }} --install-app hrms --set-default \
--install-app rule_management --install-app remittance_base --install-app remittance --install-app bulk_remittance --install-app remittance_stellar_integration \ --install-app rule_management --install-app remittance_base --install-app remittance --install-app bulk_remittance --install-app remittance_stellar_integration \
--install-app client_account_management --install-app teller_for_erpnext --install-app teller_for_agent \ --install-app client_account_management --install-app teller_for_erpnext --install-app teller_for_agent \
--install-app remittance_agent_service --install-app payment_management --install-app bank_services --install-app remittance_customize \ --install-app remittance_agent_service --install-app payment_management --install-app bank_services --install-app remittance_customize \
--install-app remittance_network_manager --install-app erpnext_theme --install-app remittance_website --admin-password ${{ vars.MARIADB_PASSWORD }} ${{ vars.SITE_NAME }} --install-app remittance_network_manager --install-app erpnext_theme --install-app remittance_website --admin-password ${{ vars.MARIADB_PASSWORD }} ${{ github.event.pull_request.head.ref }}