Skip to content

Commit

Permalink
added github actions for the devenv operator
Browse files Browse the repository at this point in the history
  • Loading branch information
adityajoshi12 committed Dec 29, 2024
1 parent a933a3c commit 1bda74d
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 16 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/developer-environment-operator.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build Developer Environment Operator
on:
push:
branches:
- main
paths:
- 'devenv-operator/**'
pull_request:
branches:
- main
paths:
- 'devenv-operator/**'
workflow_dispatch:
defaults:
run:
working-directory: devenv-operator
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.22'
- run: pwd
- name: Build
run: make build
- name: Test
run: go test ./... -coverprofile cover.out
- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push image
run: make docker-build docker-push



2 changes: 1 addition & 1 deletion devenv-operator/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.20 as builder
FROM golang:1.22 as builder
ARG TARGETOS
ARG TARGETARCH

Expand Down
2 changes: 1 addition & 1 deletion devenv-operator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ endif
OPERATOR_SDK_VERSION ?= v1.33.0

# Image URL to use all building/pushing image targets
IMG ?= controller:latest
IMG ?= ghcr.io/adityajoshi12/devenv-operator:0.1
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
ENVTEST_K8S_VERSION = 1.27.1

Expand Down
25 changes: 11 additions & 14 deletions devenv-operator/start.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
#!/usr/bin/env bash

#kind create cluster --config kind-config.yaml
#sleep 10

#kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/kind/deploy.yaml

#kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.16.2/cert-manager.yaml
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/refs/heads/main/deploy/static/provider/do/deploy.yaml
kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.16.2/cert-manager.yaml

#kubectl patch deployment ingress-nginx-controller -n ingress-nginx --type=json -p='[{"op": "remove", "path": "/spec/template/spec/tolerations"}]'
#kubectl patch deployment ingress-nginx-controller -n ingress-nginx --type=json -p='[{"op": "remove", "path": "/spec/template/spec/nodeSelector"}]'
#
#
#echo "127.0.0.1 echoserver.local" | sudo tee -a /etc/hosts
# when running in KindCluster
if [ -z "$1" ]; then
kind create cluster --config kind-config.yaml
sleep 10
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/kind/deploy.yaml
kubectl patch deployment ingress-nginx-controller -n ingress-nginx --type=json -p='[{"op": "remove", "path": "/spec/template/spec/tolerations"}]'
kubectl patch deployment ingress-nginx-controller -n ingress-nginx --type=json -p='[{"op": "remove", "path": "/spec/template/spec/nodeSelector"}]'
else
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/refs/heads/main/deploy/static/provider/do/deploy.yaml
kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.16.2/cert-manager.yaml
fi

0 comments on commit 1bda74d

Please sign in to comment.