Skip to content

Commit e291374

Browse files
dselvara1GitHub Enterprise
authored andcommitted
Merge pull request #734 from mq-cloudpak/sdp-9406-mq-download
Add base mq download script
2 parents f14fdba + 1ca4838 commit e291374

File tree

2 files changed

+49
-2
lines changed

2 files changed

+49
-2
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ else
251251
ifneq "$(MQ_ARCHIVE_REPOSITORY_DEV)" "$(EMPTY)"
252252
curl --fail --user $(MQ_ARCHIVE_REPOSITORY_USER):$(MQ_ARCHIVE_REPOSITORY_CREDENTIAL) --request GET "$(MQ_ARCHIVE_REPOSITORY_DEV)" --output downloads/$(MQ_ARCHIVE_DEV)
253253
else
254-
curl --fail --location https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/messaging/mqadv/$(MQ_ARCHIVE_DEV) --output downloads/$(MQ_ARCHIVE_DEV)
254+
./download-basemq.sh -r $(MQ_ARCHIVE_DEV) -v $(MQ_VERSION_VRM)
255255
endif
256256
endif
257257

@@ -576,4 +576,4 @@ ifneq (,$(findstring docker,$(COMMAND)))
576576
endif
577577
ifneq (,$(findstring podman,$(COMMAND)))
578578
@test "$(word 1,$(subst ., ,$(PODMAN_VERSION)))" -ge "1" || (echo "Error: Podman version 1.0 or greater is required" && exit 1)
579-
endif
579+
endif

download-basemq.sh

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/bin/bash
2+
3+
# © Copyright IBM Corporation 2024
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
while getopts r:v: flag
18+
do
19+
case "${flag}" in
20+
r) MQ_ARCHIVE_DEV=${OPTARG};;
21+
v) MQ_VERSION_VRM=${OPTARG};;
22+
esac
23+
done
24+
25+
if [[ -z $MQ_ARCHIVE_DEV || -z $MQ_VERSION_VRM ]] ; then
26+
printf "${ERROR}MQ driver download script parameters missing!${END}\n"
27+
exit 1
28+
fi
29+
30+
BASE_MQ_LOCATION="https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/messaging/mqadv"
31+
32+
FILE_FOUND=$(curl -I $BASE_MQ_LOCATION/$MQ_ARCHIVE_DEV -w "%{http_code}" -s -o /dev/null)
33+
34+
if [ "$FILE_FOUND" -eq 200 ]; then
35+
curl --fail --location $BASE_MQ_LOCATION/$MQ_ARCHIVE_DEV --output downloads/"$MQ_ARCHIVE_DEV"
36+
37+
elif [ "$FILE_FOUND" -eq 404 ]; then
38+
curl -s --list-only --location $BASE_MQ_LOCATION | sed 's/href=/\nhref=/g' |grep href=\" |sed 's/.*href="//g;s/".*//g' > downloads/base-mq-file-list.txt
39+
echo "$MQ_ARCHIVE_DEV is not available at $BASE_MQ_LOCATION" && echo "================================================="
40+
grep "$MQ_VERSION_VRM" downloads/base-mq-file-list.txt| grep "IBM-MQ-" && echo "=================================================" && echo "$MQ_VERSION_VRM images available in the download site are listed above"
41+
echo "Choose any of the available version and run build command for example,'MQ_VERSION=9.4.0.0 make build-devserver'"
42+
rm -f downloads/base-mq-file-list.txt
43+
exit 1
44+
else
45+
echo "Unexpected error when downloading MQ driver from $BASE_MQ_LOCATION"
46+
exit 1
47+
fi

0 commit comments

Comments
 (0)