Skip to content

Commit

Permalink
rollback
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Cook <rcook@redhat.com>
  • Loading branch information
cooktheryan committed Sep 13, 2022
1 parent 499ac0f commit 5d48e21
Showing 1 changed file with 119 additions and 14 deletions.
133 changes: 119 additions & 14 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1617,23 +1617,88 @@ jobs:
if: always()
run: sudo podman logs fetchit

push-manifest-list-to-registry:
push-amd-image-to-registry:
runs-on: ubuntu-latest
needs: [ build, raw-validate, fetchit-config-target-no-config-validate, fetchit-config-reload-validate, clean-validate, kube-validate, systemd-validate, systemd-enable-validate, systemd-user-enable-validate, systemd-autoupdate-validate, systemd-restart-validate, systemd-validate-exact-file, multi-engine-validate, make-change-to-repo, filetransfer-validate, filetransfer-validate-exact-file, gitsign-verify-validate, ansible-validate, loader-validate, disconnected-validate ]
if: >
(github.event_name == 'push' || github.event_name == 'schedule') &&
(github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
steps:
- name: Checkout source
- name: Login to Quay
uses: docker/login-action@v1
with:
registry: quay.io
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}

- name: pull artifact
uses: actions/download-artifact@v1
with:
name: fetchit-image
path: /tmp

- name: Load the image
run: docker load -i /tmp/fetchit.tar

- name: push image
run: docker push quay.io/fetchit/fetchit-amd:latest


build-arm-and-manifest-list:
runs-on: ubuntu-latest
needs: [ build, raw-validate, fetchit-config-target-no-config-validate, fetchit-config-reload-validate, clean-validate, kube-validate, systemd-validate, systemd-enable-validate, systemd-user-enable-validate, systemd-autoupdate-validate, systemd-restart-validate, systemd-validate-exact-file, multi-engine-validate, make-change-to-repo, filetransfer-validate, filetransfer-validate-exact-file, gitsign-verify-validate, ansible-validate, loader-validate, disconnected-validate ]
if: >
(github.event_name == 'push' || github.event_name == 'schedule') &&
(github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: update system
run: sudo apt-get update

- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Install required packages
run: sudo apt install podman build-essential qemu-user qemu-user-static

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build the arm image
run: go mod tidy -compat=1.17 && go mod vendor && CTR_CMD=podman make build-containerized-cross-build-linux-arm64

- name: Export image
run: podman save -o /tmp/fetchit-arm.tar quay.io/fetchit/fetchit-arm:latest

- name: Save container as artifact
uses: actions/upload-artifact@v1
with:
buildkitd-flags: --debug
name: fetchit-arm-image
path: /tmp/fetchit-arm.tar

push-manifest-list-to-registry:
runs-on: ubuntu-latest
needs: [ build-arm-and-manifest-list ]
if: >
(github.event_name == 'push' || github.event_name == 'schedule') &&
(github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
steps:
- name: pull artifact
uses: actions/download-artifact@v1
with:
name: fetchit-image
path: /tmp

- name: Load the amd image
run: podman load -i /tmp/fetchit.tar

- name: pull arm artifact
uses: actions/download-artifact@v1
with:
name: fetchit-arm-image
path: /tmp

- name: Load the arm image
run: podman load -i /tmp/fetchit-arm.tar

- name: create manifest
run: podman manifest create quay.io/fetchit/fetchit:latest

- name: Login to Quay
uses: docker/login-action@v1
Expand All @@ -1645,14 +1710,54 @@ jobs:
- name: podman login to quay.io
run: podman login --authfile ~/.docker/config.json quay.io

- name: "Build Operator Image"
uses: docker/build-push-action@v2
- name: add images and push manifest list
run: |
podman manifest add --arch arm64 quay.io/fetchit/fetchit:latest docker://quay.io/fetchit/fetchit-arm:latest
podman manifest add quay.io/fetchit/fetchit:latest docker://quay.io/fetchit/fetchit-amd:latest
podman manifest push --authfile ~/.docker/config.json quay.io/fetchit/fetchit:latest docker://quay.io/fetchit/fetchit:latest --format=docker
publish-binary-to-github:
runs-on: ubuntu-latest
needs: [ build-arm-and-manifest-list ]
if: >
(github.event_name == 'push' || github.event_name == 'schedule') &&
(github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
steps:
- name: pull arm image
uses: actions/download-artifact@v1
with:
context: .
file: "./Dockerfile"
platforms: "linux/amd64,linux/arm64,linux/arm/v7"
push: true
tags: quay.io/fetchit/fetchit:latest
name: fetchit-arm-image
path: /tmp

- name: Load the arm image
run: podman load -i /tmp/fetchit-arm.tar

- name: Pull amd image
uses: actions/download-artifact@v1
with:
name: fetchit-image
path: /tmp

- name: Load the amd image
run: podman load -i /tmp/fetchit.tar

- name: move binary
run: |
arm=$(podman images | grep arm | awk '{print $3}')
amd=$(podman images | grep amd | awk '{print $3}')
podman cp $(podman create --rm $arm):/usr/local/bin/fetchit ./fetchit-arm
podman cp $(podman create --rm $amd):/usr/local/bin/fetchit ./fetchit-amd
- name: push binary
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
prerelease: true
title: "Latest Build"
files: |
fetchit-arm
fetchit-amd
create-ansible-manifest:
runs-on: ubuntu-latest
Expand Down

0 comments on commit 5d48e21

Please sign in to comment.