Skip to content

Commit

Permalink
✨ [Feat] github actions ci & helm chart argo app deploy
Browse files Browse the repository at this point in the history
✨ [Feat] github actions ci & helm chart argo app deploy
  • Loading branch information
jun6292 authored Oct 11, 2024
2 parents d0ef07f + e7fad56 commit 70b8718
Show file tree
Hide file tree
Showing 7 changed files with 91 additions and 1 deletion.
30 changes: 30 additions & 0 deletions .github/workflows/plugin-jenkins-inven-collector-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Docker Image CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
push: true
tags: chanjin/plugin-jenkins-inven-collector:latest
5 changes: 5 additions & 0 deletions helm/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: v2
name: jenkins-inven-collector
description: A Helm chart for deploying the Jenkins Inventory Collector
version: 0.1.0
appVersion: "1.0"
12 changes: 12 additions & 0 deletions helm/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{/* Generate the full name of the application */}}
{{- define "my-app.name" -}}
{{- .Chart.Name | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{- define "my-app.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else }}
{{- .Chart.Name | trunc 63 | trimSuffix "-" -}}-{{ .Release.Name | trunc 63 | trimSuffix "-" }}
{{- end -}}
{{- end -}}
19 changes: 19 additions & 0 deletions helm/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "my-app.fullname" . }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app: {{ include "my-app.fullname" . }}
template:
metadata:
labels:
app: {{ include "my-app.fullname" . }}
spec:
containers:
- name: jenkins-inven-collector
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
ports:
- containerPort: 50051
11 changes: 11 additions & 0 deletions helm/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "my-app.fullname" . }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
targetPort: 50051
selector:
app: {{ include "my-app.fullname" . }}
13 changes: 13 additions & 0 deletions helm/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
replicaCount: 2

image:
repository: chanjin/plugin-jenkins-inven-collector
tag: latest
pullPolicy: IfNotPresent

service:
type: ClusterIP
port: 50051

ingress:
enabled: false
2 changes: 1 addition & 1 deletion src/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.10
0.0.11

0 comments on commit 70b8718

Please sign in to comment.