diff --git a/.github/templates/instance.yaml b/.github/templates/instance.yaml index 47bf3ec..02852a9 100644 --- a/.github/templates/instance.yaml +++ b/.github/templates/instance.yaml @@ -10,7 +10,8 @@ appConfig: licenseGitToken: {{CUSTOMER_LICENSES_PAT}} deploy: pmai: - openaiHost: pmai-svc.pmai-system.svc.cluster.local + openaiHost: {{PMAI_HOST}} + aiMicroserviceHostWs: {{PMAI_HOST_WS}} deployDb: false dbHost: pm4-eng-stm-rds-cluster.cluster-ckz0mnb6cuna.us-east-1.rds.amazonaws.com dbName: pm4_ci-{{INSTANCE}}_ai @@ -47,14 +48,8 @@ analytics: collaborativeModeler: host: socketio-dev.processmaker.net port: 443 -cdata: - connectors: - docusign: 5543444B5541535544424141454E545041325246353431324354303100000000000000000000000050524F434553534D00004645344A374E443159345A550000 - excel: 5258444B5541535544424141454E545041325246353431324354303100000000000000000000000050524F434553534D00005A395A42364A5944463452350000 - github: 4647444B5541535544424141454E545041325246353431324354303100000000000000000000000050524F434553534D000056424530563739353759384A0000 - slack: 4643444B5541535544424141454E545041325246353431324354303100000000000000000000000050524F434553534D00004635523734413735455A32360000 - gmail: 4431444B5541535544424141454E545041325246353431324354303100000000000000000000000050524F434553534D00005356434441465847303144570000 - api: 4641444B5541535544424141454E545041325246353431324354303100000000000000000000000050524F434553534D00004750533442365456343939530000 +smartExtract: + hitlEnabled: true multitenancy: enable: {{MULTITENANCY}} microservices: @@ -68,6 +63,12 @@ microservices: keycloakBaseUrl: https://sso-microsvr-us-east-1.processmaker.net/realms/master/protocol/openid-connect/token keycloakUsername: pminstance-us-east-1 keycloakPassword: {{KEYCLOAK_PASSWORD}} + pusherAppId: 1000 + pusherAppKey: app-key + pusherAppSecret: app-secret + pusherHost: script-microsvr-ws-us-east-1.processmaker.net + pusherPort: 443 + pusherScheme: 'https' twilio: enable: true phoneNumber: "+17243958155" diff --git a/.github/workflows/deploy-pm4.yml b/.github/workflows/deploy-pm4.yml index ded39c3..61137d9 100644 --- a/.github/workflows/deploy-pm4.yml +++ b/.github/workflows/deploy-pm4.yml @@ -33,7 +33,10 @@ env: MULTITENANCY: ${{ (contains(github.event.pull_request.body, 'ci:multitenancy')) && 'true' || 'false' }} BASE_IMAGE: ${{ secrets.REGISTRY_HOST }}/processmaker/processmaker:base CUSTOMER_LICENSES_PAT: ${{ secrets.CUSTOMER_LICENSES_PAT }} + SKIP_REDEPLOY: ${{ (contains(github.event.pull_request.body, 'ci:skip-redeploy')) && 'true' || 'false' }} # K8S_BRANCH: ${{ contains(github.event.pull_request.body, 'ci:next') && 'next' || 'release-2024-fall' }} + PMAI_HOST: ${{ contains(github.event.pull_request.body, 'ci:pmai_dev') && 'pmai-svc.pmai-system-dev.svc.cluster.local' || 'pmai-svc.pmai-system.svc.cluster.local' }} + PMAI_HOST_WS: ${{ contains(github.event.pull_request.body, 'ci:pmai_dev') && 'pmai-dev-ws.engk8s.processmaker.net' || 'pmai-ws.engk8s.processmaker.net' }} concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ inputs.delete }} cancel-in-progress: true @@ -95,7 +98,7 @@ jobs: if: failure() run: | echo "=== Checking GitHub API rate limit status ===" - curl -I https://api.github.com + curl -I --header "Authorization: Bearer ${{ secrets.GIT_TOKEN }}" https://api.github.com echo "" echo "=== Rate limit check complete ===" @@ -169,6 +172,9 @@ jobs: instance=$(echo -n ${{env.IMAGE_TAG}} | md5sum | head -c 10) echo "INSTANCE: $instance" echo "IMAGE_TAG: $IMAGE_TAG" + + if [[ "${{ env.SKIP_REDEPLOY }}" != "true" ]]; then + sed -i "s#{{INSTANCE}}#$instance#g" .github/scripts/deploy-instance.sh sed -i "s#{{INSTANCE}}#$instance#g" .github/templates/instance.yaml sed -i "s#{{INSTANCE}}#$instance#g" .github/templates/db.yaml @@ -179,6 +185,8 @@ jobs: sed -i "s#{{MYSQL_USER}}#$RDS_ADMIN_USERNAME#g" .github/templates/instance.yaml sed -i "s#{{MYSQL_PASSWORD}}#$RDS_ADMIN_PASSWORD#g" .github/templates/instance.yaml sed -i "s#{{MULTITENANCY}}#$MULTITENANCY#g" .github/templates/instance.yaml + sed -i "s#{{PMAI_HOST}}#$PMAI_HOST#g" .github/templates/instance.yaml + sed -i "s#{{PMAI_HOST_WS}}#$PMAI_HOST_WS#g" .github/templates/instance.yaml sed -i "s#{{MYSQL_USERNAME}}#$RDS_ADMIN_USERNAME#g" .github/templates/db.yaml sed -i "s#{{MYSQL_PASSWORD}}#$RDS_ADMIN_PASSWORD#g" .github/templates/db.yaml echo "=== Checking instance.yaml after replacements ===" @@ -187,6 +195,7 @@ jobs: cat .github/templates/db.yaml chmod +x .github/scripts/deploy-instance.sh bash .github/scripts/deploy-instance.sh + fi if [ "$MULTITENANCY" = "true" ]; then export INSTANCE_URL="https://tenant-1.ci-$instance.engk8s.processmaker.net" else @@ -275,6 +284,39 @@ jobs: -H "Accept: application/vnd.github.v3+json" \ -d "$json_payload" \ "${URL}" + + runTestbench: + name: Run Testbench + needs: [deployEKS] + if: contains(github.event.pull_request.body, 'ci:run-testbench') + runs-on: ${{ vars.RUNNER }} + steps: + - name: Checkout testbench + uses: actions/checkout@v4 + with: + repository: ProcessMaker/testbench + path: testbench + + - name: Run testbench + working-directory: testbench + env: + SITE_NAME: CI + INSTANCE_PASSWORD: ${{ secrets.CI_INSTANCE_PASSWORD }} + CONTEXT_PATH: ./context + TCP_TUNNELS: "mailserver:587 mailserver:993" + run: | + instance=$(echo -n ${{env.IMAGE_TAG}} | md5sum | head -c 10) + echo "INSTANCE: $instance" + if [ "${{ env.MULTITENANCY }}" = "true" ]; then + export URL="https://tenant-1.ci-$instance.engk8s.processmaker.net" + else + export URL="https://ci-$instance.engk8s.processmaker.net" + fi + echo "URL: $URL" + export USER_GROUP="$(id -u):$(id -g)" + chmod +x ./start.sh + ./start.sh + deleteEKS: name: Delete Instance if: github.event.action == 'closed' || inputs.delete != '' @@ -358,15 +400,23 @@ jobs: docker compose run phpunit CONTAINER_ID=$(sudo docker ps -a | grep phpunit | awk '{print $1}') echo "Copying coverage report from PHP Unit Container: $CONTAINER_ID" - sudo docker cp $CONTAINER_ID:/opt/processmaker/coverage.xml coverage.xml + if sudo docker exec $CONTAINER_ID test -f /opt/processmaker/coverage.xml; then + sudo docker cp $CONTAINER_ID:/opt/processmaker/coverage.xml coverage.xml + echo "COVERAGE_EXISTS=true" >> $GITHUB_ENV + else + echo "coverage.xml not found in container, skipping coverage archive and SonarQube" + echo "COVERAGE_EXISTS=false" >> $GITHUB_ENV + fi - name: Archive code coverage + if: env.COVERAGE_EXISTS == 'true' uses: actions/upload-artifact@v4 with: name: code-coverage path: ./pm4-k8s-distribution/images/pm4-tools/coverage.xml - name: SonarQube Coverage Report + if: env.COVERAGE_EXISTS == 'true' uses: sonarsource/sonarqube-scan-action@master env: GIT_TOKEN: ${{ secrets.GIT_TOKEN }}