Skip to content

Commit

Permalink
ci: rollback docker image build
Browse files Browse the repository at this point in the history
  • Loading branch information
fhussonnois committed Jul 5, 2024
1 parent 6e4fc09 commit ff20b2d
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 36 deletions.
12 changes: 5 additions & 7 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,17 @@ jobs:
needs: [ plugins ]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
env:
DOCKER_APT_PACKAGES: python3 python3-venv python-is-python3 python3-pip nodejs npm curl zip unzip
DOCKER_PYTHON_LIBRARIES: kestra
strategy:
matrix:
image:
- name: ""
plugins: ""
packages: ""
python-libs: ""
plugins: ""
- name: "-full"
plugins: ${{needs.plugins.outputs.plugins}}
packages: $DOCKER_APT_PACKAGES
python-libs: $DOCKER_PYTHON_LIBRARIES
packages: python3 python3-venv python-is-python3 python3-pip nodejs npm curl zip unzip
python-libs: kestra
steps:
- uses: actions/checkout@v4

Expand All @@ -62,6 +59,7 @@ jobs:
run: |
TAG=${GITHUB_REF#refs/*/}
echo "tag=${TAG}" >> $GITHUB_OUTPUT
echo "plugins=${{ matrix.image.plugins }}" >> $GITHUB_OUTPUT
# Download release
- name: Download release
Expand Down Expand Up @@ -98,7 +96,7 @@ jobs:
tags: ${{ format('kestra/kestra:{0}{1}', steps.vars.outputs.tag, matrix.image.name) }}
platforms: linux/amd64,linux/arm64
build-args: |
KESTRA_PLUGINS=${{ matrix.image.plugins }}
KESTRA_PLUGINS=${{ steps.vars.outputs.plugins }}
APT_PACKAGES=${{ matrix.image.packages }}
PYTHON_LIBRARIES=${{ matrix.image.python-libs }}
Expand Down
52 changes: 23 additions & 29 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ jobs:
outputs:
docker-tag: ${{ steps.vars.outputs.tag }}
docker-artifact-name: ${{ steps.vars.outputs.artifact }}
plugins: ${{ steps.plugins-list.outputs.plugins }}
steps:
# Checkout
- uses: actions/checkout@v4
Expand Down Expand Up @@ -305,12 +306,13 @@ jobs:
matrix:
image:
- tag: ${{needs.build-artifacts.outputs.docker-tag}}
artifact-type: "exe"
artifact-name: "exe"
packages: ""
python-libraries: ""

- tag: ${{needs.build-artifacts.outputs.docker-tag}}-full
artifact-type: "docker"
artifact-name: ${{needs.build-artifacts.outputs.docker-artifact-name}}
plugins: ${{needs.build-artifacts.outputs.plugins}}
packages: python3 python3-venv python-is-python3 python3-pip nodejs npm curl zip unzip
python-libraries: kestra
steps:
- uses: actions/checkout@v4
# Docker setup
Expand All @@ -327,48 +329,40 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

# [EXE] Build Docker Image
# Vars
- name: Set image name
id: vars
run: |
TAG=${GITHUB_REF#refs/*/}
if [[ $TAG = "master" || $TAG == v* ]]; then
echo "plugins=${{ matrix.image.plugins }}" >> $GITHUB_OUTPUT
else
echo "plugins=--repositories=https://s01.oss.sonatype.org/content/repositories/snapshots ${{ matrix.image.plugins }}" >> $GITHUB_OUTPUT
fi
# Build Docker Image
- name: Download executable
if: matrix.image.artifact-type == 'exe'
uses: actions/download-artifact@v4
with:
name: ${{ matrix.image.artifact-name }}
name: exe
path: build/executable

- name: Copy exe to image
if: matrix.image.artifact-type == 'exe'
run: |
cp build/executable/* docker/app/kestra && chmod +x docker/app/kestra
# [EXE] Docker Build and push
# Docker Build and push
- name: Build Docker Image
uses: docker/build-push-action@v5
if: matrix.image.artifact-type == 'exe'
with:
context: .
push: true
tags: kestra/kestra:${{ matrix.image.tag }}
platforms: linux/amd64,linux/arm64
build-args: |
KESTRA_PLUGINS=
APT_PACKAGES=
PYTHON_LIBRARIES=
# [DOCKER] Download Docker Image
- name: Download Kestra Image
if: matrix.image.artifact-type == 'docker'
uses: actions/download-artifact@v4
with:
name: ${{ matrix.image.artifact-name }}
path: /tmp

# [DOCKER] Load & Push Docker Image
- name: Load & Push Kestra Image
if: matrix.image.artifact-type == 'docker'
run: |
docker load --input /tmp/${{ matrix.image.artifact-name }}.tar
docker image ls -a
docker push kestra/kestra:${{ matrix.image.tag }}
KESTRA_PLUGINS=${{ steps.vars.outputs.plugins }}
APT_PACKAGES=${{matrix.image.packages}}
PYTHON_LIBRARIES=${{matrix.image.python-libraries}}
maven:
name: Publish to Maven
Expand Down

0 comments on commit ff20b2d

Please sign in to comment.