From edf437841038711cad05c63433bf54b4de2579fc Mon Sep 17 00:00:00 2001 From: Ronnie Lazar Date: Sun, 24 May 2020 17:13:30 +0300 Subject: [PATCH 1/2] github action to push image to ocpmetal --- .github/workflows/image-push.yml | 43 ++++++++++++++++++++++++++++++++ .gitignore | 2 ++ Dockerfile.test-infra | 2 ++ 3 files changed, 47 insertions(+) create mode 100644 .github/workflows/image-push.yml diff --git a/.github/workflows/image-push.yml b/.github/workflows/image-push.yml new file mode 100644 index 0000000..fdca714 --- /dev/null +++ b/.github/workflows/image-push.yml @@ -0,0 +1,43 @@ +name: image-push + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v1 + - name: Set up Python + uses: actions/setup-python@v1 + with: + python-version: 3.x + - name: Install dependencies + run: | + sudo pip install strato-skipper + mkdir -p ~/.docker + echo "{}" > ~/.docker/config.json + touch ${HOME}/.gitconfig + ln -s Dockerfile.bm-inventory Dockerfile + - name: build bm-inventory client + run: | + skipper make create_inventory_client + - name: Get release version + id: get_version + run: echo ::set-env name=GIT_REVISION::$(echo ${GITHUB_SHA}) + - name: Publish test-infra to Registry + uses: elgohr/Publish-Docker-Github-Action@2.15 + with: + name: test-infra + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + REGISTRY: 'quay.io/ocpmetal' + dockerfile: "Dockerfile.test-infra" + buildargs: GIT_REVISION + tags: "ocpmetal,${{ env.GIT_REVISION }}" diff --git a/.gitignore b/.gitignore index f7373d8..480ef7e 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,5 @@ bm-inventory minikube *.log +**/RCS/** + diff --git a/Dockerfile.test-infra b/Dockerfile.test-infra index 0b38b4f..7b66d63 100644 --- a/Dockerfile.test-infra +++ b/Dockerfile.test-infra @@ -1,5 +1,7 @@ FROM centos:8 ENV container docker +ARG GIT_REVISION +LABEL "git_revision"=${GIT_REVISION} RUN yum -y install systemd make python3 virt-viewer virt-install libvirt-client git libvirt-devel gcc unzip wget jq && yum clean all; \ (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); \ From 13af1a617661a03595973730ab16dcc8d1a1f386 Mon Sep 17 00:00:00 2001 From: Igal Tsoiref Date: Mon, 25 May 2020 11:24:25 +0300 Subject: [PATCH 2/2] Change skipper make to make while creating bm-inventory client in workflow --- .github/workflows/image-push.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/image-push.yml b/.github/workflows/image-push.yml index fdca714..368cc14 100644 --- a/.github/workflows/image-push.yml +++ b/.github/workflows/image-push.yml @@ -27,7 +27,7 @@ jobs: ln -s Dockerfile.bm-inventory Dockerfile - name: build bm-inventory client run: | - skipper make create_inventory_client + make create_inventory_client - name: Get release version id: get_version run: echo ::set-env name=GIT_REVISION::$(echo ${GITHUB_SHA})