From 4c4ce38fca70f87a1122fe6ead9ab68e1ed3bba2 Mon Sep 17 00:00:00 2001 From: MaxRayskiy Date: Mon, 11 Jul 2022 17:22:24 +0300 Subject: [PATCH] Upload containers with meshconv and python libs on MeshLib release --- .github/workflows/prepare-images.yml | 3 +- .github/workflows/update-app-container.yml | 56 ++++++++++++++++++++++ docker/app/fedora35Dockerfile | 12 +++++ docker/app/ubuntu20Dockerfile | 19 ++++++++ docker/app/ubuntu22Dockerfile | 19 ++++++++ 5 files changed, 108 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/update-app-container.yml create mode 100644 docker/app/fedora35Dockerfile create mode 100644 docker/app/ubuntu20Dockerfile create mode 100644 docker/app/ubuntu22Dockerfile diff --git a/.github/workflows/prepare-images.yml b/.github/workflows/prepare-images.yml index da7e71486730..ed4a8750c402 100644 --- a/.github/workflows/prepare-images.yml +++ b/.github/workflows/prepare-images.yml @@ -43,7 +43,8 @@ jobs: filters: | src: - '.github/workflows/docker-images.yml' - - 'docker/!(windowsDockerfile)' + - 'docker/ubuntu**' + - 'docker/fedora**' - 'requirements/!(windows.txt|macos.txt)' - 'scripts/build_thirdparty.sh' - 'scripts/install_**.sh' diff --git a/.github/workflows/update-app-container.yml b/.github/workflows/update-app-container.yml new file mode 100644 index 000000000000..6f2a2fee9f8d --- /dev/null +++ b/.github/workflows/update-app-container.yml @@ -0,0 +1,56 @@ +name: Update MeshLib app containers + +on: + release: + types: [ published ] + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + update-app-container: + runs-on: ubuntu-latest + strategy: + matrix: + os: [ Ubuntu-20, Ubuntu-22, Fedora-35 ] + include: + - os: Ubuntu-20 + image-tag: ubuntu20 + file-path-end: _ubuntu20-dev.deb + - os: Ubuntu-22 + image-tag: ubuntu22 + file-path-end: _ubuntu22-dev.deb + - os: Fedora-35 + image-tag: fedora35 + file-path-end: -dev.rpm + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Get latests release + id: get_release + uses: kaliber5/action-get-release@v1 + with: + token: ${{ secrets.BUILD_MACHINE_TOKEN }} + latest: true + + - name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: meshrus + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Set variables + id: set-vars + run: | + echo "::set-output name=file_name::meshlib_${{steps.get_release.outputs.tag_name }}${{matrix.file-path-end}}" + echo "::set-output name=file_url::https://github.com/MeshInspector/MeshLib/releases/download/${{ steps.get_release.outputs.tag_name }}/${{steps.set-vars.outputs.file_name}}" + + - name: Build and push + uses: docker/build-push-action@v3 + with: + file: ./docker/app/${{matrix.image-tag}}Dockerfile + push: true + tags: meshrus/meshlib-app-test:${{ matrix.image-tag }} + build-args: | + file_name=${{steps.set-vars.outputs.file_name}} + file_url=${{steps.set-vars.outputs.file_url}} diff --git a/docker/app/fedora35Dockerfile b/docker/app/fedora35Dockerfile new file mode 100644 index 000000000000..e1a418cf9fb0 --- /dev/null +++ b/docker/app/fedora35Dockerfile @@ -0,0 +1,12 @@ +ARG file_name +ARG file_url + +FROM fedora:35 AS build + +RUN dnf -y update && \ + dnf -y install sudo python3-pip wget && \ + dnf clean all + +RUN wget -O /tmp/${file_name} ${file_url} && \ + rpm -ivh /tmp/${file_name} && \ + rm /tmp/${file_name} diff --git a/docker/app/ubuntu20Dockerfile b/docker/app/ubuntu20Dockerfile new file mode 100644 index 000000000000..b98e278d4c06 --- /dev/null +++ b/docker/app/ubuntu20Dockerfile @@ -0,0 +1,19 @@ +ARG file_name +ARG file_url + +FROM ubuntu:20.04 + +# update and install req +RUN export DEBIAN_FRONTEND=noninteractive; \ + export DEBCONF_NONINTERACTIVE_SEEN=true; \ + echo 'tzdata tzdata/Areas select Etc' | debconf-set-selections; \ + echo 'tzdata tzdata/Zones/Etc select UTC' | debconf-set-selections; \ + apt-get update -qqy \ + && apt-get install -qqy --no-install-recommends \ + tzdata sudo python3-pip wget\ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +RUN wget -O /tmp/{file_name} ${file_url} && \ + dpkg -i /tmp/{file_name} && \ + rm /tmp/{file_name} diff --git a/docker/app/ubuntu22Dockerfile b/docker/app/ubuntu22Dockerfile new file mode 100644 index 000000000000..bd73d2703d91 --- /dev/null +++ b/docker/app/ubuntu22Dockerfile @@ -0,0 +1,19 @@ +ARG file_name +ARG file_url + +FROM ubuntu:22.04 + +# update and install req +RUN export DEBIAN_FRONTEND=noninteractive; \ + export DEBCONF_NONINTERACTIVE_SEEN=true; \ + echo 'tzdata tzdata/Areas select Etc' | debconf-set-selections; \ + echo 'tzdata tzdata/Zones/Etc select UTC' | debconf-set-selections; \ + apt-get update -qqy \ + && apt-get install -qqy --no-install-recommends \ + tzdata sudo python3-pip wget\ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +RUN wget -O /tmp/{file_name} ${file_url} && \ + dpkg -i /tmp/{file_name} && \ + rm /tmp/{file_name}