Skip to content

Commit

Permalink
Release V0.1.0 (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
zulfilee authored Aug 6, 2021
1 parent 2e43282 commit 23acd16
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 16 deletions.
27 changes: 15 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,28 +43,28 @@ endif
all: manager

# Run tests
test: generate fmt vet manifests
test: generate fmt vet manifests ## Run unit tests
# TODO bring back
go test ./... -coverprofile cover.out

# Build manager binary
manager: generate fmt vet
manager: generate fmt vet ## Build manager binary
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
install: manifests ## Install CRDs into a cluster
kustomize build config/crd | kubectl apply -f -

# Uninstall CRDs from a cluster
uninstall: manifests
uninstall: manifests ## Uninstall CRDs from a cluster
kustomize build config/crd | kubectl delete -f -

# Deploy controller in the configured Kubernetes cluster in ~/.kube/config
deploy: manifests
deploy: manifests ## Deploy controller in the configured Kubernetes cluster
cd config/manager && kustomize edit set image controller=${IMG}
kustomize build config/default | kubectl apply -f -

Expand Down Expand Up @@ -104,19 +104,19 @@ dev-manifests:
cp metadata.yaml $(DEV_DIR)/metadata.yaml

# Generate manifests e.g. CRD, RBAC etc.
manifests: $(CONTROLLER_GEN) $(MANIFEST_DIR) $(KUSTOMIZE) $(BUILD_DIR)
manifests: $(CONTROLLER_GEN) $(MANIFEST_DIR) $(KUSTOMIZE) $(BUILD_DIR) ## Generate manifests e.g. CRD, RBAC etc.
rm -rf $(BUILD_DIR)/config
cp -R config $(BUILD_DIR)/config
sed -i'' -e 's@imagePullPolicy: .*@imagePullPolicy: '"$(PULL_POLICY)"'@' $(BUILD_DIR)/config/default/manager_pull_policy.yaml
sed -i'' -e 's@image: .*@image: '"$(IMAGE)"'@' $(BUILD_DIR)/config/default/manager_image_patch.yaml
"$(KUSTOMIZE)" build $(BUILD_DIR)/config/default > $(MANIFEST_DIR)/infrastructure-components.yaml

# Run go fmt against code
fmt:
fmt: ## Run go fmt against code
go fmt ./...

# Run go vet against code
vet:
vet: ## Run go vet against code
go vet ./...

# Generate code
Expand All @@ -127,7 +127,7 @@ generate: $(CONTROLLER_GEN)
generate-go:
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."

generate-manifests:
generate-manifests: ## Generate manifests
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases


Expand All @@ -136,10 +136,10 @@ docker-build: test
docker build . -t ${IMG}

# Push the docker image
docker-push:
docker-push: ## Push the docker image to gcr
docker push ${IMG}

docker-rmi:
docker-rmi: ## Remove the docker image locally
docker rmi ${IMG}

mock: $(MOCKGEN)
Expand All @@ -149,5 +149,8 @@ clean-release:
rm -rf $(RELEASE_DIR)

release: release-manifests
$(MAKE) docker-build IMG=$(RELEASE_CONTROLLER_IMG):$(VERSION)
# $(MAKE) docker-build IMG=$(RELEASE_CONTROLLER_IMG):$(VERSION)
$(MAKE) docker-push IMG=$(RELEASE_CONTROLLER_IMG):$(VERSION)

version: ## Prints version of current make
@echo $(VERSION)
2 changes: 1 addition & 1 deletion clusterctl-settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"name": "infrastructure-maas",
"config": {
"componentsFile": "infrastructure-components.yaml",
"nextVersion": "v0.0.1"
"nextVersion": "v0.1.0"
}
}
10 changes: 10 additions & 0 deletions prow/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,16 @@ build_code() {
fi
}

make_release() {
print_step "Release Build"
make release

print_step "Copy manifests to artifacts"
if [[ -d _build/release ]]; then
gsutil cp -r _build/release ${ARTIFACTS}/manifests/release
fi
}

run_tests() {
print_step "Running Tests"
make test
Expand Down
4 changes: 1 addition & 3 deletions prow/release_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ set -x
check_pre_released
build_code

create_images
create_manifest ${REPO_NAME}
create_release_manifest
make_release

delete_images
exit 0

0 comments on commit 23acd16

Please sign in to comment.