This repository was archived by the owner on Mar 22, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +11
-10
lines changed
Expand file tree Collapse file tree 2 files changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -49,20 +49,20 @@ function usage {
4949 " current directory."
5050}
5151
52- # Check if the first and second argument is nonempty
53- if [[ -z " $1 " || -z " $2 " ]]; then
52+ echo " Check if the first and second argument are nonempty: \" ${1} \" , \" ${2} \" "
53+ if [[ -z " ${1} " || -z " ${2} " ]]; then
5454 usage
5555 exit 1
5656fi
5757
58- # Check if the file Dockerfile.OS-VER exists
58+ echo " Check if the file Dockerfile.${1} - ${2} exists"
5959if [[ ! -f " Dockerfile.$2 " ]]; then
6060 echo " ERROR: wrong argument."
6161 usage
6262 exit 1
6363fi
6464
65- # Build a Docker image tagged with ${DOCKERHUB_REPO}:1.6-OS-VER
65+ echo " Build a Docker image tagged with ${DOCKERHUB_REPO} :1.6-${1} - ${2} "
6666docker build -t $1 :1.6-$2 \
6767 --build-arg http_proxy=$http_proxy \
6868 --build-arg https_proxy=$https_proxy \
Original file line number Diff line number Diff line change @@ -49,23 +49,24 @@ function usage {
4949 " locally."
5050}
5151
52- # Check if the first argument is nonempty
53- if [[ -z " $1 " ]]; then
52+ OS__OS_VER=${1}
53+ echo " Check if the first argument (OS-VER) is nonempty: \" ${OS__OS_VER} \" "
54+ if [[ -z " ${OS__OS_VER} " ]]; then
5455 usage
5556 exit 1
5657fi
5758
58- # Check if the image tagged with ${DOCKERHUB_REPO}:1.6-OS-VER exists locally
59- if [[ ! $( docker images -a | awk -v pattern=" ^${DOCKERHUB_REPO} :1.6-$1 \$ " \
59+ echo " Check if the image tagged with ${DOCKERHUB_REPO} :1.6-${OS__OS_VER} exists locally"
60+ if [[ ! $( docker images -a | awk -v pattern=" ^${DOCKERHUB_REPO} :1.6-${OS__OS_VER} \$ " \
6061 ' $1":"$2 ~ pattern' ) ]]
6162then
6263 echo " ERROR: wrong argument."
6364 usage
6465 exit 1
6566fi
6667
67- # Log in to the Docker Hub
68+ echo " Log in to the Docker Hub"
6869docker login -u=" $DOCKERHUB_USER " -p=" $DOCKERHUB_PASSWORD "
6970
70- # Push the image to the repository
71+ echo " Push the image to the repository"
7172docker push ${DOCKERHUB_REPO} :1.6-$1
You can’t perform that action at this time.
0 commit comments