From 8b8bd79e23b19b314f65b0b4738011a1766a7fe5 Mon Sep 17 00:00:00 2001 From: Sergey Safarov Date: Wed, 19 Apr 2023 18:52:30 +0300 Subject: [PATCH 01/30] .github/workflows: added GitHub action script to build Alpine based docker image --- .github/workflows/alpine.yml | 47 ++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/alpine.yml diff --git a/.github/workflows/alpine.yml b/.github/workflows/alpine.yml new file mode 100644 index 00000000000..31b236790b7 --- /dev/null +++ b/.github/workflows/alpine.yml @@ -0,0 +1,47 @@ +--- +name: alpine docker image +on: + push: + branches: + - master + tags: + - '5.6.*' + - '5.5.*' + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: +permissions: + contents: read # to fetch code (actions/checkout) + +# This environments for backward compatability with build script for DockerHub +env: + DOCKER_REPO: kamailio/kamailio-ci + SOURCE_BRANCH: ${{ github.ref_name }} + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Compile Kamailio source + run: | + git submodule init + git submodule update + cd `pwd`/pkg/docker/alpine + ./hooks/pre_build || true + - name: Build the Docker images + run: | + cd `pwd`/pkg/docker/alpine + sudo chown -R ${USER}:${USER} `pwd` + ./hooks/build + - name: Login to Docker Hub + if: ${{ env.GITHUB_BASE_REF == '' }} + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Push images to DockerHub + if: ${{ env.GITHUB_BASE_REF == '' }} + run: | + cd `pwd`/pkg/docker/alpine + ./hooks/push + ./hooks/post_push From acccace4158182f73a21a2b65c635d4568057828 Mon Sep 17 00:00:00 2001 From: Sergey Safarov Date: Thu, 20 Apr 2023 15:15:10 +0300 Subject: [PATCH 02/30] minimzed githup actions --- .github/workflows/cifuzz.yml | 26 ------------- .github/workflows/codeql.yml | 62 ------------------------------ .github/workflows/main.yml | 41 -------------------- .github/workflows/pull_request.yml | 35 ----------------- 4 files changed, 164 deletions(-) delete mode 100644 .github/workflows/cifuzz.yml delete mode 100644 .github/workflows/codeql.yml delete mode 100644 .github/workflows/main.yml delete mode 100644 .github/workflows/pull_request.yml diff --git a/.github/workflows/cifuzz.yml b/.github/workflows/cifuzz.yml deleted file mode 100644 index 948ab18b888..00000000000 --- a/.github/workflows/cifuzz.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: CIFuzz -on: [pull_request] -jobs: - Fuzzing: - runs-on: ubuntu-latest - steps: - - name: Build Fuzzers - id: build - uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master - with: - oss-fuzz-project-name: 'kamailio' - dry-run: false - language: c - - name: Run Fuzzers - uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master - with: - oss-fuzz-project-name: 'kamailio' - fuzz-seconds: 600 - dry-run: false - language: c - - name: Upload Crash - uses: actions/upload-artifact@v1 - if: failure() && steps.build.outcome == 'success' - with: - name: artifacts - path: ./out/artifacts diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml deleted file mode 100644 index bc0eebfbe40..00000000000 --- a/.github/workflows/codeql.yml +++ /dev/null @@ -1,62 +0,0 @@ -name: "CodeQL" - -on: - push: - branches: [ "master", "3.1", "3.2", "3.3", "4.0", "4.1", "4.2", "4.3", "4.4", "5.0", "5.1", "5.2", "5.3", "5.4", "5.5", "5.6" ] - pull_request: - branches: [ "master" ] - schedule: - - cron: "35 19 * * 3" - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: - language: [ javascript, cpp, python ] - - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - submodules: recursive - - - name: Install Packages (cpp) - if: ${{ matrix.language == 'cpp' }} - run: | - sudo apt-get update - sudo apt-get install --yes bison default-libmysqlclient-dev flex libcurl4-openssl-dev libjansson-dev libhiredis-dev libevent-dev liblua5.1-0-dev libpcre3-dev libncurses5-dev libpq-dev libreadline-dev libssl-dev libunistring-dev libxml2-dev pkg-config python3 python3-dev uuid-dev zlib1g-dev - - - name: Configure (cpp) - if: ${{ matrix.language == 'cpp' }} - run: make include_modules='app_lua app_python3 cnxcc db_mysql db_postgres db_redis dialplan http_client jansson lcr ndb_redis presence presence_xml presence_dialoginfo pua pua_dialoginfo topos_redis uuid websocket xmlops' cfg - - - name: After Prepare (cpp) - if: ${{ matrix.language == 'cpp' }} - run: export PKG_CONFIG_PATH=$RUNNER_TEMP/usr/lib/pkgconfig:$PKG_CONFIG_PATH && echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH" >> $GITHUB_ENV - - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: ${{ matrix.language }} - queries: +security-and-quality - - - name: Autobuild - uses: github/codeql-action/autobuild@v2 - if: ${{ matrix.language == 'javascript' || matrix.language == 'python' }} - - - name: Build cpp - if: ${{ matrix.language == 'cpp' }} - run: make all - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 - with: - category: "/language:${{ matrix.language }}" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index 71b9d6c5480..00000000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,41 +0,0 @@ ---- -name: build -'on': - push: - branches: - - master - - '5.6' - - '5.5' - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: -permissions: - contents: read # to fetch code (actions/checkout) -jobs: - build: - runs-on: ubuntu-latest - container: - image: ghcr.io/kamailio/pkg-kamailio-docker:${{ github.ref_name }}-${{ matrix.distribution }} - volumes: - - ${{ github.workspace }}:/code - env: - DIST: ${{ matrix.distribution }} - CC: ${{ matrix.compilier }} - strategy: - matrix: - include: - - distribution: bullseye - compilier: gcc - - distribution: bullseye - compilier: clang - - distribution: sid - compilier: gcc - - distribution: sid - compilier: clang - steps: - - uses: actions/checkout@v2 - - uses: ammaraskar/gcc-problem-matcher@0.2.0 - - name: build - run: | - cd /code - ./test/travis/build_travis.sh - shell: bash diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml deleted file mode 100644 index e2f6416ce42..00000000000 --- a/.github/workflows/pull_request.yml +++ /dev/null @@ -1,35 +0,0 @@ ---- -name: checks_pr -'on': - pull_request: - branches: - - master - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: -permissions: - contents: read # to fetch code (actions/checkout) -jobs: - build: - runs-on: ubuntu-latest - container: - image: kamailio/pkg-kamailio-docker:master-${{ matrix.distribution }} - volumes: - - ${{ github.workspace }}:/code - env: - DIST: ${{ matrix.distribution }} - CC: ${{ matrix.compilier }} - strategy: - matrix: - include: - - distribution: bullseye - compilier: gcc - - distribution: bullseye - compilier: clang - steps: - - uses: actions/checkout@v2 - - uses: ammaraskar/gcc-problem-matcher@0.1 - - name: build - run: | - cd /code - ./test/travis/build_travis.sh - shell: bash From 38e6b220a18231b87d4a9fe2dcb11a38cc536e11 Mon Sep 17 00:00:00 2001 From: Sergey Safarov Date: Thu, 20 Apr 2023 16:15:16 +0300 Subject: [PATCH 03/30] actions update --- .github/workflows/alpine.yml | 72 +++++++++++++++++++++++++++--------- 1 file changed, 54 insertions(+), 18 deletions(-) diff --git a/.github/workflows/alpine.yml b/.github/workflows/alpine.yml index 31b236790b7..6c91b64100f 100644 --- a/.github/workflows/alpine.yml +++ b/.github/workflows/alpine.yml @@ -3,17 +3,14 @@ name: alpine docker image on: push: branches: - - master + - master tags: - - '5.6.*' - - '5.5.*' - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: -permissions: - contents: read # to fetch code (actions/checkout) + - '5.6.*' + - '5.7.*' # This environments for backward compatability with build script for DockerHub env: + IMAGE_NAME: kamailio-ci DOCKER_REPO: kamailio/kamailio-ci SOURCE_BRANCH: ${{ github.ref_name }} @@ -22,26 +19,65 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + + - name: Login to GitHub Container Registry + if: ${{ env.GITHUB_BASE_REF == '' }} + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Compile Kamailio source run: | git submodule init git submodule update cd `pwd`/pkg/docker/alpine ./hooks/pre_build || true + - name: Build the Docker images run: | cd `pwd`/pkg/docker/alpine sudo chown -R ${USER}:${USER} `pwd` ./hooks/build - - name: Login to Docker Hub - if: ${{ env.GITHUB_BASE_REF == '' }} - uses: docker/login-action@v2 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v4 with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Push images to DockerHub - if: ${{ env.GITHUB_BASE_REF == '' }} - run: | - cd `pwd`/pkg/docker/alpine - ./hooks/push - ./hooks/post_push + # list of Docker images to use as base name for tags + images: | + ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }} + # generate Docker tags based on the following events/attributes + tags: | + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + type=ref,event=branch + + - name: Build and push minimal + uses: docker/build-push-action@v4 + with: + context: pkg/docker/alpine + file: Dockerfile + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + + - name: Build and push with apk + uses: docker/build-push-action@v4 + with: + context: pkg/docker/alpine + file: Dockerfile.alpine + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + + - name: Build and push with debug + uses: docker/build-push-action@v4 + with: + context: pkg/docker/alpine + file: Dockerfile.debug + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} From fbce6d85abbf11631d5f42983e6533fd1ef0283b Mon Sep 17 00:00:00 2001 From: Sergey Safarov Date: Thu, 20 Apr 2023 17:10:40 +0300 Subject: [PATCH 04/30] updated Dockerfile location and tag generation --- .github/workflows/alpine.yml | 62 +++++++++++++++++++++++++++--------- 1 file changed, 47 insertions(+), 15 deletions(-) diff --git a/.github/workflows/alpine.yml b/.github/workflows/alpine.yml index 6c91b64100f..20824796c3e 100644 --- a/.github/workflows/alpine.yml +++ b/.github/workflows/alpine.yml @@ -20,14 +20,6 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Login to GitHub Container Registry - if: ${{ env.GITHUB_BASE_REF == '' }} - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Compile Kamailio source run: | git submodule init @@ -55,11 +47,51 @@ jobs: type=semver,pattern={{major}} type=ref,event=branch + - name: Docker meta alpine + id: meta-alpine + uses: docker/metadata-action@v4 + with: + # list of Docker images to use as base name for tags + images: | + ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }} + # generate Docker tags based on the following events/attributes + tags: | + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + type=ref,event=branch-alpine + flavor: | + suffix=-alpine + + - name: Docker meta debug + id: meta-debug + uses: docker/metadata-action@v4 + with: + # list of Docker images to use as base name for tags + images: | + ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }} + # generate Docker tags based on the following events/attributes + tags: | + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + type=ref,event=branch-alpine + flavor: | + suffix=-debug + + - name: Login to GitHub Container Registry + if: ${{ github.event_name != 'pull_request' }} + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and push minimal uses: docker/build-push-action@v4 with: context: pkg/docker/alpine - file: Dockerfile + file: pkg/docker/alpine/Dockerfile push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} @@ -68,16 +100,16 @@ jobs: uses: docker/build-push-action@v4 with: context: pkg/docker/alpine - file: Dockerfile.alpine + file: {context}/Dockerfile.alpine push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} + tags: ${{ steps.meta-alpine.outputs.tags }} + labels: ${{ steps.meta-alpine.outputs.labels }} - name: Build and push with debug uses: docker/build-push-action@v4 with: context: pkg/docker/alpine - file: Dockerfile.debug + file: {context}/Dockerfile.debug push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} + tags: ${{ steps.meta-debug.outputs.tags }} + labels: ${{ steps.meta-debug.outputs.labels }} From 6e416c43c6e9c3a16141fc796006160595cae1ac Mon Sep 17 00:00:00 2001 From: Sergey Safarov Date: Thu, 20 Apr 2023 17:24:00 +0300 Subject: [PATCH 05/30] removed {context} macro --- .github/workflows/alpine.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/alpine.yml b/.github/workflows/alpine.yml index 20824796c3e..cd3d45f7ca3 100644 --- a/.github/workflows/alpine.yml +++ b/.github/workflows/alpine.yml @@ -27,7 +27,7 @@ jobs: cd `pwd`/pkg/docker/alpine ./hooks/pre_build || true - - name: Build the Docker images + - name: Build image archives and apk files run: | cd `pwd`/pkg/docker/alpine sudo chown -R ${USER}:${USER} `pwd` @@ -100,7 +100,7 @@ jobs: uses: docker/build-push-action@v4 with: context: pkg/docker/alpine - file: {context}/Dockerfile.alpine + file: pkg/docker//Dockerfile.alpine push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta-alpine.outputs.tags }} labels: ${{ steps.meta-alpine.outputs.labels }} @@ -109,7 +109,7 @@ jobs: uses: docker/build-push-action@v4 with: context: pkg/docker/alpine - file: {context}/Dockerfile.debug + file: pkg/docker//Dockerfile.debug push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta-debug.outputs.tags }} labels: ${{ steps.meta-debug.outputs.labels }} From e887874c58fcc79e23969606dcd732cc1404f460 Mon Sep 17 00:00:00 2001 From: Sergey Safarov Date: Thu, 20 Apr 2023 17:45:06 +0300 Subject: [PATCH 06/30] replaced type=semver by type=pep440 --- .github/workflows/alpine.yml | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/.github/workflows/alpine.yml b/.github/workflows/alpine.yml index cd3d45f7ca3..08ff4e2e640 100644 --- a/.github/workflows/alpine.yml +++ b/.github/workflows/alpine.yml @@ -11,7 +11,6 @@ on: # This environments for backward compatability with build script for DockerHub env: IMAGE_NAME: kamailio-ci - DOCKER_REPO: kamailio/kamailio-ci SOURCE_BRANCH: ${{ github.ref_name }} jobs: @@ -42,9 +41,9 @@ jobs: ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }} # generate Docker tags based on the following events/attributes tags: | - type=semver,pattern={{version}} - type=semver,pattern={{major}}.{{minor}} - type=semver,pattern={{major}} + type=pep440,pattern={{version}} + type=pep440,pattern={{major}}.{{minor}} + type=pep440,pattern={{major}} type=ref,event=branch - name: Docker meta alpine @@ -56,10 +55,10 @@ jobs: ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }} # generate Docker tags based on the following events/attributes tags: | - type=semver,pattern={{version}} - type=semver,pattern={{major}}.{{minor}} - type=semver,pattern={{major}} - type=ref,event=branch-alpine + type=pep440,pattern={{version}} + type=pep440,pattern={{major}}.{{minor}} + type=pep440,pattern={{major}} + type=ref,event=branch flavor: | suffix=-alpine @@ -72,10 +71,10 @@ jobs: ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }} # generate Docker tags based on the following events/attributes tags: | - type=semver,pattern={{version}} - type=semver,pattern={{major}}.{{minor}} - type=semver,pattern={{major}} - type=ref,event=branch-alpine + type=pep440,pattern={{version}} + type=pep440,pattern={{major}}.{{minor}} + type=pep440,pattern={{major}} + type=ref,event=branch flavor: | suffix=-debug From 53c3e0d10e3127dbf4bef2245eb73d7752e50af6 Mon Sep 17 00:00:00 2001 From: Sergey Safarov Date: Fri, 21 Apr 2023 00:01:00 +0300 Subject: [PATCH 07/30] WIP 1 --- .github/workflows/alpine.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/alpine.yml b/.github/workflows/alpine.yml index 08ff4e2e640..e5af471529a 100644 --- a/.github/workflows/alpine.yml +++ b/.github/workflows/alpine.yml @@ -19,6 +19,20 @@ jobs: steps: - uses: actions/checkout@v3 + - name: test + run: | + git submodule init + git submodule update + tar cz -C pkg/docker/alpine -f kamailio_img.tar.gz Dockerfile + + - name: Build and push minimal + uses: docker/build-push-action@v4 + with: + context: pkg/docker/alpine + file: Dockerfile + push: false + tags: master + - name: Compile Kamailio source run: | git submodule init @@ -99,7 +113,7 @@ jobs: uses: docker/build-push-action@v4 with: context: pkg/docker/alpine - file: pkg/docker//Dockerfile.alpine + file: pkg/docker/Dockerfile.alpine push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta-alpine.outputs.tags }} labels: ${{ steps.meta-alpine.outputs.labels }} @@ -108,7 +122,7 @@ jobs: uses: docker/build-push-action@v4 with: context: pkg/docker/alpine - file: pkg/docker//Dockerfile.debug + file: pkg/docker/Dockerfile.debug push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta-debug.outputs.tags }} labels: ${{ steps.meta-debug.outputs.labels }} From 9c6894fdb690d3b0fa1b44d6cffd3be656f95882 Mon Sep 17 00:00:00 2001 From: Sergey Safarov Date: Fri, 21 Apr 2023 00:06:49 +0300 Subject: [PATCH 08/30] WIP 2 --- .github/workflows/alpine.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/alpine.yml b/.github/workflows/alpine.yml index e5af471529a..3b3dd87fcb4 100644 --- a/.github/workflows/alpine.yml +++ b/.github/workflows/alpine.yml @@ -24,6 +24,8 @@ jobs: git submodule init git submodule update tar cz -C pkg/docker/alpine -f kamailio_img.tar.gz Dockerfile + pwd + find pkg/docker/alpine - name: Build and push minimal uses: docker/build-push-action@v4 From ea207e5313e5414b5cbffec01501af01fa4b4246 Mon Sep 17 00:00:00 2001 From: Sergey Safarov Date: Fri, 21 Apr 2023 00:20:31 +0300 Subject: [PATCH 09/30] WIP 3 --- .github/workflows/alpine.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/alpine.yml b/.github/workflows/alpine.yml index 3b3dd87fcb4..f853d938e7b 100644 --- a/.github/workflows/alpine.yml +++ b/.github/workflows/alpine.yml @@ -23,9 +23,11 @@ jobs: run: | git submodule init git submodule update - tar cz -C pkg/docker/alpine -f kamailio_img.tar.gz Dockerfile + echo tar cz -C pkg/docker/alpine -f kamailio_img.tar.gz Dockerfile + tar cz -f pkg/docker/alpine/kamailio_img.tar.gz pkg/docker/alpine/Dockerfile pwd find pkg/docker/alpine + /usr/bin/docker buildx build --file Dockerfile pkg/docker/alpine - name: Build and push minimal uses: docker/build-push-action@v4 From e10ef653f1c95067f2438acb4f1320f17c9d6c9d Mon Sep 17 00:00:00 2001 From: Sergey Safarov Date: Fri, 21 Apr 2023 00:24:48 +0300 Subject: [PATCH 10/30] WIP 4 --- .github/workflows/alpine.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/alpine.yml b/.github/workflows/alpine.yml index f853d938e7b..71813218c53 100644 --- a/.github/workflows/alpine.yml +++ b/.github/workflows/alpine.yml @@ -27,7 +27,10 @@ jobs: tar cz -f pkg/docker/alpine/kamailio_img.tar.gz pkg/docker/alpine/Dockerfile pwd find pkg/docker/alpine - /usr/bin/docker buildx build --file Dockerfile pkg/docker/alpine + cp -R pkg/docker/alpine/* . + /usr/bin/docker buildx build . + /usr/bin/docker buildx build --file Dockerfile . + echo /usr/bin/docker buildx build --file Dockerfile pkg/docker/alpine - name: Build and push minimal uses: docker/build-push-action@v4 From 06f78d5c2b636da77bd3459a6c2118df19e611f8 Mon Sep 17 00:00:00 2001 From: Sergey Safarov Date: Fri, 21 Apr 2023 00:27:46 +0300 Subject: [PATCH 11/30] WIP 5 --- .github/workflows/alpine.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/alpine.yml b/.github/workflows/alpine.yml index 71813218c53..a0d9f02a91d 100644 --- a/.github/workflows/alpine.yml +++ b/.github/workflows/alpine.yml @@ -23,14 +23,14 @@ jobs: run: | git submodule init git submodule update - echo tar cz -C pkg/docker/alpine -f kamailio_img.tar.gz Dockerfile - tar cz -f pkg/docker/alpine/kamailio_img.tar.gz pkg/docker/alpine/Dockerfile + tar cz -C ./pkg/docker/alpine -f kamailio_img.tar.gz Dockerfile + #tar cz -f pkg/docker/alpine/kamailio_img.tar.gz pkg/docker/alpine/Dockerfile pwd find pkg/docker/alpine cp -R pkg/docker/alpine/* . - /usr/bin/docker buildx build . - /usr/bin/docker buildx build --file Dockerfile . - echo /usr/bin/docker buildx build --file Dockerfile pkg/docker/alpine + #/usr/bin/docker buildx build . + #/usr/bin/docker buildx build --file Dockerfile . + /usr/bin/docker buildx build --file Dockerfile ./pkg/docker/alpine - name: Build and push minimal uses: docker/build-push-action@v4 From 43b7564e30ab3802d0919de13b21be8047afec85 Mon Sep 17 00:00:00 2001 From: Sergey Safarov Date: Fri, 21 Apr 2023 00:31:19 +0300 Subject: [PATCH 12/30] WIP 6 --- .github/workflows/alpine.yml | 29 ++++------------------------- 1 file changed, 4 insertions(+), 25 deletions(-) diff --git a/.github/workflows/alpine.yml b/.github/workflows/alpine.yml index a0d9f02a91d..68d19d315b0 100644 --- a/.github/workflows/alpine.yml +++ b/.github/workflows/alpine.yml @@ -19,27 +19,6 @@ jobs: steps: - uses: actions/checkout@v3 - - name: test - run: | - git submodule init - git submodule update - tar cz -C ./pkg/docker/alpine -f kamailio_img.tar.gz Dockerfile - #tar cz -f pkg/docker/alpine/kamailio_img.tar.gz pkg/docker/alpine/Dockerfile - pwd - find pkg/docker/alpine - cp -R pkg/docker/alpine/* . - #/usr/bin/docker buildx build . - #/usr/bin/docker buildx build --file Dockerfile . - /usr/bin/docker buildx build --file Dockerfile ./pkg/docker/alpine - - - name: Build and push minimal - uses: docker/build-push-action@v4 - with: - context: pkg/docker/alpine - file: Dockerfile - push: false - tags: master - - name: Compile Kamailio source run: | git submodule init @@ -110,8 +89,8 @@ jobs: - name: Build and push minimal uses: docker/build-push-action@v4 with: - context: pkg/docker/alpine - file: pkg/docker/alpine/Dockerfile + context: ./pkg/docker/alpine + file: Dockerfile push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} @@ -120,7 +99,7 @@ jobs: uses: docker/build-push-action@v4 with: context: pkg/docker/alpine - file: pkg/docker/Dockerfile.alpine + file: Dockerfile.alpine push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta-alpine.outputs.tags }} labels: ${{ steps.meta-alpine.outputs.labels }} @@ -129,7 +108,7 @@ jobs: uses: docker/build-push-action@v4 with: context: pkg/docker/alpine - file: pkg/docker/Dockerfile.debug + file: Dockerfile.debug push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta-debug.outputs.tags }} labels: ${{ steps.meta-debug.outputs.labels }} From 2f63d68bc8995ef6eff6a3a022bf99913afbc16d Mon Sep 17 00:00:00 2001 From: Sergey Safarov Date: Fri, 21 Apr 2023 07:48:49 +0300 Subject: [PATCH 13/30] WIP 7 --- .github/workflows/alpine.yml | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/.github/workflows/alpine.yml b/.github/workflows/alpine.yml index 68d19d315b0..3b26c963a52 100644 --- a/.github/workflows/alpine.yml +++ b/.github/workflows/alpine.yml @@ -26,6 +26,32 @@ jobs: cd `pwd`/pkg/docker/alpine ./hooks/pre_build || true + - name: test + run: | + #git submodule init + #git submodule update + #tar cz -C ./pkg/docker/alpine -f kamailio_img.tar.gz Dockerfile + #tar cz -f pkg/docker/alpine/kamailio_img.tar.gz pkg/docker/alpine/Dockerfile + pwd + find pkg/docker/alpine + #cp -R pkg/docker/alpine/* . + #/usr/bin/docker buildx build . + #/usr/bin/docker buildx build --file Dockerfile . + /usr/bin/docker buildx build --file Dockerfile ./pkg/docker/alpine || true + cp -R pkg/docker/alpine/* . + /usr/bin/docker buildx build --file Dockerfile.alpine . || true + cd pkg/docker/alpine + /usr/bin/docker buildx build --file Dockerfile.alpine . || true + + + - name: Build and push minimal + uses: docker/build-push-action@v4 + with: + context: pkg/docker/alpine + file: Dockerfile + push: false + tags: master + - name: Build image archives and apk files run: | cd `pwd`/pkg/docker/alpine @@ -45,6 +71,8 @@ jobs: type=pep440,pattern={{major}}.{{minor}} type=pep440,pattern={{major}} type=ref,event=branch + flavor: | + suffix= - name: Docker meta alpine id: meta-alpine @@ -98,7 +126,7 @@ jobs: - name: Build and push with apk uses: docker/build-push-action@v4 with: - context: pkg/docker/alpine + context: ./pkg/docker/alpine file: Dockerfile.alpine push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta-alpine.outputs.tags }} @@ -107,7 +135,7 @@ jobs: - name: Build and push with debug uses: docker/build-push-action@v4 with: - context: pkg/docker/alpine + context: ./pkg/docker/alpine file: Dockerfile.debug push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta-debug.outputs.tags }} From 3d2e05792f6a295ab738250536d85f191c74755e Mon Sep 17 00:00:00 2001 From: Sergey Safarov Date: Fri, 21 Apr 2023 08:31:15 +0300 Subject: [PATCH 14/30] WIP 8 --- .github/workflows/alpine.yml | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/.github/workflows/alpine.yml b/.github/workflows/alpine.yml index 3b26c963a52..4e048761edb 100644 --- a/.github/workflows/alpine.yml +++ b/.github/workflows/alpine.yml @@ -23,6 +23,7 @@ jobs: run: | git submodule init git submodule update + /usr/bin/docker buildx build --file Dockerfile ${{ github.workspace }}/pkg/docker/alpine || true cd `pwd`/pkg/docker/alpine ./hooks/pre_build || true @@ -34,20 +35,18 @@ jobs: #tar cz -f pkg/docker/alpine/kamailio_img.tar.gz pkg/docker/alpine/Dockerfile pwd find pkg/docker/alpine - #cp -R pkg/docker/alpine/* . + sudo chown -R ${USER}:${USER} `pwd` + cp -R pkg/docker/alpine/* . | true #/usr/bin/docker buildx build . - #/usr/bin/docker buildx build --file Dockerfile . - /usr/bin/docker buildx build --file Dockerfile ./pkg/docker/alpine || true - cp -R pkg/docker/alpine/* . - /usr/bin/docker buildx build --file Dockerfile.alpine . || true - cd pkg/docker/alpine - /usr/bin/docker buildx build --file Dockerfile.alpine . || true - + /usr/bin/docker buildx build --file Dockerfile . | true + /usr/bin/docker buildx build --file Dockerfile ${{ github.workspace }}/pkg/docker/alpine || true + ls -l pkg/docker/alpine + /usr/bin/docker buildx build --file Dockerfile.alpine ${{ github.workspace }}/pkg/docker/alpine || true - name: Build and push minimal uses: docker/build-push-action@v4 with: - context: pkg/docker/alpine + context: ${{ github.workspace }}/pkg/docker/alpine file: Dockerfile push: false tags: master @@ -117,7 +116,7 @@ jobs: - name: Build and push minimal uses: docker/build-push-action@v4 with: - context: ./pkg/docker/alpine + context: ${{ github.workspace }}/pkg/docker/alpine file: Dockerfile push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} @@ -126,7 +125,7 @@ jobs: - name: Build and push with apk uses: docker/build-push-action@v4 with: - context: ./pkg/docker/alpine + context: ${{ github.workspace }}/pkg/docker/alpine file: Dockerfile.alpine push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta-alpine.outputs.tags }} @@ -135,7 +134,7 @@ jobs: - name: Build and push with debug uses: docker/build-push-action@v4 with: - context: ./pkg/docker/alpine + context: ${{ github.workspace }}/pkg/docker/alpine file: Dockerfile.debug push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta-debug.outputs.tags }} From 6cc81d24a5a5c76b2bafffb361f9008c841de9a1 Mon Sep 17 00:00:00 2001 From: Sergey Safarov Date: Fri, 21 Apr 2023 08:51:23 +0300 Subject: [PATCH 15/30] WIP 8 --- .github/workflows/alpine.yml | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/alpine.yml b/.github/workflows/alpine.yml index 4e048761edb..bc950141b9d 100644 --- a/.github/workflows/alpine.yml +++ b/.github/workflows/alpine.yml @@ -23,8 +23,8 @@ jobs: run: | git submodule init git submodule update - /usr/bin/docker buildx build --file Dockerfile ${{ github.workspace }}/pkg/docker/alpine || true - cd `pwd`/pkg/docker/alpine + /usr/bin/docker buildx build --file pkg/docker/alpine/Dockerfile pkg/docker/alpine || true + cd pkg/docker/alpine ./hooks/pre_build || true - name: test @@ -38,22 +38,22 @@ jobs: sudo chown -R ${USER}:${USER} `pwd` cp -R pkg/docker/alpine/* . | true #/usr/bin/docker buildx build . - /usr/bin/docker buildx build --file Dockerfile . | true - /usr/bin/docker buildx build --file Dockerfile ${{ github.workspace }}/pkg/docker/alpine || true + /usr/bin/docker buildx build --file pkg/docker/alpine/Dockerfile . | true + /usr/bin/docker buildx build --file pkg/docker/alpine/Dockerfilepkg/docker/alpine || true ls -l pkg/docker/alpine - /usr/bin/docker buildx build --file Dockerfile.alpine ${{ github.workspace }}/pkg/docker/alpine || true + /usr/bin/docker buildx build --file pkg/docker/alpine/Dockerfile.alpine pkg/docker/alpine || true - name: Build and push minimal uses: docker/build-push-action@v4 with: - context: ${{ github.workspace }}/pkg/docker/alpine - file: Dockerfile + context: pkg/docker/alpine + file: pkg/docker/alpine/Dockerfile push: false tags: master - name: Build image archives and apk files run: | - cd `pwd`/pkg/docker/alpine + cd pkg/docker/alpine sudo chown -R ${USER}:${USER} `pwd` ./hooks/build @@ -116,8 +116,8 @@ jobs: - name: Build and push minimal uses: docker/build-push-action@v4 with: - context: ${{ github.workspace }}/pkg/docker/alpine - file: Dockerfile + context: pkg/docker/alpine + file: pkg/docker/alpine/Dockerfile push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} @@ -125,8 +125,8 @@ jobs: - name: Build and push with apk uses: docker/build-push-action@v4 with: - context: ${{ github.workspace }}/pkg/docker/alpine - file: Dockerfile.alpine + context: pkg/docker/alpine + file: pkg/docker/alpine/Dockerfile.alpine push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta-alpine.outputs.tags }} labels: ${{ steps.meta-alpine.outputs.labels }} @@ -134,8 +134,8 @@ jobs: - name: Build and push with debug uses: docker/build-push-action@v4 with: - context: ${{ github.workspace }}/pkg/docker/alpine - file: Dockerfile.debug + context: pkg/docker/alpine + file: pkg/docker/alpine/Dockerfile.debug push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta-debug.outputs.tags }} labels: ${{ steps.meta-debug.outputs.labels }} From e498fa786f78efadd2e0651df3890c85d4d8b50d Mon Sep 17 00:00:00 2001 From: Sergey Safarov Date: Fri, 21 Apr 2023 09:31:42 +0300 Subject: [PATCH 16/30] WIP 9 --- .github/workflows/alpine.yml | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/.github/workflows/alpine.yml b/.github/workflows/alpine.yml index bc950141b9d..670017a1b24 100644 --- a/.github/workflows/alpine.yml +++ b/.github/workflows/alpine.yml @@ -23,39 +23,21 @@ jobs: run: | git submodule init git submodule update - /usr/bin/docker buildx build --file pkg/docker/alpine/Dockerfile pkg/docker/alpine || true cd pkg/docker/alpine ./hooks/pre_build || true - name: test run: | - #git submodule init - #git submodule update - #tar cz -C ./pkg/docker/alpine -f kamailio_img.tar.gz Dockerfile - #tar cz -f pkg/docker/alpine/kamailio_img.tar.gz pkg/docker/alpine/Dockerfile pwd find pkg/docker/alpine sudo chown -R ${USER}:${USER} `pwd` - cp -R pkg/docker/alpine/* . | true - #/usr/bin/docker buildx build . - /usr/bin/docker buildx build --file pkg/docker/alpine/Dockerfile . | true - /usr/bin/docker buildx build --file pkg/docker/alpine/Dockerfilepkg/docker/alpine || true - ls -l pkg/docker/alpine - /usr/bin/docker buildx build --file pkg/docker/alpine/Dockerfile.alpine pkg/docker/alpine || true - - - name: Build and push minimal - uses: docker/build-push-action@v4 - with: - context: pkg/docker/alpine - file: pkg/docker/alpine/Dockerfile - push: false - tags: master - name: Build image archives and apk files run: | cd pkg/docker/alpine sudo chown -R ${USER}:${USER} `pwd` - ./hooks/build + mv kamailio_min.tar.gz.without_os_files kamailio_min-without_os_files.tar.gz + # ./hooks/build - name: Docker meta id: meta From 61c7511e89cc24bc4319af0dd38b33ec6c7c1c1d Mon Sep 17 00:00:00 2001 From: Sergey Safarov Date: Fri, 21 Apr 2023 11:02:10 +0300 Subject: [PATCH 17/30] WIP 10 --- .github/workflows/alpine.yml | 38 ++++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/.github/workflows/alpine.yml b/.github/workflows/alpine.yml index 670017a1b24..a32b3289150 100644 --- a/.github/workflows/alpine.yml +++ b/.github/workflows/alpine.yml @@ -26,19 +26,6 @@ jobs: cd pkg/docker/alpine ./hooks/pre_build || true - - name: test - run: | - pwd - find pkg/docker/alpine - sudo chown -R ${USER}:${USER} `pwd` - - - name: Build image archives and apk files - run: | - cd pkg/docker/alpine - sudo chown -R ${USER}:${USER} `pwd` - mv kamailio_min.tar.gz.without_os_files kamailio_min-without_os_files.tar.gz - # ./hooks/build - - name: Docker meta id: meta uses: docker/metadata-action@v4 @@ -104,6 +91,13 @@ jobs: tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} + - name: deporal workarround + run: | + sudo chown -R ${USER}:${USER} ${{ github.workspace }}/pkg/docker/alpine + cd pkg/docker/alpine + mv kamailio_min.tar.gz.without_os_files kamailio_min-without_os_files.tar.gz + ls -l . + - name: Build and push with apk uses: docker/build-push-action@v4 with: @@ -113,6 +107,18 @@ jobs: tags: ${{ steps.meta-alpine.outputs.tags }} labels: ${{ steps.meta-alpine.outputs.labels }} + - name: Prepare local repo + run: | + docker network create kamailio-build + docker run \ + --detach \ + --network kamailio-build \ + --name local-repo \ + --hostname local-repo \ + --rm=true \ + --volume=${{ github.workspace }}/apk_files:/usr/share/nginx/html:ro \ + nginx + - name: Build and push with debug uses: docker/build-push-action@v4 with: @@ -121,3 +127,9 @@ jobs: push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta-debug.outputs.tags }} labels: ${{ steps.meta-debug.outputs.labels }} + + - name: Cleanup + run: | + docker stop local-repo + docker network rm kamailio-build + rm -Rf ${{ github.workspace }}/* From 8f0b3ee563241838c2cbdf8d1c9d6e8ca25cee6c Mon Sep 17 00:00:00 2001 From: Sergey Safarov Date: Fri, 21 Apr 2023 11:23:45 +0300 Subject: [PATCH 18/30] WIP 12 --- .github/workflows/alpine.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/alpine.yml b/.github/workflows/alpine.yml index a32b3289150..a6ab11e1b88 100644 --- a/.github/workflows/alpine.yml +++ b/.github/workflows/alpine.yml @@ -42,7 +42,7 @@ jobs: flavor: | suffix= - - name: Docker meta alpine + - name: Docker meta "-alpine" id: meta-alpine uses: docker/metadata-action@v4 with: @@ -58,7 +58,7 @@ jobs: flavor: | suffix=-alpine - - name: Docker meta debug + - name: Docker meta "-debug" id: meta-debug uses: docker/metadata-action@v4 with: @@ -91,7 +91,7 @@ jobs: tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - - name: deporal workarround + - name: temporal workarround run: | sudo chown -R ${USER}:${USER} ${{ github.workspace }}/pkg/docker/alpine cd pkg/docker/alpine @@ -124,12 +124,12 @@ jobs: with: context: pkg/docker/alpine file: pkg/docker/alpine/Dockerfile.debug + network: local-repo push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta-debug.outputs.tags }} labels: ${{ steps.meta-debug.outputs.labels }} - - name: Cleanup + - name: Delete local repo run: | docker stop local-repo docker network rm kamailio-build - rm -Rf ${{ github.workspace }}/* From d22f7824f8de6556711dfb0c7f6f75c8f3a74e32 Mon Sep 17 00:00:00 2001 From: Sergey Safarov Date: Fri, 21 Apr 2023 12:06:33 +0300 Subject: [PATCH 19/30] WIP13 --- .github/workflows/alpine.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/alpine.yml b/.github/workflows/alpine.yml index a6ab11e1b88..0f670947af2 100644 --- a/.github/workflows/alpine.yml +++ b/.github/workflows/alpine.yml @@ -19,11 +19,25 @@ jobs: steps: - uses: actions/checkout@v3 + - name: Prepare local repo + run: | + docker network create kamailio-build + + - name: local-repo + uses: docker/setup-buildx-action@v2 + use: true + with: + driver-opts: | + network=kamailio-build + - name: Compile Kamailio source run: | git submodule init git submodule update cd pkg/docker/alpine + sudo chown -R ${USER}:${USER} ${{ github.workspace }}/pkg/docker/alpine + sed -i -e 's/3.12/3.17/' ${{ github.workspace }}/pkg/docker/alpine/Dockerfile*/* + sed -i -e 's/3.12/3.17/' ${{ github.workspace }}/pkg/docker/alpine/hooks/pre_build/* ./hooks/pre_build || true - name: Docker meta @@ -109,7 +123,7 @@ jobs: - name: Prepare local repo run: | - docker network create kamailio-build + #docker network create kamailio-build docker run \ --detach \ --network kamailio-build \ @@ -124,7 +138,7 @@ jobs: with: context: pkg/docker/alpine file: pkg/docker/alpine/Dockerfile.debug - network: local-repo + builder: local-repo push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta-debug.outputs.tags }} labels: ${{ steps.meta-debug.outputs.labels }} From 783a25f36b4aa89cb4269eaf7b4bc7ed49e61b10 Mon Sep 17 00:00:00 2001 From: Sergey Safarov Date: Fri, 21 Apr 2023 12:07:55 +0300 Subject: [PATCH 20/30] WIP14 --- .github/workflows/alpine.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/alpine.yml b/.github/workflows/alpine.yml index 0f670947af2..f5f272ab225 100644 --- a/.github/workflows/alpine.yml +++ b/.github/workflows/alpine.yml @@ -25,7 +25,6 @@ jobs: - name: local-repo uses: docker/setup-buildx-action@v2 - use: true with: driver-opts: | network=kamailio-build From 597ea3bfd8771ef6bb1ffc790bddb49dcf3de9a0 Mon Sep 17 00:00:00 2001 From: Sergey Safarov Date: Fri, 21 Apr 2023 12:09:58 +0300 Subject: [PATCH 21/30] WIP15 --- .github/workflows/alpine.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/alpine.yml b/.github/workflows/alpine.yml index f5f272ab225..63dbf352460 100644 --- a/.github/workflows/alpine.yml +++ b/.github/workflows/alpine.yml @@ -35,7 +35,7 @@ jobs: git submodule update cd pkg/docker/alpine sudo chown -R ${USER}:${USER} ${{ github.workspace }}/pkg/docker/alpine - sed -i -e 's/3.12/3.17/' ${{ github.workspace }}/pkg/docker/alpine/Dockerfile*/* + sed -i -e 's/3.12/3.17/' ${{ github.workspace }}/pkg/docker/alpine/Dockerfile* sed -i -e 's/3.12/3.17/' ${{ github.workspace }}/pkg/docker/alpine/hooks/pre_build/* ./hooks/pre_build || true From 604c3c396a3920b7727e15ecfc17891b495e82ee Mon Sep 17 00:00:00 2001 From: Sergey Safarov Date: Fri, 21 Apr 2023 12:18:53 +0300 Subject: [PATCH 22/30] WIP16 --- .github/workflows/alpine.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/alpine.yml b/.github/workflows/alpine.yml index 63dbf352460..2910d1f639f 100644 --- a/.github/workflows/alpine.yml +++ b/.github/workflows/alpine.yml @@ -23,7 +23,8 @@ jobs: run: | docker network create kamailio-build - - name: local-repo + - name: Prepare local repo + id: local-repo uses: docker/setup-buildx-action@v2 with: driver-opts: | @@ -36,7 +37,7 @@ jobs: cd pkg/docker/alpine sudo chown -R ${USER}:${USER} ${{ github.workspace }}/pkg/docker/alpine sed -i -e 's/3.12/3.17/' ${{ github.workspace }}/pkg/docker/alpine/Dockerfile* - sed -i -e 's/3.12/3.17/' ${{ github.workspace }}/pkg/docker/alpine/hooks/pre_build/* + sed -i -e 's/3.12/3.17/' ${{ github.workspace }}/pkg/docker/alpine/hooks/pre_build ./hooks/pre_build || true - name: Docker meta @@ -137,7 +138,7 @@ jobs: with: context: pkg/docker/alpine file: pkg/docker/alpine/Dockerfile.debug - builder: local-repo + builder: ${{ steps.local-repo.outputs.name }} push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta-debug.outputs.tags }} labels: ${{ steps.meta-debug.outputs.labels }} From 142a4296e331cb254376a5170dee479a11225aeb Mon Sep 17 00:00:00 2001 From: Sergey Safarov Date: Fri, 21 Apr 2023 12:23:19 +0300 Subject: [PATCH 23/30] WIP17 --- .github/workflows/alpine.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/alpine.yml b/.github/workflows/alpine.yml index 2910d1f639f..d8d66cab13a 100644 --- a/.github/workflows/alpine.yml +++ b/.github/workflows/alpine.yml @@ -36,8 +36,8 @@ jobs: git submodule update cd pkg/docker/alpine sudo chown -R ${USER}:${USER} ${{ github.workspace }}/pkg/docker/alpine - sed -i -e 's/3.12/3.17/' ${{ github.workspace }}/pkg/docker/alpine/Dockerfile* - sed -i -e 's/3.12/3.17/' ${{ github.workspace }}/pkg/docker/alpine/hooks/pre_build + #sed -i -e 's/3.12/3.17/' ${{ github.workspace }}/pkg/docker/alpine/Dockerfile* + #sed -i -e 's/3.12/3.17/' ${{ github.workspace }}/pkg/docker/alpine/hooks/pre_build ./hooks/pre_build || true - name: Docker meta From ee9fcd095745f1195134ff5b48b033838d724645 Mon Sep 17 00:00:00 2001 From: Sergey Safarov Date: Fri, 21 Apr 2023 14:00:02 +0300 Subject: [PATCH 24/30] WIP 17 --- .github/workflows/alpine.yml | 64 ++++++++++++++++++------------------ 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/.github/workflows/alpine.yml b/.github/workflows/alpine.yml index d8d66cab13a..99d55028491 100644 --- a/.github/workflows/alpine.yml +++ b/.github/workflows/alpine.yml @@ -19,26 +19,46 @@ jobs: steps: - uses: actions/checkout@v3 + - name: Compile Kamailio source + run: | + #git submodule init + #git submodule update + cd pkg/docker/alpine + sudo chown -R ${USER}:${USER} ${{ github.workspace }}/pkg/docker/alpine + #sed -i -e 's/3.12/3.17/' ${{ github.workspace }}/pkg/docker/alpine/Dockerfile* + #sed -i -e 's/3.12/3.17/' ${{ github.workspace }}/pkg/docker/alpine/hooks/pre_build + # ./hooks/pre_build || true + - name: Prepare local repo run: | docker network create kamailio-build + docker run \ + --detach \ + --network kamailio-build \ + --name local-repo \ + --hostname local-repo \ + --rm=true \ + --volume=${{ github.workspace }}/pkg/docker/alpine/apk_files:/usr/share/nginx/html:ro \ + nginx + export LOCAL_REPO_IP=$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' local-repo) - - name: Prepare local repo + - name: Prepare builder with local repo id: local-repo uses: docker/setup-buildx-action@v2 with: driver-opts: | network=kamailio-build - - name: Compile Kamailio source - run: | - git submodule init - git submodule update - cd pkg/docker/alpine - sudo chown -R ${USER}:${USER} ${{ github.workspace }}/pkg/docker/alpine - #sed -i -e 's/3.12/3.17/' ${{ github.workspace }}/pkg/docker/alpine/Dockerfile* - #sed -i -e 's/3.12/3.17/' ${{ github.workspace }}/pkg/docker/alpine/hooks/pre_build - ./hooks/pre_build || true + - name: Build and push with debug + uses: docker/build-push-action@v4 + with: + context: pkg/docker/alpine + file: pkg/docker/alpine/Dockerfile.debug + builder: ${{ steps.local-repo.outputs.name }} + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta-debug.outputs.tags }} + labels: ${{ steps.meta-debug.outputs.labels }} + add-hosts: local-repo:${{ env.LOCAL_REPO_IP }} - name: Docker meta id: meta @@ -121,29 +141,9 @@ jobs: tags: ${{ steps.meta-alpine.outputs.tags }} labels: ${{ steps.meta-alpine.outputs.labels }} - - name: Prepare local repo - run: | - #docker network create kamailio-build - docker run \ - --detach \ - --network kamailio-build \ - --name local-repo \ - --hostname local-repo \ - --rm=true \ - --volume=${{ github.workspace }}/apk_files:/usr/share/nginx/html:ro \ - nginx - - - name: Build and push with debug - uses: docker/build-push-action@v4 - with: - context: pkg/docker/alpine - file: pkg/docker/alpine/Dockerfile.debug - builder: ${{ steps.local-repo.outputs.name }} - push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.meta-debug.outputs.tags }} - labels: ${{ steps.meta-debug.outputs.labels }} - - name: Delete local repo run: | + docker buildx stop ${{ steps.local-repo.outputs.name }} + docker buildx rm ${{ steps.local-repo.outputs.name }} docker stop local-repo docker network rm kamailio-build From 94418e337ccccbae665bf73765613317afb459f1 Mon Sep 17 00:00:00 2001 From: Sergey Safarov Date: Fri, 21 Apr 2023 14:01:38 +0300 Subject: [PATCH 25/30] WIP 18 --- .github/workflows/alpine.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/alpine.yml b/.github/workflows/alpine.yml index 99d55028491..95b24309693 100644 --- a/.github/workflows/alpine.yml +++ b/.github/workflows/alpine.yml @@ -19,16 +19,6 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Compile Kamailio source - run: | - #git submodule init - #git submodule update - cd pkg/docker/alpine - sudo chown -R ${USER}:${USER} ${{ github.workspace }}/pkg/docker/alpine - #sed -i -e 's/3.12/3.17/' ${{ github.workspace }}/pkg/docker/alpine/Dockerfile* - #sed -i -e 's/3.12/3.17/' ${{ github.workspace }}/pkg/docker/alpine/hooks/pre_build - # ./hooks/pre_build || true - - name: Prepare local repo run: | docker network create kamailio-build @@ -60,6 +50,16 @@ jobs: labels: ${{ steps.meta-debug.outputs.labels }} add-hosts: local-repo:${{ env.LOCAL_REPO_IP }} + - name: Compile Kamailio source + run: | + git submodule init + git submodule update + cd pkg/docker/alpine + sudo chown -R ${USER}:${USER} ${{ github.workspace }}/pkg/docker/alpine + #sed -i -e 's/3.12/3.17/' ${{ github.workspace }}/pkg/docker/alpine/Dockerfile* + #sed -i -e 's/3.12/3.17/' ${{ github.workspace }}/pkg/docker/alpine/hooks/pre_build + ./hooks/pre_build || true + - name: Docker meta id: meta uses: docker/metadata-action@v4 From e15c29617ae23cd534ea96cdb2d42e53739c2383 Mon Sep 17 00:00:00 2001 From: Sergey Safarov Date: Fri, 21 Apr 2023 14:03:10 +0300 Subject: [PATCH 26/30] WIP19 --- .github/workflows/alpine.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/alpine.yml b/.github/workflows/alpine.yml index 95b24309693..2bcf97ad4b9 100644 --- a/.github/workflows/alpine.yml +++ b/.github/workflows/alpine.yml @@ -19,6 +19,16 @@ jobs: steps: - uses: actions/checkout@v3 + - name: Compile Kamailio source + run: | + git submodule init + git submodule update + cd pkg/docker/alpine + sudo chown -R ${USER}:${USER} ${{ github.workspace }}/pkg/docker/alpine + #sed -i -e 's/3.12/3.17/' ${{ github.workspace }}/pkg/docker/alpine/Dockerfile* + #sed -i -e 's/3.12/3.17/' ${{ github.workspace }}/pkg/docker/alpine/hooks/pre_build + #./hooks/pre_build || true + - name: Prepare local repo run: | docker network create kamailio-build @@ -50,16 +60,6 @@ jobs: labels: ${{ steps.meta-debug.outputs.labels }} add-hosts: local-repo:${{ env.LOCAL_REPO_IP }} - - name: Compile Kamailio source - run: | - git submodule init - git submodule update - cd pkg/docker/alpine - sudo chown -R ${USER}:${USER} ${{ github.workspace }}/pkg/docker/alpine - #sed -i -e 's/3.12/3.17/' ${{ github.workspace }}/pkg/docker/alpine/Dockerfile* - #sed -i -e 's/3.12/3.17/' ${{ github.workspace }}/pkg/docker/alpine/hooks/pre_build - ./hooks/pre_build || true - - name: Docker meta id: meta uses: docker/metadata-action@v4 From 42e7565b5a025b7a9ebead140a9f19c8efac1346 Mon Sep 17 00:00:00 2001 From: Sergey Safarov Date: Fri, 21 Apr 2023 14:05:23 +0300 Subject: [PATCH 27/30] WIP20 --- .github/workflows/alpine.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/alpine.yml b/.github/workflows/alpine.yml index 2bcf97ad4b9..3b89be3e442 100644 --- a/.github/workflows/alpine.yml +++ b/.github/workflows/alpine.yml @@ -14,7 +14,7 @@ env: SOURCE_BRANCH: ${{ github.ref_name }} jobs: - build: + x86_64: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -55,7 +55,7 @@ jobs: context: pkg/docker/alpine file: pkg/docker/alpine/Dockerfile.debug builder: ${{ steps.local-repo.outputs.name }} - push: ${{ github.event_name != 'pull_request' }} + push: ${{ github.event_name == 'pull_request' }} tags: ${{ steps.meta-debug.outputs.tags }} labels: ${{ steps.meta-debug.outputs.labels }} add-hosts: local-repo:${{ env.LOCAL_REPO_IP }} From 25606287444f2f448286dc64d78b44501bb151b4 Mon Sep 17 00:00:00 2001 From: Sergey Safarov Date: Fri, 21 Apr 2023 14:08:30 +0300 Subject: [PATCH 28/30] WIP21 --- .github/workflows/alpine.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/alpine.yml b/.github/workflows/alpine.yml index 3b89be3e442..67be3c766a4 100644 --- a/.github/workflows/alpine.yml +++ b/.github/workflows/alpine.yml @@ -58,7 +58,7 @@ jobs: push: ${{ github.event_name == 'pull_request' }} tags: ${{ steps.meta-debug.outputs.tags }} labels: ${{ steps.meta-debug.outputs.labels }} - add-hosts: local-repo:${{ env.LOCAL_REPO_IP }} + add-hosts: local-repo:192.168.55.55 - name: Docker meta id: meta From 091dd023504c063ca97f54d67c24e1d590195365 Mon Sep 17 00:00:00 2001 From: Sergey Safarov Date: Fri, 21 Apr 2023 14:21:45 +0300 Subject: [PATCH 29/30] WIP22 --- .github/workflows/alpine.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/alpine.yml b/.github/workflows/alpine.yml index 67be3c766a4..d92d2096bd9 100644 --- a/.github/workflows/alpine.yml +++ b/.github/workflows/alpine.yml @@ -40,7 +40,8 @@ jobs: --rm=true \ --volume=${{ github.workspace }}/pkg/docker/alpine/apk_files:/usr/share/nginx/html:ro \ nginx - export LOCAL_REPO_IP=$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' local-repo) + LOCAL_REPO_IP=$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' local-repo) + sed -i -e "s/local-repo/${LOCAL_REPO_IP}/" pkg/docker/alpine/Dockerfile.debug - name: Prepare builder with local repo id: local-repo From 855c06349caf0c2ecd2fbbf46e0c3143ff1f1507 Mon Sep 17 00:00:00 2001 From: Sergey Safarov Date: Fri, 21 Apr 2023 14:26:04 +0300 Subject: [PATCH 30/30] WIP23 --- .github/workflows/alpine.yml | 67 ++++++++++++++++++------------------ 1 file changed, 33 insertions(+), 34 deletions(-) diff --git a/.github/workflows/alpine.yml b/.github/workflows/alpine.yml index d92d2096bd9..649f1c52925 100644 --- a/.github/workflows/alpine.yml +++ b/.github/workflows/alpine.yml @@ -23,43 +23,11 @@ jobs: run: | git submodule init git submodule update - cd pkg/docker/alpine sudo chown -R ${USER}:${USER} ${{ github.workspace }}/pkg/docker/alpine #sed -i -e 's/3.12/3.17/' ${{ github.workspace }}/pkg/docker/alpine/Dockerfile* #sed -i -e 's/3.12/3.17/' ${{ github.workspace }}/pkg/docker/alpine/hooks/pre_build - #./hooks/pre_build || true - - - name: Prepare local repo - run: | - docker network create kamailio-build - docker run \ - --detach \ - --network kamailio-build \ - --name local-repo \ - --hostname local-repo \ - --rm=true \ - --volume=${{ github.workspace }}/pkg/docker/alpine/apk_files:/usr/share/nginx/html:ro \ - nginx - LOCAL_REPO_IP=$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' local-repo) - sed -i -e "s/local-repo/${LOCAL_REPO_IP}/" pkg/docker/alpine/Dockerfile.debug - - - name: Prepare builder with local repo - id: local-repo - uses: docker/setup-buildx-action@v2 - with: - driver-opts: | - network=kamailio-build - - - name: Build and push with debug - uses: docker/build-push-action@v4 - with: - context: pkg/docker/alpine - file: pkg/docker/alpine/Dockerfile.debug - builder: ${{ steps.local-repo.outputs.name }} - push: ${{ github.event_name == 'pull_request' }} - tags: ${{ steps.meta-debug.outputs.tags }} - labels: ${{ steps.meta-debug.outputs.labels }} - add-hosts: local-repo:192.168.55.55 + cd pkg/docker/alpine + ./hooks/pre_build || true - name: Docker meta id: meta @@ -142,6 +110,37 @@ jobs: tags: ${{ steps.meta-alpine.outputs.tags }} labels: ${{ steps.meta-alpine.outputs.labels }} + - name: Prepare local repo + run: | + docker network create kamailio-build + docker run \ + --detach \ + --network kamailio-build \ + --name local-repo \ + --hostname local-repo \ + --rm=true \ + --volume=${{ github.workspace }}/pkg/docker/alpine/apk_files:/usr/share/nginx/html:ro \ + nginx + LOCAL_REPO_IP=$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' local-repo) + sed -i -e "s/local-repo/${LOCAL_REPO_IP}/" pkg/docker/alpine/Dockerfile.debug + + - name: Prepare builder with local repo + id: local-repo + uses: docker/setup-buildx-action@v2 + with: + driver-opts: | + network=kamailio-build + + - name: Build and push with debug + uses: docker/build-push-action@v4 + with: + context: pkg/docker/alpine + file: pkg/docker/alpine/Dockerfile.debug + builder: ${{ steps.local-repo.outputs.name }} + push: ${{ github.event_name == 'pull_request' }} + tags: ${{ steps.meta-debug.outputs.tags }} + labels: ${{ steps.meta-debug.outputs.labels }} + - name: Delete local repo run: | docker buildx stop ${{ steps.local-repo.outputs.name }}