Updated Go lang to 1.17.1 version

This commit is contained in:
Alexey Pustovalov 2021-09-14 12:32:06 +02:00
parent 1d74db337f
commit aeca02b9ab

View File

@ -21,6 +21,7 @@ defaults:
env: env:
DOCKER_REPOSITORY: "zabbix" DOCKER_REPOSITORY: "zabbix"
LATEST_BRANCH: ${{ github.event.repository.default_branch }} LATEST_BRANCH: ${{ github.event.repository.default_branch }}
BASE_BUILD_NAME: "build-base"
jobs: jobs:
init_build: init_build:
@ -31,47 +32,60 @@ jobs:
database: ${{ steps.database.outputs.list }} database: ${{ steps.database.outputs.list }}
components: ${{ steps.components.outputs.list }} components: ${{ steps.components.outputs.list }}
steps: steps:
- uses: actions/checkout@v2 - name: Checkout repository
uses: actions/checkout@v2
with: with:
fetch-depth: 1 fetch-depth: 1
- shell: bash - name: Check build.xml file
id: os id: build_exists
run: | run: |
if [[ -f "./build.xml" ]]; then if [[ ! -f "./build.xml" ]]; then
os=$(jq -r '.os | keys | [ .[] | tostring ] | @json' "./build.xml") echo "::error::File build.xml is missing"
else exit 1
os=[]
fi fi
echo "::set-output name=list::$os" - name: Prepare Operating System list
id: os
run: |
os_list=$(jq -r '.os | keys | [ .[] | tostring ] | @json' "./build.xml")
- shell: bash echo "::set-output name=list::$os_list"
- name: Prepare Platform list
id: platform_list
run: |
platform_list=$(jq -r '.os | tostring | @json' "./build.xml")
echo "::set-output name=list::$platform_list"
- name: Prepare Database engine list
id: database id: database
run: | run: |
database=$(jq -r '[.components | values[] ] | sort | unique | del(.. | select ( . == "" ) ) | [ .[] | tostring ] | @json' "./build.xml") database_list=$(jq -r '[.components | values[] ] | sort | unique | del(.. | select ( . == "" ) ) | [ .[] | tostring ] | @json' "./build.xml")
echo "::set-output name=list::$database"
- shell: bash echo "::set-output name=list::$database_list"
- name: Prepare Zabbix component list
id: components id: components
run: | run: |
components=$(jq -r '.components | keys | [ .[] | tostring ] | @json' "./build.xml") component_list=$(jq -r '.components | keys | [ .[] | tostring ] | @json' "./build.xml")
echo "::set-output name=list::$components"
echo "::set-output name=list::$component_list"
build_base: build_base:
timeout-minutes: 70 timeout-minutes: 70
name: Build ${{ matrix.build }} base on ${{ matrix.os }} name: Build base on ${{ matrix.os }}
needs: init_build needs: init_build
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
build:
- build-base
os: ${{ fromJson(needs.init_build.outputs.os) }} os: ${{ fromJson(needs.init_build.outputs.os) }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - name: Checkout repository
uses: actions/checkout@v2
with: with:
fetch-depth: 1 fetch-depth: 1
@ -87,30 +101,20 @@ jobs:
username: ${{ secrets.DOCKER_USERNAME }} username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }} password: ${{ secrets.DOCKER_PASSWORD }}
- name: Prepare platform list - name: Prepare Platform list
id: platform id: platform_list
run: | run: |
DOCKER_PLATFORM="linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64" platform_list=$(jq -r '.os.${{ matrix.os }} | join(",")' "./build.xml")
#,linux/s390x"
if [ "${{ matrix.os }}" == "ubuntu" ]; then
DOCKER_PLATFORM="linux/amd64,linux/arm/v7,linux/arm64"
#,linux/ppc64le"
fi
if [ "${{ matrix.os }}" == "ol" ]; then
DOCKER_PLATFORM="linux/amd64,linux/arm64"
fi
echo ::set-output name=list::${DOCKER_PLATFORM} echo ::set-output name=list::${DOCKER_PLATFORM}
- name: Prepare environment (push) - name: Prepare environment (${{ github.event_name }})
if: github.event_name == 'push' if: github.event_name == 'push'
id: prepare_push id: prepare_push
run: | run: |
TAGS_ARRAY=() TAGS_ARRAY=()
IMAGE_NAME="${{ env.DOCKER_REPOSITORY }}/zabbix-${{ matrix.build }}" IMAGE_NAME="${{ env.DOCKER_REPOSITORY }}/zabbix-${{ $env.BASE_BUILD_NAME }}"
GIT_BRANCH="${{ github.ref }}" GIT_BRANCH="${{ github.ref }}"
GIT_BRANCH=${GIT_BRANCH:11} GIT_BRANCH=${GIT_BRANCH:11}
@ -139,13 +143,13 @@ jobs:
echo ::set-output name=image_name::${IMAGE_NAME} echo ::set-output name=image_name::${IMAGE_NAME}
echo ::set-output name=image_tag_versions::$(printf -- "%s," "${TAGS_ARRAY[@]}") echo ::set-output name=image_tag_versions::$(printf -- "%s," "${TAGS_ARRAY[@]}")
- name: Prepare environment (release) - name: Prepare environment (${{ github.event_name }})
if: github.event_name == 'release' && github.event.action == 'published' if: github.event_name == 'release' && github.event.action == 'published'
id: prepare_release id: prepare_release
run: | run: |
TAGS_ARRAY=() TAGS_ARRAY=()
IMAGE_NAME="${{ env.DOCKER_REPOSITORY }}/zabbix-${{ matrix.build }}" IMAGE_NAME="${{ env.DOCKER_REPOSITORY }}/zabbix-${{ $env.BASE_BUILD_NAME }}"
RELEASE_VERSION="${{ github.ref }}" RELEASE_VERSION="${{ github.ref }}"
RELEASE_VERSION=${RELEASE_VERSION:10} RELEASE_VERSION=${RELEASE_VERSION:10}
GIT_BRANCH=${RELEASE_VERSION%.*} GIT_BRANCH=${RELEASE_VERSION%.*}
@ -184,8 +188,8 @@ jobs:
id: docker_build id: docker_build
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2
with: with:
context: ./${{ matrix.build }}/${{ matrix.os }} context: ./${{ $env.BASE_BUILD_NAME }}/${{ matrix.os }}
file: ./${{ matrix.build }}/${{ matrix.os }}/Dockerfile file: ./${{ $env.BASE_BUILD_NAME }}/${{ matrix.os }}/Dockerfile
platforms: ${{ steps.platform.outputs.list }} platforms: ${{ steps.platform.outputs.list }}
push: ${{ secrets.AUTO_PUSH_IMAGES }} push: ${{ secrets.AUTO_PUSH_IMAGES }}
tags: ${{ steps.prepare_tags.outputs.image_tag_versions }} tags: ${{ steps.prepare_tags.outputs.image_tag_versions }}
@ -193,12 +197,12 @@ jobs:
- name: Image digest - name: Image digest
run: | run: |
echo ${{ steps.docker_build.outputs.digest }} echo ${{ steps.docker_build.outputs.digest }}
echo "${{ steps.docker_build.outputs.digest }}" > ${{ matrix.build }}_${{ matrix.os }} echo "${{ steps.docker_build.outputs.digest }}" > ${{ $env.BASE_BUILD_NAME }}_${{ matrix.os }}
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v2
with: with:
name: ${{ matrix.build }}_${{ matrix.os }} name: ${{ $env.BASE_BUILD_NAME }}_${{ matrix.os }}
path: ${{ matrix.build }}_${{ matrix.os }} path: ${{ $env.BASE_BUILD_NAME }}_${{ matrix.os }}
if-no-files-found: error if-no-files-found: error
build_base_database: build_base_database:
@ -227,20 +231,10 @@ jobs:
username: ${{ secrets.DOCKER_USERNAME }} username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }} password: ${{ secrets.DOCKER_PASSWORD }}
- name: Prepare platform list - name: Prepare Platform list
id: platform id: platform_list
run: | run: |
DOCKER_PLATFORM="linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64" platform_list=$(jq -r '.os.${{ matrix.os }} | join(",")' "./build.xml")
# ,linux/s390x"
if [ "${{ matrix.os }}" == "ubuntu" ]; then
DOCKER_PLATFORM="linux/amd64,linux/arm/v7,linux/arm64"
#,linux/ppc64le"
fi
if [ "${{ matrix.os }}" == "ol" ]; then
DOCKER_PLATFORM="linux/amd64,linux/arm64"
fi
echo ::set-output name=list::${DOCKER_PLATFORM} echo ::set-output name=list::${DOCKER_PLATFORM}