Merge pull request #10229 from ToolJet/feat/update-lts-machine

Updated CE LTS test system after release to develop branch
This commit is contained in:
Adish M 2024-07-01 15:40:09 +05:30 committed by GitHub
commit 8c90192557
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -155,4 +155,55 @@ jobs:
message="Job '${{ env.JOB_NAME }}' failed! tooljet/tooljet-ce:${{ github.event.inputs.image }}"
fi
curl -X POST -H 'Content-type: application/json' --data "{\"text\":\"$message\"}" ${{ secrets.SLACK_WEBHOOK_URL }}
update-lts-machine:
runs-on: ubuntu-latest
needs: build-tooljet-ce-image
if: "contains(github.event.release.tag_name, 'CE-LTS')"
steps:
- name: SSH into GCP VM instance
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.GCP_CE_LTS_INSTANCE_IP }}
username: ${{ secrets.GCP_USERNAME }}
key: ${{ secrets.EC2_INSTANCE_SSH_KEY }}
script: |
ls -lah
# Stop the Docker containers
sudo docker-compose down
# Check remaining images
sudo docker images
# Remove the existing tooljet/* images
sudo docker images -a | grep 'tooljet/' | awk '{print $3}' | xargs sudo docker rmi -f
# Check remaining images
sudo docker images
# Update docker-compose.yml with the new image for tooljet service
sed -i '/^[[:space:]]*tooljet:/,/^[[:space:]]*[^:]*$/ { /^[[:space:]]*image:[[:space:]]*tooljet\/tooljet-ce/s|\(image:[[:space:]]*\).*|\1tooljet/tooljet-ce:'"${{ github.event.inputs.image }}"'| }' docker-compose.yml
# check the updated docker-compose.yml file
cat docker-compose.yaml
# Start the Docker containers
sudo docker-compose up -d
#View containers
sudo docker ps
- name: Send Slack Notification
run: |
if [[ "${{ job.status }}" == "success" ]]; then
message="CE-LTS test system with updated the image: `tooljet/tooljet-ce:${{ github.event.inputs.image }}`"
else
message="Failed to update the CE LTS test system"
fi
curl -X POST -H 'Content-type: application/json' --data "{\"text\":\"$message\"}" ${{ secrets.SLACK_WEBHOOK_URL }}