Image build and push scripts 67/3467/2
authoragrawalgaurav <gaurav.agrawal@huawei.com>
Fri, 15 May 2020 15:05:36 +0000 (20:35 +0530)
committerGaurav Agrawal <gaurav.agrawal@huawei.com>
Fri, 15 May 2020 15:44:39 +0000 (15:44 +0000)
Change-Id: I8b3525e61c083d2fa82195ad5e08e72ba58301a7

mecm/mepm/applcm/broker/build_image.sh [moved from mecm/mepm/applcm/k8shelm/docker-build.sh with 66% similarity]
mecm/mepm/applcm/broker/build_push_image.sh [new file with mode: 0644]
mecm/mepm/applcm/k8shelm/build_image.sh [new file with mode: 0755]
mecm/mepm/applcm/k8shelm/build_push_image.sh [new file with mode: 0644]
mecm/mepm/applcm/resources/deployment/build_push_image.sh [moved from mecm/mepm/applcm/broker/docker-build.sh with 68% similarity, mode: 0644]
mecm/mepm/applcm/resources/test/build_run.sh [moved from mecm/mepm/applcm/resources/test/Build-Run.sh with 100% similarity]

similarity index 66%
rename from mecm/mepm/applcm/k8shelm/docker-build.sh
rename to mecm/mepm/applcm/broker/build_image.sh
index f0a70e5..838053d 100755 (executable)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-MEP_VERSION=latest
-docker build --no-cache -t ealtedge/helmplugin:${MEP_VERSION} -f build/Dockerfile .
+DOCKER_BUILD_DIR=`pwd`
+MECM_VERSION=latest
+IMAGE_NAME=applcm-broker
+REPO_NAME=ealtedge
+
+echo "DOCKER_BUILD_DIR=${DOCKER_BUILD_DIR}"
+echo "In Build and Push Broker"
+
+function build_image {
+    docker build --no-cache -t ${REPO_NAME}/${IMAGE_NAME}:${MECM_VERSION} -f build/Dockerfile .
+}
+
+build_image
diff --git a/mecm/mepm/applcm/broker/build_push_image.sh b/mecm/mepm/applcm/broker/build_push_image.sh
new file mode 100644 (file)
index 0000000..e4ecbdd
--- /dev/null
@@ -0,0 +1,41 @@
+#!/bin/bash
+# Copyright 2020 Huawei Technologies Co., Ltd.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+unset REPO_USER
+unset REPO_PWD
+echo -n "REPO_USER:"
+read REPO_USER
+echo -n "REPO_PWD:"
+read REPO_PWD
+
+DOCKER_BUILD_DIR=`pwd`
+MECM_VERSION=latest
+IMAGE_NAME=applcm-broker
+REPO_NAME=ealtedge
+
+echo "DOCKER_BUILD_DIR=${DOCKER_BUILD_DIR}"
+echo "In Build and Push Broker"
+
+function build_image {
+    docker build --no-cache -t ${REPO_NAME}/${IMAGE_NAME}:${MECM_VERSION} -f build/Dockerfile .
+}
+
+function push_image {
+    docker login -u ${REPO_USER} -p ${REPO_PWD}
+    docker push ${REPO_NAME}/${IMAGE_NAME}:${MECM_VERSION}
+}
+
+build_image
+push_image
\ No newline at end of file
diff --git a/mecm/mepm/applcm/k8shelm/build_image.sh b/mecm/mepm/applcm/k8shelm/build_image.sh
new file mode 100755 (executable)
index 0000000..15c94cb
--- /dev/null
@@ -0,0 +1,28 @@
+#!/bin/sh
+# Copyright 2020 Huawei Technologies Co., Ltd.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+DOCKER_BUILD_DIR=`pwd`
+MECM_VERSION=latest
+IMAGE_NAME=helmplugin
+REPO_NAME=ealtedge
+
+echo "DOCKER_BUILD_DIR=${DOCKER_BUILD_DIR}"
+echo "In Build and Push K8s Help Plugin"
+
+function build_image {
+    docker build --no-cache -t ${REPO_NAME}/${IMAGE_NAME}:${MECM_VERSION} -f build/Dockerfile .
+}
+
+build_image
diff --git a/mecm/mepm/applcm/k8shelm/build_push_image.sh b/mecm/mepm/applcm/k8shelm/build_push_image.sh
new file mode 100644 (file)
index 0000000..2d3e4cd
--- /dev/null
@@ -0,0 +1,41 @@
+#!/bin/bash
+# Copyright 2020 Huawei Technologies Co., Ltd.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+unset REPO_USER
+unset REPO_PWD
+echo -n "REPO_USER:"
+read REPO_USER
+echo -n "REPO_PWD:"
+read REPO_PWD
+
+DOCKER_BUILD_DIR=`pwd`
+MECM_VERSION=latest
+IMAGE_NAME=helmplugin
+REPO_NAME=ealtedge
+
+echo "DOCKER_BUILD_DIR=${DOCKER_BUILD_DIR}"
+echo "In Build and Push K8s Helm Plugin"
+
+function build_image {
+    docker build --no-cache -t ${REPO_NAME}/${IMAGE_NAME}:${MECM_VERSION} -f build/Dockerfile .
+}
+
+function push_image {
+    docker login -u ${REPO_USER} -p ${REPO_PWD}
+    docker push ${REPO_NAME}/${IMAGE_NAME}:${MECM_VERSION}
+}
+
+build_image
+push_image
\ No newline at end of file
old mode 100755 (executable)
new mode 100644 (file)
similarity index 68%
rename from mecm/mepm/applcm/broker/docker-build.sh
rename to mecm/mepm/applcm/resources/deployment/build_push_image.sh
index 6f6bf8b..24ffcb3
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 # Copyright 2020 Huawei Technologies Co., Ltd.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-MEP_VERSION=latest
-docker build --no-cache -t ealtedge/applcm-broker:${MEP_VERSION} -f build/Dockerfile .
+CURRENT_DIR=`pwd`
+
+echo "DOCKER_BUILD_DIR=${CURRENT_DIR}"
+echo "Build and Push APP LCM"
+
+# Build and push broker
+cd ${CURRENT_DIR}
+cd ../../broker/
+. build_push_image.sh
+
+# Build and push k8s helm plugin
+cd ${CURRENT_DIR}
+cd ../../k8shelm/
+. build_push_image.sh
+