Skip to content

Commit

Permalink
rename image, update ci
Browse files Browse the repository at this point in the history
  • Loading branch information
clbx committed May 27, 2024
1 parent 03454ad commit 8e657fc
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 11 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/build-images.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Build Image

on:
push:
paths:
- Dockerfiles/**

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/build-push-action@v5
with:
context: Dockerfiles
file: ./Dockerfile
push: true
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/kubectl-browse-pvc:develop
${{ secrets.DOCKERHUB_USERNAME }}/kubectl-browse-pvc:${{ github.sha }}
4 changes: 2 additions & 2 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
run: chmod +x ./kubectl-browse-pvc

- name: Upload Artifact
uses: actions/upload-artifact@v3.1.3
uses: actions/upload-artifact@v4
with:
name: kubectl-browse-pvc-darwin
path: |
Expand All @@ -48,7 +48,7 @@ jobs:
run: chmod +x ./kubectl-browse-pvc

- name: Upload Artifact
uses: actions/upload-artifact@v3.1.3
uses: actions/upload-artifact@v4
with:
name: kubectl-browse-pvc-linux
path: |
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,27 @@ jobs:
path: |
./kubectl-browse-pvc
LICENSE
build-image:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/build-push-action@v5
with:
context: Dockerfiles
file: ./Dockerfile
push: true
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/kubectl-browse-pvc:latest
${{ secrets.DOCKERHUB_USERNAME }}/kubectl-browse-pvc:${{ github.ref_name }}
create-release:
runs-on: ubuntu-latest
needs: [build-darwin, build-linux]
Expand Down
6 changes: 2 additions & 4 deletions Dockerfiles/editor.Dockerfile → Dockerfiles/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
# PVCB Editor Dockerfile
FROM --platform=amd64 alpine

LABEL image="clbx/pvcb-editor"
LABEL org.opencontainers.image.source = "https://github.com/clbx/pvcb"
LABEL image="clbx/kubectl-browse-pvc"
LABEL org.opencontainers.image.source = "https://github.com/clbx/kubectl-browse-pvc"

RUN apk update
RUN apk add vim bash shadow



COPY entrypoint.sh /entrypoint.sh
12 changes: 7 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,25 @@ import (
)

var image string
var Version string

func main() {

var kubeConfigFlags = genericclioptions.NewConfigFlags(true)

var rootCmd = &cobra.Command{
Use: "kubectl-browse-pvc",
Short: "Kubernetes PVC Browser",
Long: `Kubernetes PVC Browser`,
Args: cobra.MinimumNArgs(1),
Use: "kubectl-browse-pvc",
Short: "Kubernetes PVC Browser",
Long: `Kubernetes PVC Browser`,
Version: Version,
Args: cobra.MinimumNArgs(1),
Run: func(cmd *cobra.Command, args []string) {
pvcName := args[0]
browseCommand(kubeConfigFlags, pvcName)
},
}

rootCmd.Flags().StringVarP(&image, "image", "i", "clbx/pvcb-edit", "Image to mount job to")
rootCmd.Flags().StringVarP(&image, "image", "i", "clbx/kubectl-browse-pvc", "Image to mount job to")
kubeConfigFlags.AddFlags(rootCmd.Flags())

if err := rootCmd.Execute(); err != nil {
Expand Down

0 comments on commit 8e657fc

Please sign in to comment.