Skip to content

Commit

Permalink
feat: added ci/cd pipeline job for helm oc image
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Kamani committed Jan 10, 2024
1 parent e866d0b commit c3765bb
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 3 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/helm-oc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: build kubectl images

on:
push:
branches: [ "main" ]
paths: [ "helm-oc/**" ]
pull_request:
paths: [ "helm-oc/**" ]
schedule:
- cron: '15 6 * * *'

jobs:
build-and-push-helm-oc:
strategy:
matrix:
helm-version: ["3"]
oc-version: ["4.10.58", "4.11.56", "4.12.46", "4.13.9", "4.14.8"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build Image
run: |
docker build ./helm-oc --file helm-oc/Dockerfile --build-arg HELM_VERSION=${{ matrix.helm-version }} --build-arg OCP_VERSION=${{ matrix.oc-version }} --tag demtag/helm-oc:h${{ matrix.helm-version }}-o${{ matrix.oc-version }}
- name: Login to Dockerhub
if: github.event_name == 'push' && github.ref_name == 'main'
run: docker login --username ${DOCKER_USERNAME} --password ${DOCKER_PASSWORD}
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
- name: Push Image
if: github.event_name == 'push' && github.ref_name == 'main'
run: |
docker push demtag/helm-oc:h${{ matrix.helm-version }}-o${{ matrix.oc-version }}
10 changes: 7 additions & 3 deletions helm-oc/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
FROM ubuntu:22.04

RUN apt-get update && apt-get install curl=7.81.0-1ubuntu1.15 -y --no-install-recommends \
ARG HELM_VERSION=3
ARG OC_VERSION=4.10.58

RUN apt-get update && apt-get install curl=7.81.0-1ubuntu1.15 ca-certificates=20230311ubuntu0.22.04.1 -y --no-install-recommends \
&& update-ca-certificates \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
RUN curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-${HELM_VERSION}
RUN chmod 700 get_helm.sh
RUN ./get_helm.sh
RUN rm -r get_helm.sh
RUN curl -o openshift-cli-tar.gz https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/4.10.58/openshift-client-linux.tar.gz
RUN curl -o openshift-cli-tar.gz https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/${OC_VERSION}/openshift-client-linux.tar.gz
RUN tar -zxvf openshift-cli-tar.gz
RUN mv oc /usr/local/bin

Expand Down

0 comments on commit c3765bb

Please sign in to comment.