mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-24 05:04:05 -08:00
Fix docker images publishing (#11260)
Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>
This commit is contained in:
parent
58b7c890a1
commit
fc1a36d476
5
.github/actions/build/action.yml
vendored
5
.github/actions/build/action.yml
vendored
|
@ -18,7 +18,6 @@ runs:
|
||||||
- uses: ./.github/actions/setup_environment
|
- uses: ./.github/actions/setup_environment
|
||||||
- run: ~/go/bin/promu crossbuild -v --parallelism ${{ inputs.parallelism }} --parallelism-thread ${{ inputs.thread }} ${{ inputs.promu_opts }}
|
- run: ~/go/bin/promu crossbuild -v --parallelism ${{ inputs.parallelism }} --parallelism-thread ${{ inputs.thread }} ${{ inputs.promu_opts }}
|
||||||
shell: bash
|
shell: bash
|
||||||
- uses: actions/upload-artifact@v3
|
- uses: ./.github/actions/save_artefacts
|
||||||
with:
|
with:
|
||||||
path: |
|
directory: .build
|
||||||
.build
|
|
||||||
|
|
8
.github/actions/publish_images/action.yml
vendored
8
.github/actions/publish_images/action.yml
vendored
|
@ -29,14 +29,16 @@ runs:
|
||||||
steps:
|
steps:
|
||||||
- name: Download all workflow run artifacts
|
- name: Download all workflow run artifacts
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: artifact
|
||||||
- uses: ./.github/actions/setup_environment
|
- uses: ./.github/actions/setup_environment
|
||||||
- if: "inputs.dockerfile_path != ''"
|
- if: inputs.dockerfile_path != ''
|
||||||
run: echo "export DOCKERFILE_PATH=${{ inputs.dockerfile_path }}" >> /tmp/tmp-profile
|
run: echo "export DOCKERFILE_PATH=${{ inputs.dockerfile_path }}" >> /tmp/tmp-profile
|
||||||
shell: bash
|
shell: bash
|
||||||
- if: "inputs.container_image_name != ''"
|
- if: inputs.container_image_name != ''
|
||||||
run: echo "export DOCKER_IMAGE_NAME=${{ inputs.container_image_name }}" >> /tmp/tmp-profile
|
run: echo "export DOCKER_IMAGE_NAME=${{ inputs.container_image_name }}" >> /tmp/tmp-profile
|
||||||
shell: bash
|
shell: bash
|
||||||
- if: "inputs.dockerbuild_context != ''"
|
- if: inputs.dockerbuild_context != ''
|
||||||
run: echo "export DOCKERBUILD_CONTEXT=${{ inputs.dockerbuild_context }}" >> /tmp/tmp-profile
|
run: echo "export DOCKERBUILD_CONTEXT=${{ inputs.dockerbuild_context }}" >> /tmp/tmp-profile
|
||||||
shell: bash
|
shell: bash
|
||||||
- run: |
|
- run: |
|
||||||
|
|
2
.github/actions/publish_main/action.yml
vendored
2
.github/actions/publish_main/action.yml
vendored
|
@ -24,6 +24,8 @@ runs:
|
||||||
using: composite
|
using: composite
|
||||||
steps:
|
steps:
|
||||||
- uses: ./.github/actions/setup_environment
|
- uses: ./.github/actions/setup_environment
|
||||||
|
with:
|
||||||
|
enable_docker_multibuild: true
|
||||||
- uses: ./.github/actions/publish_images
|
- uses: ./.github/actions/publish_images
|
||||||
if: inputs.docker_hub_organization != '' && inputs.docker_hub_login != ''
|
if: inputs.docker_hub_organization != '' && inputs.docker_hub_login != ''
|
||||||
with:
|
with:
|
||||||
|
|
2
.github/actions/publish_release/action.yml
vendored
2
.github/actions/publish_release/action.yml
vendored
|
@ -24,6 +24,8 @@ runs:
|
||||||
using: composite
|
using: composite
|
||||||
steps:
|
steps:
|
||||||
- uses: ./.github/actions/setup_environment
|
- uses: ./.github/actions/setup_environment
|
||||||
|
with:
|
||||||
|
enable_docker_multibuild: true
|
||||||
- run: promu crossbuild tarballs
|
- run: promu crossbuild tarballs
|
||||||
shell: bash
|
shell: bash
|
||||||
- run: promu checksum .tarballs
|
- run: promu checksum .tarballs
|
||||||
|
|
14
.github/actions/publish_release_image/action.yml
vendored
14
.github/actions/publish_release_image/action.yml
vendored
|
@ -29,15 +29,17 @@ runs:
|
||||||
steps:
|
steps:
|
||||||
- name: Download all workflow run artifacts
|
- name: Download all workflow run artifacts
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: artifact
|
||||||
- uses: ./.github/actions/setup_environment
|
- uses: ./.github/actions/setup_environment
|
||||||
- if: "inputs.dockerfile_path != ''"
|
- if: inputs.dockerfile_path != ''
|
||||||
run: echo "export DOCKERFILE_PATH=${{ inputs.dockerfile_path }}" }} /tmp/tmp-profile
|
run: echo "export DOCKERFILE_PATH=${{ inputs.dockerfile_path }}" >> /tmp/tmp-profile
|
||||||
shell: bash
|
shell: bash
|
||||||
- if: "inputs.container_image_name != ''"
|
- if: inputs.container_image_name != ''
|
||||||
run: echo "export DOCKER_IMAGE_NAME=${{ inputs.container_image_name }}" }} /tmp/tmp-profile
|
run: echo "export DOCKER_IMAGE_NAME=${{ inputs.container_image_name }}" >> /tmp/tmp-profile
|
||||||
shell: bash
|
shell: bash
|
||||||
- if: "inputs.dockerbuild_context != ''"
|
- if: inputs.dockerbuild_context != ''
|
||||||
run: echo "export DOCKERBUILD_CONTEXT=${{ inputs.dockerbuild_context }}" }} /tmp/tmp-profile
|
run: echo "export DOCKERBUILD_CONTEXT=${{ inputs.dockerbuild_context }}" >> /tmp/tmp-profile
|
||||||
shell: bash
|
shell: bash
|
||||||
- run: |
|
- run: |
|
||||||
current_tag=${GITHUB_REF#refs/*/}
|
current_tag=${GITHUB_REF#refs/*/}
|
||||||
|
|
18
.github/actions/save_artefacts/action.yml
vendored
Normal file
18
.github/actions/save_artefacts/action.yml
vendored
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
# To preserve the directory structure, save an additional empty file at
|
||||||
|
# the root of the working directory. GitHub action uses the least common
|
||||||
|
# ancestor of all the search paths as the root directory for artefacts.
|
||||||
|
name: Save artefacts
|
||||||
|
inputs:
|
||||||
|
directory:
|
||||||
|
type: string
|
||||||
|
description: Path of the directory to save
|
||||||
|
runs:
|
||||||
|
using: composite
|
||||||
|
steps:
|
||||||
|
- run: touch .keep
|
||||||
|
shell: bash
|
||||||
|
- uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
${{ inputs.directory }}
|
||||||
|
.keep
|
18
.github/actions/setup_environment/action.yml
vendored
18
.github/actions/setup_environment/action.yml
vendored
|
@ -7,12 +7,16 @@ inputs:
|
||||||
enable_npm:
|
enable_npm:
|
||||||
type: boolean
|
type: boolean
|
||||||
description: Whether to enable npm specific features, such as caching.
|
description: Whether to enable npm specific features, such as caching.
|
||||||
default: true
|
default: false
|
||||||
|
enable_docker_multibuild:
|
||||||
|
type: boolean
|
||||||
|
description: Whether to enable multibuild docker
|
||||||
|
default: false
|
||||||
runs:
|
runs:
|
||||||
using: composite
|
using: composite
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/cache@v3
|
- uses: actions/cache@v3
|
||||||
if: ${{ inputs.enable_go }}
|
if: inputs.enable_go == 'true'
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
~/.cache/go-build
|
~/.cache/go-build
|
||||||
|
@ -21,7 +25,7 @@ runs:
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-go-
|
${{ runner.os }}-go-
|
||||||
- uses: actions/cache@v3
|
- uses: actions/cache@v3
|
||||||
if: ${{ inputs.enable_npm }}
|
if: inputs.enable_npm == 'true'
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
~/.npm
|
~/.npm
|
||||||
|
@ -30,4 +34,10 @@ runs:
|
||||||
${{ runner.os }}-npm-
|
${{ runner.os }}-npm-
|
||||||
- run: make promu
|
- run: make promu
|
||||||
shell: bash
|
shell: bash
|
||||||
if: ${{ inputs.enable_go }}
|
if: inputs.enable_go == 'true'
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v1
|
||||||
|
if: inputs.enable_docker_multibuild == 'true'
|
||||||
|
- name: Set up buildx
|
||||||
|
uses: docker/setup-buildx-action@v1
|
||||||
|
if: inputs.enable_docker_multibuild == 'true'
|
||||||
|
|
5
.github/workflows/test.yml
vendored
5
.github/workflows/test.yml
vendored
|
@ -37,10 +37,9 @@ jobs:
|
||||||
- run: make assets-tarball
|
- run: make assets-tarball
|
||||||
- run: make ui-lint
|
- run: make ui-lint
|
||||||
- run: make ui-test
|
- run: make ui-test
|
||||||
- uses: actions/upload-artifact@v3
|
- uses: ./.github/actions/save_artefacts
|
||||||
with:
|
with:
|
||||||
path: |
|
directory: .tarballs
|
||||||
.tarballs
|
|
||||||
|
|
||||||
test_windows:
|
test_windows:
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
|
|
|
@ -205,7 +205,7 @@ common-tarball: promu
|
||||||
.PHONY: common-docker $(BUILD_DOCKER_ARCHS)
|
.PHONY: common-docker $(BUILD_DOCKER_ARCHS)
|
||||||
common-docker: $(BUILD_DOCKER_ARCHS)
|
common-docker: $(BUILD_DOCKER_ARCHS)
|
||||||
$(BUILD_DOCKER_ARCHS): common-docker-%:
|
$(BUILD_DOCKER_ARCHS): common-docker-%:
|
||||||
docker build -t "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:$(DOCKER_IMAGE_TAG)" \
|
docker buildx build -t "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:$(DOCKER_IMAGE_TAG)" \
|
||||||
-f $(DOCKERFILE_PATH) \
|
-f $(DOCKERFILE_PATH) \
|
||||||
--build-arg ARCH="$*" \
|
--build-arg ARCH="$*" \
|
||||||
--build-arg OS="linux" \
|
--build-arg OS="linux" \
|
||||||
|
|
Loading…
Reference in a new issue