Update build_system_image.yml

This commit is contained in:
fal7w 2023-12-16 23:11:04 +03:00 committed by GitHub
parent f00facab6c
commit a6dccdc2b0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -15,38 +15,15 @@ jobs:
- self-hosted
# - ubuntu-latest
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
run: |
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
run: |
port1=$((RANDOM%64311+1024))
echo "Random Port 1: $port1"
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
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
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/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
@ -60,14 +37,19 @@ jobs:
run: |
docker-compose --project-name ${{ github.event.pull_request.head.ref }} \
--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
# run: |
# docker-compose --project-name ${{ github.event.pull_request.head.ref }} -f ~/gitops/${{ github.event.pull_request.head.ref }}.yaml up -d
- name: Deploy the container
run: |
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
# run: |
# docker-compose --project-name ${{ github.event.pull_request.head.ref }} exec -T backend \