orkestra/Makefile

86 строки
2.1 KiB
Makefile
Исходник Обычный вид История

# Image URL to use all building/pushing image targets
Merge dev branch into main (#36) * feat: Initialise application controller with chart pull & push functionality (#16) * feat: init application reconciler Signed-off-by: Kush Trivedi <kushthedude@gmail.com> * use controller-gen 0.2.9 Signed-off-by: Kush Trivedi <kushthedude@gmail.com> * fix:ci Signed-off-by: Kush Trivedi <kushthedude@gmail.com> * chore: introduct groupName Signed-off-by: Kush Trivedi <kushthedude@gmail.com> * feat: add groupID Signed-off-by: Kush Trivedi <kushthedude@gmail.com> * feat: add fetch function Signed-off-by: Kush Trivedi <kushthedude@gmail.com> * feat: add fetch function Signed-off-by: Kush Trivedi <kushthedude@gmail.com> * add test for AB#13 Signed-off-by: Kush Trivedi <kushthedude@gmail.com> * initiate push logic Signed-off-by: Kush Trivedi <kushthedude@gmail.com> * chore: complete push function Signed-off-by: Kush Trivedi <kushthedude@gmail.com> * chore: add configuration Signed-off-by: Kush Trivedi <kushthedude@gmail.com> * fix: golangcilint and tests Signed-off-by: Kush Trivedi <kushthedude@gmail.com> * chore: change branch name pattern to dev (#23) * retrigger pipeline Signed-off-by: Kush Trivedi <kushthedude@gmail.com> * Nitishm/feature/ab#15/appgroup reconciler scaffold (#25) * Add PUML sequence diagrams Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * Setup azure-pipeline for Go Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * feat: Scaffolding for application group reconciler Created the reconciler method for ApplicationGroup controller Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> Added reconciler lookup functionality Base functionality of application reconciler. Still needs the generation functions for Argo Workflow object. Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> Workflow interface and appgroup reconciler features Added a bunch of changes to this commit: - Created a Workflow engine interface to support any type of workflow engine - Added logic to appgroup_reconciler. Mostly WIP but sets the skeleton for the upcoming commits. Fixes ab#21 Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> feat: AppGroup reconciler update TODO: - Generate the HelmRelease object - Set the executor template Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> feat: ApplicationGroup first pass dev complete - Needs more unit tests - Not yet fit for usage Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> Added unit tests (incomplete WIP) WIP UTs for ApplicationGroup functions: Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * Fix go.mod errors (#26) * Add PUML sequence diagrams Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * Setup azure-pipeline for Go Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * chore: change branch name pattern to dev (#23) * Fix go.mod dependencies go.mod was failing to resolve dependencies Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> Co-authored-by: Kush Trivedi <44091822+kushthedude@users.noreply.github.com> * Application and ApplicationReconciler and supported packages into dev branch (#28) * Add PUML sequence diagrams Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * Setup azure-pipeline for Go Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * chore: change branch name pattern to dev (#23) * Fix go.mod dependencies go.mod was failing to resolve dependencies Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * Add additional tests for Argo.go functions Added more test and test cases Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * Updated status field for application type Made Chartstatus inline so that we reference it under obj.status instead of obj.status.status which causes stutter Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * Created registry Client and related methods - Modifications to rest of the code tree to support registry client Still a WIP Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * New configurer and additional controller members Added new members to Application and ApplicationGroup controller objects Refactored the controller Config struct Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * feat: Restructuring w/ major changes Bunch of changes to the controller and reconciler Updated configurer and config.yaml format Changes to application and applicationgroup CRD Status fields Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> Co-authored-by: Kush Trivedi <44091822+kushthedude@users.noreply.github.com> * Nitishm/feat/chart/push (#31) * Add PUML sequence diagrams Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * Setup azure-pipeline for Go Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * chore: change branch name pattern to dev (#23) * Fix go.mod dependencies go.mod was failing to resolve dependencies Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * Add additional tests for Argo.go functions Added more test and test cases Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * Updated status field for application type Made Chartstatus inline so that we reference it under obj.status instead of obj.status.status which causes stutter Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * Created registry Client and related methods - Modifications to rest of the code tree to support registry client Still a WIP Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * New configurer and additional controller members Added new members to Application and ApplicationGroup controller objects Refactored the controller Config struct Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * feat: Restructuring w/ major changes Bunch of changes to the controller and reconciler Updated configurer and config.yaml format Changes to application and applicationgroup CRD Status fields Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * Update orkestra-core illustration (#30) * Add PUML sequence diagrams Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * Setup azure-pipeline for Go Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * Update diagram and switch harbor for chartmuseum Update the orkestra-core diagram replacing harbor for chartmuseum Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * feat: Implemented the Push functionlity Verfied manually that charts get uploaded to the staging directory Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * bug: resolve merge errors Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> Co-authored-by: Kush Trivedi <44091822+kushthedude@users.noreply.github.com> * Fixed lint errors and test failures (#33) * Add PUML sequence diagrams Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * Setup azure-pipeline for Go Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * chore: change branch name pattern to dev (#23) * Fix go.mod dependencies go.mod was failing to resolve dependencies Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * Add additional tests for Argo.go functions Added more test and test cases Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * Updated status field for application type Made Chartstatus inline so that we reference it under obj.status instead of obj.status.status which causes stutter Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * Created registry Client and related methods - Modifications to rest of the code tree to support registry client Still a WIP Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * New configurer and additional controller members Added new members to Application and ApplicationGroup controller objects Refactored the controller Config struct Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * feat: Restructuring w/ major changes Bunch of changes to the controller and reconciler Updated configurer and config.yaml format Changes to application and applicationgroup CRD Status fields Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * Update orkestra-core illustration (#30) * Add PUML sequence diagrams Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * Setup azure-pipeline for Go Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * Update diagram and switch harbor for chartmuseum Update the orkestra-core diagram replacing harbor for chartmuseum Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * feat: Implemented the Push functionlity Verfied manually that charts get uploaded to the staging directory Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * bug: resolve merge errors Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * feat: Modifications and enhanced argo logic - Multiple changes in argo object to support generation of valid workflow - Added overlays field to Applications CR as a workaround for https://github.com/kubernetes/kubernetes/issues/98683 - Helm chart for orkestra init. All dependency charts helm-operator, chartmuseum, argo added to chart dependencies. - Update main.go Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * Fix lint and argo_test errors Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> Co-authored-by: Kush Trivedi <44091822+kushthedude@users.noreply.github.com> * chore: Update docker targets in Make and comment cleanup (#34) * Add PUML sequence diagrams Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * Setup azure-pipeline for Go Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * chore: change branch name pattern to dev (#23) * Fix go.mod dependencies go.mod was failing to resolve dependencies Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * Add additional tests for Argo.go functions Added more test and test cases Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * Updated status field for application type Made Chartstatus inline so that we reference it under obj.status instead of obj.status.status which causes stutter Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * Created registry Client and related methods - Modifications to rest of the code tree to support registry client Still a WIP Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * New configurer and additional controller members Added new members to Application and ApplicationGroup controller objects Refactored the controller Config struct Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * feat: Restructuring w/ major changes Bunch of changes to the controller and reconciler Updated configurer and config.yaml format Changes to application and applicationgroup CRD Status fields Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * Update orkestra-core illustration (#30) * Add PUML sequence diagrams Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * Setup azure-pipeline for Go Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * Update diagram and switch harbor for chartmuseum Update the orkestra-core diagram replacing harbor for chartmuseum Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * feat: Implemented the Push functionlity Verfied manually that charts get uploaded to the staging directory Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * bug: resolve merge errors Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * feat: Modifications and enhanced argo logic - Multiple changes in argo object to support generation of valid workflow - Added overlays field to Applications CR as a workaround for https://github.com/kubernetes/kubernetes/issues/98683 - Helm chart for orkestra init. All dependency charts helm-operator, chartmuseum, argo added to chart dependencies. - Update main.go Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * Fix lint and argo_test errors Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * Docker target changes and TODO comment cleanup Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> Co-authored-by: Kush Trivedi <44091822+kushthedude@users.noreply.github.com> * [chore] Helm chart for orkestra and relevant changes (#35) * Add PUML sequence diagrams Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * Setup azure-pipeline for Go Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * chore: change branch name pattern to dev (#23) * Fix go.mod dependencies go.mod was failing to resolve dependencies Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * Add additional tests for Argo.go functions Added more test and test cases Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * Updated status field for application type Made Chartstatus inline so that we reference it under obj.status instead of obj.status.status which causes stutter Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * Created registry Client and related methods - Modifications to rest of the code tree to support registry client Still a WIP Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * New configurer and additional controller members Added new members to Application and ApplicationGroup controller objects Refactored the controller Config struct Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * feat: Restructuring w/ major changes Bunch of changes to the controller and reconciler Updated configurer and config.yaml format Changes to application and applicationgroup CRD Status fields Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * Update orkestra-core illustration (#30) * Add PUML sequence diagrams Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * Setup azure-pipeline for Go Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * Update diagram and switch harbor for chartmuseum Update the orkestra-core diagram replacing harbor for chartmuseum Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * feat: Implemented the Push functionlity Verfied manually that charts get uploaded to the staging directory Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * bug: resolve merge errors Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * feat: Modifications and enhanced argo logic - Multiple changes in argo object to support generation of valid workflow - Added overlays field to Applications CR as a workaround for https://github.com/kubernetes/kubernetes/issues/98683 - Helm chart for orkestra init. All dependency charts helm-operator, chartmuseum, argo added to chart dependencies. - Update main.go Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * Fix lint and argo_test errors Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * Docker target changes and TODO comment cleanup Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * Helm chart for orkestra and related changes - Created the helm chart for orkestra - Made relevant changes based on feedback from running it on the cluster Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * Create example dir and edits to README.md Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * Update example and set ownersreference for helmrelease Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * Fix argo tests failures from previous set of changes Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> * Fix lint error in argo test Signed-off-by: Nitish Malhotra <nitish.malhotra@gmail.com> Co-authored-by: Kush Trivedi <44091822+kushthedude@users.noreply.github.com> Co-authored-by: Kush Trivedi <44091822+kushthedude@users.noreply.github.com>
2021-02-03 05:49:42 +03:00
IMG ?= azureorkestra/orkestra:latest
# Produce CRDs that work back to Kubernetes 1.11 (no version conversion)
CRD_OPTIONS ?= "crd:trivialVersions=true"
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
GOBIN=$(shell go env GOPATH)/bin
else
GOBIN=$(shell go env GOBIN)
endif
all: manager
# Run tests
test: generate fmt vet manifests
go test ./... -coverprofile cover.out
# Build manager binary
manager: generate fmt vet
go build -o bin/manager main.go
# Run against the configured Kubernetes cluster in ~/.kube/config
run: generate fmt vet manifests
go run ./main.go
# Install CRDs into a cluster
install: manifests
kustomize build config/crd | kubectl apply -f -
# Uninstall CRDs from a cluster
uninstall: manifests
kustomize build config/crd | kubectl delete -f -
# Deploy controller in the configured Kubernetes cluster in ~/.kube/config
deploy: manifests
cd config/manager && kustomize edit set image controller=${IMG}
kustomize build config/default | kubectl apply -f -
# Generate manifests e.g. CRD, RBAC etc.
manifests: controller-gen
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases
# Run go fmt against code
fmt:
go fmt ./...
# Run go vet against code
vet:
go vet ./...
# Generate code
generate: controller-gen
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."
# Build the docker image
docker-build: test
docker build . -t ${IMG}
# Push the docker image
docker-push:
docker push ${IMG}
# setup kubebuilder
setup-kubebuilder:
bash scripts/setup-envtest.sh;
bash scripts/setup-kubebuilder.sh
# find or download controller-gen
# download controller-gen if necessary
controller-gen:
ifeq (, $(shell which controller-gen))
@{ \
set -e ;\
CONTROLLER_GEN_TMP_DIR=$$(mktemp -d) ;\
cd $$CONTROLLER_GEN_TMP_DIR ;\
go mod init tmp ;\
go get sigs.k8s.io/controller-tools/cmd/controller-gen@v0.4.1 ;\
rm -rf $$CONTROLLER_GEN_TMP_DIR ;\
}
CONTROLLER_GEN=$(GOBIN)/controller-gen
else
CONTROLLER_GEN=$(shell which controller-gen)
endif