diff --git a/Makefile b/Makefile index ecbd85f..b962c4e 100644 --- a/Makefile +++ b/Makefile @@ -22,7 +22,22 @@ DOCKER_REPO_DEVSERVER ?= mq-devserver DOCKER_REPO_ADVANCEDSERVER ?= mq-advancedserver DOCKER_FULL_DEVSERVER = $(DOCKER_REPO_DEVSERVER):$(DOCKER_TAG) DOCKER_FULL_ADVANCEDSERVER = $(DOCKER_REPO_ADVANCEDSERVER):$(DOCKER_TAG) +# MQ_PACKAGES is the list of MQ packages to install MQ_PACKAGES ?=ibmmq-server ibmmq-java ibmmq-jre ibmmq-gskit ibmmq-msg-.* ibmmq-samples ibmmq-ams +# MQ_VERSION is the fully qualified MQ version number to build +MQ_VERSION ?= 9.0.4.0 +# Archive names for IBM MQ Continuous Delivery Release for Ubuntu +MQ_ARCHIVE_9.0.3.0_ppc64le=CNJR5ML.tar.gz +MQ_ARCHIVE_9.0.3.0_s390x=CNJR6ML.tar.gz +MQ_ARCHIVE_9.0.3.0_x86_64=CNJR7ML.tar.gz +MQ_ARCHIVE_9.0.4.0_ppc64le=CNLE2ML.tar.gz +MQ_ARCHIVE_9.0.4.0_s390x=CNLE3ML.tar.gz +MQ_ARCHIVE_9.0.4.0_x86_64=CNLE4ML.tar.gz +# Archive names for IBM MQ Advanced for Developers for Ubuntu +MQ_ARCHIVE_DEV_9.0.3.0=mqadv_dev903_ubuntu_x86-64.tar.gz +MQ_ARCHIVE_DEV_9.0.4.0=mqadv_dev904_ubuntu_x86-64.tar.gz +MQ_ARCHIVE ?= $(MQ_ARCHIVE_$(MQ_VERSION)_$(DOCKER_TAG_ARCH)) +MQ_ARCHIVE_DEV=$(MQ_ARCHIVE_DEV_$(MQ_VERSION)) # Options to `go test` for the Docker tests TEST_OPTS_DOCKER ?= # Options to `go test` for the Kubernetes tests @@ -49,13 +64,13 @@ clean: rm -rf ./build rm -rf ./deps -downloads/mqadv_dev904_ubuntu_x86-64.tar.gz: +downloads/$(MQ_ARCHIVE_DEV): $(info $(SPACER)$(shell printf $(TITLE)"Downloading IBM MQ Advanced for Developers"$(END))) mkdir -p downloads - cd downloads; curl -LO https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/messaging/mqadv/mqadv_dev904_ubuntu_x86-64.tar.gz + cd downloads; curl -LO https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/messaging/mqadv/$(MQ_ARCHIVE_DEV) .PHONY: downloads -downloads: downloads/mqadv_dev904_ubuntu_x86-64.tar.gz +downloads: downloads/$(MQ_ARCHIVE_DEV) .PHONY: deps deps: @@ -138,23 +153,20 @@ define docker-build-mq . ; $(DOCKER) kill $(BUILD_SERVER_CONTAINER) && $(DOCKER) network rm build endef -.PHONY: build-advancedserver-904 -build-advancedserver-904: downloads/CNLE4ML.tar.gz - $(info $(SPACER)$(shell printf $(TITLE)"Build $(DOCKER_FULL_ADVANCEDSERVER)"$(END))) - $(call docker-build-mq,$(DOCKER_FULL_ADVANCEDSERVER),Dockerfile-server,CNLE4ML.tar.gz,"4486e8c4cc9146fd9b3ce1f14a2dfc5b","IBM MQ Advanced","9.0.4") - $(DOCKER) tag $(DOCKER_FULL_ADVANCEDSERVER) $(DOCKER_REPO_ADVANCEDSERVER):9.0.4.0-$(DOCKER_TAG_ARCH) - .PHONY: build-advancedserver -build-advancedserver: build-advancedserver-904 +build-advancedserver: downloads/$(MQ_ARCHIVE) + $(info $(SPACER)$(shell printf $(TITLE)"Build $(DOCKER_FULL_ADVANCEDSERVER)"$(END))) + $(call docker-build-mq,$(DOCKER_FULL_ADVANCEDSERVER),Dockerfile-server,$(MQ_ARCHIVE),"4486e8c4cc9146fd9b3ce1f14a2dfc5b","IBM MQ Advanced",$(MQ_VERSION)) + $(DOCKER) tag $(DOCKER_FULL_ADVANCEDSERVER) $(DOCKER_REPO_ADVANCEDSERVER):$(MQ_VERSION)-$(DOCKER_TAG_ARCH) .PHONY: build-devserver -build-devserver: downloads/mqadv_dev904_ubuntu_x86-64.tar.gz +build-devserver: downloads/$(MQ_ARCHIVE_DEV) ifneq "x86_64" "$(shell uname -m)"     $(error MQ Advanced for Developers is only available for x86_64 architecture) else $(info $(shell printf $(TITLE)"Build $(DOCKER_FULL_DEVSERVER)"$(END))) - $(call docker-build-mq,$(DOCKER_FULL_DEVSERVER),Dockerfile-server,mqadv_dev904_ubuntu_x86-64.tar.gz,"98102d16795c4263ad9ca075190a2d4d","IBM MQ Advanced for Developers (Non-Warranted)","9.0.4") - $(DOCKER) tag $(DOCKER_FULL_DEVSERVER) $(DOCKER_REPO_DEVSERVER):9.0.4.0-$(DOCKER_TAG_ARCH) + $(call docker-build-mq,$(DOCKER_FULL_DEVSERVER),Dockerfile-server,$(MQ_ARCHIVE_DEV),"98102d16795c4263ad9ca075190a2d4d","IBM MQ Advanced for Developers (Non-Warranted)",$(MQ_VERSION)) + $(DOCKER) tag $(DOCKER_FULL_DEVSERVER) $(DOCKER_REPO_DEVSERVER):$(MQ_VERSION)-$(DOCKER_TAG_ARCH) endif .PHONY: build-advancedserver-cover @@ -166,7 +178,7 @@ build-advancedserver-cover: # $(call docker-build-mq,mq-web:latest-$(DOCKER_TAG_ARCH),Dockerfile-mq-web) .PHONY: build-explorer -build-explorer: downloads/mqadv_dev904_ubuntu_x86-64.tar.gz - $(call docker-build-mq,mq-explorer:latest-$(DOCKER_TAG_ARCH),incubating/mq-explorer/Dockerfile-mq-explorer,mqadv_dev904_ubuntu_x86-64.tar.gz,"98102d16795c4263ad9ca075190a2d4d","IBM MQ Advanced for Developers (Non-Warranted)","9.0.4") +build-explorer: downloads/$(MQ_ARCHIVE_DEV) + $(call docker-build-mq,mq-explorer:latest-$(DOCKER_TAG_ARCH),incubating/mq-explorer/Dockerfile-mq-explorer,$(MQ_ARCHIVE_DEV),"98102d16795c4263ad9ca075190a2d4d","IBM MQ Advanced for Developers (Non-Warranted)",$(MQ_VERSION)) include formatting.mk diff --git a/docs/developing.md b/docs/developing.md index 048c522..20bd753 100644 --- a/docs/developing.md +++ b/docs/developing.md @@ -13,19 +13,32 @@ You need to ensure you have the following tools installed: For running the Kubernetes tests, a Kubernetes environment is needed, for example [Minikube](https://github.com/kubernetes/minikube) or [IBM Cloud Private](https://www.ibm.com/cloud-computing/products/ibm-cloud-private/). ## Building a production image +This procedure works for building the MQ Continuous Delivery release, on `x86_64`, `ppc64le` and `s390x` architectures. -1. Download MQ from IBM Passport Advantage, and place the downloaded file (for example, `CNLE4ML.tar.gz` for MQ V9.0.4) in the `downloads` directory +1. Download MQ from IBM Passport Advantage, and place the downloaded file (for example, `CNLE4ML.tar.gz` for MQ V9.0.4 on x86_64 architecture) in the `downloads` directory 2. Run `make build-advancedserver` +You can build a different version of MQ by setting the `MQ_VERSION` environment variable, for example: + +```bash +MQ_VERSION=9.0.3.0 make build-advancedserver +``` + ## Running the tests There are three main sets of tests: -1. Unit tests +1. Unit tests, which are run during a build 2. Docker tests, which test a complete Docker image, using the Docker API 3. Kubernetes tests, which test the Helm charts (and the Docker image) via [Helm](https://helm.sh) -### Running the tests -The unit and Docker tests can be run locally. For example: +### Running the Docker tests +The Docker tests can be run locally. Before you run them for the first time, you need to download the test dependencies: + +``` +make deps +``` + +You can then run the tests, for example: ``` make test-devserver @@ -37,7 +50,7 @@ or: make test-advancedserver ``` -### Running the tests with code coverage +### Running the Docker tests with code coverage You can produce code coverage results from the Docker tests by running the following: ```