Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate Image Streams #4

Merged
merged 9 commits into from
Mar 6, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions openshift/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
.PHONY: all imagestream buildconfig deploy route help
.DEFAULT_GOAL := help

MKFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
THISDIR_PATH := $(patsubst %/,%,$(abspath $(dir $(MKFILE_PATH))))

all: imagestream buildconfig deploy route

imagestream: ## Create the Imagestreams (APIcast and Builder APICast).
oc create -f $(THISDIR_PATH)/01-apicast-cloud-hosted-imagestream.yml
oc create -f $(THISDIR_PATH)/02-apicast-builder-imagestream.yml

buildconfig: ## Create the BuildConfig.
oc create -f $(THISDIR_PATH)/03-build-config.yml

deploy: ## Create the BuildConfig. Parameters: RELEASE_REF, ENVIRONMENT, CACHE_TTL.
oc new-app -f $(THISDIR_PATH)/04-deployment-template.yml \
-p RELEASE_REF=${RELEASE_REF} \
-p ENVIRONMENT=${ENVIRONMENT} \
-p CACHE_TTL=${CACHE_TTL}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this crash when CACHE_TTL is empty? It should.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes it crashes because there is no predefined value in the template.

Actually it brakes without RELEASE_REF AND ENVIRONMENT also.

The actuall error message:

oc new-app -f /Users/dcesario/src/apicast-cloud-hosted/openshift/04-deployment-template.yml \
		-p RELEASE_REF=test-dani3 \
		-p ENVIRONMENT=staging \
		-p CACHE_TTL=
error: error processing template "apicast-staging/apicast-cloud-hosted-deployment": Template "apicast-cloud-hosted-deployment" is invalid: template.parameters[2]: Required value: template.parameters[2]: parameter CACHE_TTL is required and must be specified
make: *** [deploy] Error 1

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍


route: ## Create the Routes.Parameters: WILDCARD_DOMAIN, ENVIRONMENT.
oc new-app -f $(THISDIR_PATH)/05-routes.yml \
-p ENVIRONMENT=${ENVIRONMENT} \
-p WILDCARD_DOMAIN=${WILDCARD_DOMAIN}

help: ## Print this help
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
5 changes: 4 additions & 1 deletion openshift/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@
1. `oc create -f secret.yml`
1. `oc secrets add serviceaccount/default secrets/3scale-openshift-pull-secret --for=pull`
1. `oc secret new-basicauth master-access-token-secret --password=MASTER_ACCESS_TOKEN`
1. `oc new-app -f openshift/template.yml` (with `-p ENVIRONMENT=production -p CACHE_TTL=300` for production or `-p ENVIRONMENT=staging -p CACHE_TTL=0` for staging)
1. `make imagestream` to deploy the imageStreams (Apicast Cloud Hosted and Apicast Builder)
1. `make buildconfig` to create the BuildConfig
1. `make deploy RELEASE_REF=release_number ENVIRONMENT=staging CACHE_TTL=0` - (with `ENVIRONMENT=production CACHE_TTL=300` for production or `ENVIRONMENT=staging CACHE_TTL=0` for staging)
1. `make route ENVIRONMENT=staging WILDCARD_DOMAIN=cluster.wildcard.domain.com` - Wildcard Domain Concatenation: `apicast.${ENVIRONMENT}.${WILDCARD_DOMAIN}`