ToolJet/.github/workflows/packer-build.yml
Adish M c08eb83da5
Adding redis as a default deployment (#7455)
* Adding redis as a default deployment

* creating test image

* renamed redis file

* redis unit error fixed

* redis installation files fixed

* changed image in all the deployments

* removing docker automation

* changed the base image in try-tooljet dockerfile

* stopped pack build from ce

* Automation changes

* Update deployment.yaml

* Update deployment.yaml

* Update deployment.yaml

* Update deployment.yaml

* Update deployment.yaml

* Update deployment.yaml

* Update try-tooljet.Dockerfile

* Update deployment.yaml

* Update deployment.yaml

* Update deployment.yaml

* Update variables.pkr.hcl

* Update variables.pkr.hcl

* Update variables.pkr.hcl

* Update tooljet_ubuntu_focal.pkr.hcl

* Update setup_machine.sh

* Update setup_machine.sh

* Delete deploy/ec2/redis-server.service

* Update .env

* Update docker-compose.yaml

* Update docker-compose.yaml

* Update docker-compose.yaml

* Update docker-compose-db.yaml

* Update docker-compose-db.yaml

* Update .env.external.example

* Update .env.internal.example

* Update .env.internal.example

* Update tooljet-release-docker-image-build.yml

* Update tooljet-release-docker-image-build.yml
2023-09-27 11:10:52 +05:30

73 lines
No EOL
2.2 KiB
YAML

name: AWS AMI build using Packer config
on:
# release:
# types: [published]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
version:
description: "RELEASE_VERSION"
jobs:
packer:
runs-on: ubuntu-latest
name: packer
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Setting tag
if: "${{ github.event.inputs.version != '' }}"
run: echo "RELEASE_VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV
- name: Set evn
if: "${{ github.event.release }}"
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-1
# Initialize Packer templates
- name: Initialize Packer Template
uses: hashicorp/packer-github-actions@master
with:
command: init
target: .
working_directory: deploy/ec2
# validate templates
- name: Validate Template
uses: hashicorp/packer-github-actions@master
with:
command: validate
arguments: -syntax-only
target: .
working_directory: deploy/ec2
# build artifact
- name: Build Artifact
uses: hashicorp/packer-github-actions@master
with:
command: build
arguments: -color=false -on-error=abort -var ami_name=tooljet_${{ env.RELEASE_VERSION }}.ubuntu_focal
target: .
working_directory: deploy/ec2
env:
PACKER_LOG: 1
- name: Send Slack Notification
run: |
if [[ "${{ job.status }}" == "success" ]]; then
message="Job '${{ env.JOB_NAME }}' succeeded! AMI = tooljet_${{ env.RELEASE_VERSION }}.ubuntu_focal"
else
message="Job '${{ env.JOB_NAME }}' failed! AMI = tooljet_${{ env.RELEASE_VERSION }}.ubuntu_focal"
fi
curl -X POST -H 'Content-type: application/json' --data "{\"text\":\"$message\"}" ${{ secrets.SLACK_WEBHOOK_URL }}