mirror of
https://github.com/ToolJet/ToolJet
synced 2026-04-21 21:47:17 +00:00
326 lines
13 KiB
YAML
326 lines
13 KiB
YAML
name: ToolJet Edition docker images builds
|
|
|
|
on:
|
|
release:
|
|
types: [published]
|
|
|
|
jobs:
|
|
build-tooljet-image-for-ce-edtion:
|
|
runs-on: ubuntu-latest
|
|
if: "${{ github.event.release }}"
|
|
|
|
steps:
|
|
|
|
- name: Checkout code to main for pre-release CE edition
|
|
if: "!contains(github.event.release.tag_name, 'ce-lts')"
|
|
uses: actions/checkout@v2
|
|
with:
|
|
ref: refs/heads/main
|
|
|
|
- name: Checkout code to LTS for CE LTS edition
|
|
if: "contains(github.event.release.tag_name, '-ce-lts')"
|
|
uses: actions/checkout@v2
|
|
with:
|
|
ref: refs/heads/lts-4.0
|
|
|
|
# Create Docker Buildx builder with platform configuration
|
|
- name: Set up Docker Buildx
|
|
run: |
|
|
mkdir -p ~/.docker/cli-plugins
|
|
curl -SL https://github.com/docker/buildx/releases/download/v0.11.0/buildx-v0.11.0.linux-amd64 -o ~/.docker/cli-plugins/docker-buildx
|
|
chmod a+x ~/.docker/cli-plugins/docker-buildx
|
|
docker buildx create --name mybuilder --platform linux/arm64,linux/amd64,linux/amd64/v2,linux/riscv64,linux/ppc64le,linux/s390x,linux/386,linux/mips64le,linux/mips64,linux/arm/v7,linux/arm/v6
|
|
docker buildx use mybuilder
|
|
|
|
- name: Set DOCKER_CLI_EXPERIMENTAL
|
|
run: echo "DOCKER_CLI_EXPERIMENTAL=enabled" >> $GITHUB_ENV
|
|
|
|
- name: use mybuilder buildx
|
|
run: docker buildx use mybuilder
|
|
|
|
- name: Docker Login
|
|
uses: docker/login-action@v2
|
|
with:
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
- name: Build and Push Docker image for pre-release tag
|
|
if: "!contains(github.event.release.tag_name, '-ce-lts')"
|
|
uses: docker/build-push-action@v4
|
|
with:
|
|
context: .
|
|
file: docker/ce-production.Dockerfile
|
|
push: true
|
|
tags: tooljet/tooljet-ce:${{ github.event.release.tag_name }},tooljet/tooljet-ce:ce-latest
|
|
platforms: linux/amd64
|
|
env:
|
|
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
|
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
- name: Build and Push Docker image for LTS tag
|
|
if: "contains(github.event.release.tag_name, '-ce-lts')"
|
|
uses: docker/build-push-action@v4
|
|
with:
|
|
context: .
|
|
file: docker/ce-production.Dockerfile
|
|
push: true
|
|
tags: tooljet/tooljet-ce:${{ github.event.release.tag_name }},tooljet/tooljet-ce:ce-lts-latest
|
|
platforms: linux/amd64
|
|
env:
|
|
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
|
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
- name: Send Slack Notification
|
|
run: |
|
|
if [[ "${{ job.status }}" == "success" ]]; then
|
|
message="ToolJet community image published:\n\`tooljet/tooljet-ce:${{ github.event.release.tag_name }}\`"
|
|
else
|
|
message="Job '${{ env.JOB_NAME }}' failed! tooljet/tooljet-ce:${{ github.event.release.tag_name }}"
|
|
fi
|
|
|
|
curl -X POST -H 'Content-type: application/json' --data "{\"text\":\"$message\"}" ${{ secrets.SLACK_WEBHOOK_URL }}
|
|
|
|
|
|
- name: Send Slack Notification
|
|
run: |
|
|
if [[ "${{ job.status }}" == "success" ]]; then
|
|
message="ToolJet community image published:\n\`tooljet/tooljet-ce:${{ github.event.release.tag_name }}\`"
|
|
else
|
|
message="Job '${{ env.JOB_NAME }}' failed! tooljet/tooljet-ce:${{ github.event.release.tag_name }}"
|
|
fi
|
|
|
|
curl -X POST -H 'Content-type: application/json' --data "{\"text\":\"$message\"}" ${{ secrets.SLACK_WEBHOOK_URL }}
|
|
|
|
|
|
build-tooljet-image-for-ee-edtion:
|
|
|
|
runs-on: ubuntu-latest
|
|
if: "${{ github.event.release }}"
|
|
|
|
steps:
|
|
- name: Checkout code to main for pre-release EE edition
|
|
if: "!contains(github.event.release.tag_name, 'ee-lts')"
|
|
uses: actions/checkout@v2
|
|
with:
|
|
ref: refs/heads/main
|
|
|
|
- name: Checkout code to LTS for EE LTS edition
|
|
if: "contains(github.event.release.tag_name, '-ee-lts')"
|
|
uses: actions/checkout@v2
|
|
with:
|
|
ref: refs/heads/lts-4.0
|
|
|
|
# Create Docker Buildx builder with platform configuration
|
|
- name: Set up Docker Buildx
|
|
run: |
|
|
mkdir -p ~/.docker/cli-plugins
|
|
curl -SL https://github.com/docker/buildx/releases/download/v0.11.0/buildx-v0.11.0.linux-amd64 -o ~/.docker/cli-plugins/docker-buildx
|
|
chmod a+x ~/.docker/cli-plugins/docker-buildx
|
|
docker buildx create --name mybuilder --platform linux/arm64,linux/amd64,linux/amd64/v2,linux/riscv64,linux/ppc64le,linux/s390x,linux/386,linux/mips64le,linux/mips64,linux/arm/v7,linux/arm/v6
|
|
docker buildx use mybuilder
|
|
|
|
- name: Set DOCKER_CLI_EXPERIMENTAL
|
|
run: echo "DOCKER_CLI_EXPERIMENTAL=enabled" >> $GITHUB_ENV
|
|
|
|
- name: use mybuilder buildx
|
|
run: docker buildx use mybuilder
|
|
|
|
- name: Docker Login
|
|
uses: docker/login-action@v2
|
|
with:
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
|
|
- name: Build and Push Docker image for pre-release tag
|
|
if: "!contains(github.event.release.tag_name, '-ee-lts')"
|
|
uses: docker/build-push-action@v4
|
|
with:
|
|
context: .
|
|
build-args: |
|
|
CUSTOM_GITHUB_TOKEN=${{ secrets.CUSTOM_GITHUB_TOKEN }}
|
|
file: docker/ee/ee-production.Dockerfile
|
|
push: true
|
|
tags: tooljet/tooljet-ee:${{ github.event.release.tag_name }},tooljet/tooljet-ee:ee-lts-latest,tooljet/tooljet:ee-lts-latest,tooljet/tooljet:${{ github.event.release.tag_name }}
|
|
platforms: linux/amd64
|
|
env:
|
|
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
|
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
|
|
- name: Build and Push Docker image for LTS tag
|
|
if: "contains(github.event.release.tag_name, '-ee-lts')"
|
|
uses: docker/build-push-action@v4
|
|
with:
|
|
context: .
|
|
build-args: |
|
|
CUSTOM_GITHUB_TOKEN=${{ secrets.CUSTOM_GITHUB_TOKEN }}
|
|
file: docker/ee/ee-production.Dockerfile
|
|
push: true
|
|
tags: tooljet/tooljet-ee:${{ github.event.release.tag_name }},tooljet/tooljet-ee:ee-lts-latest,tooljet/tooljet:ee-lts-latest,tooljet/tooljet:${{ github.event.release.tag_name }}
|
|
platforms: linux/amd64
|
|
env:
|
|
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
|
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
- name: Send Slack Notification
|
|
run: |
|
|
if [[ "${{ job.status }}" == "success" ]]; then
|
|
message="ToolJet enterprise image published:\n\`tooljet/tooljet-ee:${{ github.event.release.tag_name }}\`\n\`tooljet/tooljet:${{ github.event.release.tag_name }}\`"
|
|
else
|
|
message="Job '${{ env.JOB_NAME }}' failed! Image built:\n\`tooljet/tooljet-ee:${{ github.event.release.tag_name }}\`\n\`tooljet/tooljet:${{ github.event.release.tag_name }}\`"
|
|
fi
|
|
|
|
curl -X POST -H 'Content-type: application/json' --data "{\"text\":\"$message\"}" ${{ secrets.SLACK_WEBHOOK_URL }}
|
|
|
|
|
|
# commented out for now, since cloud modularisation is not yet ready
|
|
|
|
# build-tooljet-image-for-cloud-edtion:
|
|
|
|
# runs-on: ubuntu-latest
|
|
# if: "${{ github.event.release }}"
|
|
|
|
# steps:
|
|
# - name: Checkout code to LTS for Cloud LTS edition
|
|
# if: "contains(github.event.release.tag_name, '-cloud-lts')"
|
|
# uses: actions/checkout@v2
|
|
# with:
|
|
# ref: refs/heads/lts-4.0
|
|
|
|
# # Create Docker Buildx builder with platform configuration
|
|
# - name: Set up Docker Buildx
|
|
# run: |
|
|
# mkdir -p ~/.docker/cli-plugins
|
|
# curl -SL https://github.com/docker/buildx/releases/download/v0.11.0/buildx-v0.11.0.linux-amd64 -o ~/.docker/cli-plugins/docker-buildx
|
|
# chmod a+x ~/.docker/cli-plugins/docker-buildx
|
|
# docker buildx create --name mybuilder --platform linux/arm64,linux/amd64,linux/amd64/v2,linux/riscv64,linux/ppc64le,linux/s390x,linux/386,linux/mips64le,linux/mips64,linux/arm/v7,linux/arm/v6
|
|
# docker buildx use mybuilder
|
|
|
|
# - name: Set DOCKER_CLI_EXPERIMENTAL
|
|
# run: echo "DOCKER_CLI_EXPERIMENTAL=enabled" >> $GITHUB_ENV
|
|
|
|
# - name: use mybuilder buildx
|
|
# run: docker buildx use mybuilder
|
|
|
|
# - name: Docker Login
|
|
# uses: docker/login-action@v2
|
|
# with:
|
|
# username: ${{ secrets.DOCKER_USERNAME }}
|
|
# password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
# - name: Build and Push Docker image for LTS tag
|
|
# if: "contains(github.event.release.tag_name, '-cloud-lts')"
|
|
# uses: docker/build-push-action@v4
|
|
# with:
|
|
# context: .
|
|
# args: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
|
|
# file: docker/cloud/cloud-server.Dockerfile
|
|
# push: true
|
|
# tags: tooljet/saas:${{ github.event.release.tag_name }}
|
|
# platforms: linux/amd64
|
|
# env:
|
|
# DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
|
# DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
# - name: Send Slack Notification
|
|
# run: |
|
|
# if [[ "${{ job.status }}" == "success" ]]; then
|
|
# message="ToolJet cloud image published:\n\`tooljet/saas:${{ github.event.release.tag_name }}\`"
|
|
# else
|
|
# message="Job '${{ env.JOB_NAME }}' failed! Image built:\n\`tooljet/saas:${{ github.event.release.tag_name }}\`"
|
|
# fi
|
|
|
|
# curl -X POST -H 'Content-type: application/json' --data "{\"text\":\"$message\"}" ${{ secrets.SLACK_WEBHOOK_URL }}
|
|
|
|
|
|
try-tooljet-image-build:
|
|
runs-on: ubuntu-latest
|
|
needs: build-tooljet-image-for-ee-edtion
|
|
if: ${{ needs.build-tooljet-image-for-ee-edtion.result == 'success' }}
|
|
|
|
steps:
|
|
- name: Checkout code to develop
|
|
if: "!contains(github.event.release.tag_name, 'ee-lts')"
|
|
uses: actions/checkout@v2
|
|
with:
|
|
ref: refs/heads/main
|
|
|
|
- name: Checkout code to lts-3.0
|
|
if: contains(github.event.release.tag_name, '-ee-lts')
|
|
uses: actions/checkout@v2
|
|
with:
|
|
ref: refs/heads/lts-3.0
|
|
|
|
# Create Docker Buildx builder with platform configuration
|
|
- name: Set up Docker Buildx
|
|
run: |
|
|
mkdir -p ~/.docker/cli-plugins
|
|
curl -SL https://github.com/docker/buildx/releases/download/v0.11.0/buildx-v0.11.0.linux-amd64 -o ~/.docker/cli-plugins/docker-buildx
|
|
chmod a+x ~/.docker/cli-plugins/docker-buildx
|
|
docker buildx create --name mybuilder --platform linux/arm64,linux/amd64,linux/amd64/v2,linux/riscv64,linux/ppc64le,linux/s390x,linux/386,linux/mips64le,linux/mips64,linux/arm/v7,linux/arm/v6
|
|
docker buildx use mybuilder
|
|
|
|
- name: Set DOCKER_CLI_EXPERIMENTAL
|
|
run: echo "DOCKER_CLI_EXPERIMENTAL=enabled" >> $GITHUB_ENV
|
|
|
|
- name: use mybuilder buildx
|
|
run: docker buildx use mybuilder
|
|
|
|
- name: Docker Login
|
|
uses: docker/login-action@v1
|
|
with:
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
- name: Check if Docker image is present
|
|
id: check-image-presence
|
|
run: |
|
|
response=$(curl -s "https://hub.docker.com/v2/repositories/tooljet/tooljet/tags/${{ github.event.release.tag_name }}")
|
|
if [[ $? -ne 0 ]]; then
|
|
echo "Failed to fetch JSON response. Stopping workflow execution."
|
|
exit 1
|
|
fi
|
|
|
|
if [[ $response == *"tag '${{ github.event.release.tag_name }}' not found"* ]]; then
|
|
echo "Docker image tag '${{ github.event.release.tag_name }}' not present."
|
|
exit 1
|
|
else
|
|
echo "Docker image tag '${{ github.event.release.tag_name }}' is present."
|
|
fi
|
|
|
|
- name: Build and Push Docker image for non-EE-LTS
|
|
if: "!contains(github.event.release.tag_name, '-ee-lts')"
|
|
uses: docker/build-push-action@v4
|
|
with:
|
|
context: .
|
|
file: docker/ee/ee-try-tooljet.Dockerfile
|
|
push: true
|
|
tags: tooljet/try:${{ github.event.release.tag_name }},tooljet/try:ee-latest
|
|
platforms: linux/amd64
|
|
env:
|
|
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
|
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
- name: Build and Push Docker image for EE-LTS-3.0
|
|
if: contains(github.event.release.tag_name, '-ee-lts')
|
|
uses: docker/build-push-action@v4
|
|
with:
|
|
context: .
|
|
file: docker/ee/ee-try-tooljet-lts.Dockerfile
|
|
push: true
|
|
tags: tooljet/try:${{ github.event.release.tag_name }},tooljet/try:ee-lts-latest
|
|
platforms: linux/amd64
|
|
env:
|
|
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
|
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
- name: Send Slack Notification
|
|
run: |
|
|
if [[ "${{ job.status }}" == "success" ]]; then
|
|
message="Try-ToolJet image published:\\n\`tooljet/try:${{ github.event.release.tag_name }}\`"
|
|
else
|
|
message="Job '${{ env.JOB_NAME }}' failed! tooljet/try:${{ github.event.release.tag_name }}"
|
|
fi
|
|
|
|
curl -X POST -H 'Content-type: application/json' --data "{\"text\":\"$message\"}" ${{ secrets.SLACK_WEBHOOK_URL }}
|