Move dev deploy script to Makefile
This commit is contained in:
parent
065825c12d
commit
d4b9e17800
|
@ -42,8 +42,10 @@ jobs:
|
||||||
- name: Run smoke tests
|
- name: Run smoke tests
|
||||||
run: |
|
run: |
|
||||||
kubectl apply -f ./config/samples
|
kubectl apply -f ./config/samples
|
||||||
|
kubectl -n sourcer-system rollout status deploy/sourcer-controller --timeout=1m
|
||||||
kubectl wait gitrepository/podinfo --for=condition=ready --timeout=1m
|
kubectl wait gitrepository/podinfo --for=condition=ready --timeout=1m
|
||||||
kubectl wait helmrepository/podinfo --for=condition=ready --timeout=1m
|
kubectl wait helmrepository/podinfo --for=condition=ready --timeout=1m
|
||||||
|
kubectl -n sourcer-system logs deploy/sourcer-controller
|
||||||
- name: Debug failure
|
- name: Debug failure
|
||||||
if: failure()
|
if: failure()
|
||||||
run: |
|
run: |
|
||||||
|
|
|
@ -14,4 +14,3 @@
|
||||||
# Dependency directories (remove the comment below to include it)
|
# Dependency directories (remove the comment below to include it)
|
||||||
# vendor/
|
# vendor/
|
||||||
bin/
|
bin/
|
||||||
tmp/
|
|
10
Makefile
10
Makefile
|
@ -40,7 +40,10 @@ deploy: manifests
|
||||||
|
|
||||||
# Deploy controller dev image in the configured Kubernetes cluster in ~/.kube/config
|
# Deploy controller dev image in the configured Kubernetes cluster in ~/.kube/config
|
||||||
dev-deploy: manifests
|
dev-deploy: manifests
|
||||||
./hack/dev-deploy.sh $(IMG)
|
mkdir -p config/dev && cp config/default/* config/dev
|
||||||
|
cd config/dev && kustomize edit set image fluxcd/sourcer=${IMG}
|
||||||
|
kustomize build config/dev | kubectl apply -f -
|
||||||
|
rm -rf config/dev
|
||||||
|
|
||||||
# Generate manifests e.g. CRD, RBAC etc.
|
# Generate manifests e.g. CRD, RBAC etc.
|
||||||
manifests: controller-gen
|
manifests: controller-gen
|
||||||
|
@ -66,8 +69,7 @@ docker-build: test
|
||||||
docker-push:
|
docker-push:
|
||||||
docker push ${IMG}
|
docker push ${IMG}
|
||||||
|
|
||||||
# find or download controller-gen
|
# Find or download controller-gen
|
||||||
# download controller-gen if necessary
|
|
||||||
controller-gen:
|
controller-gen:
|
||||||
ifeq (, $(shell which controller-gen))
|
ifeq (, $(shell which controller-gen))
|
||||||
@{ \
|
@{ \
|
||||||
|
@ -82,5 +84,3 @@ CONTROLLER_GEN=$(GOBIN)/controller-gen
|
||||||
else
|
else
|
||||||
CONTROLLER_GEN=$(shell which controller-gen)
|
CONTROLLER_GEN=$(shell which controller-gen)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,24 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -o errexit
|
|
||||||
|
|
||||||
IMG=$1
|
|
||||||
TMP_DIR="$(git rev-parse --show-toplevel)/tmp"
|
|
||||||
|
|
||||||
mkdir -p ${TMP_DIR}
|
|
||||||
|
|
||||||
cat << EOF | tee ${TMP_DIR}/kustomization.yaml
|
|
||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
|
||||||
kind: Kustomization
|
|
||||||
namespace: sourcer-system
|
|
||||||
namePrefix: sourcer-
|
|
||||||
bases:
|
|
||||||
- ../config/crd
|
|
||||||
- ../config/rbac
|
|
||||||
- ../config/manager
|
|
||||||
EOF
|
|
||||||
|
|
||||||
cd ${TMP_DIR} && kustomize edit set image fluxcd/sourcer=${IMG}
|
|
||||||
kustomize build ${TMP_DIR} | kubectl apply -f -
|
|
||||||
rm -rf ${TMP_DIR}
|
|
||||||
kubectl -n sourcer-system rollout status deploy/sourcer-controller --timeout=1m
|
|
Loading…
Reference in New Issue