-
Notifications
You must be signed in to change notification settings - Fork 17
/
buildAndDeploy.sh
50 lines (44 loc) · 1.84 KB
/
buildAndDeploy.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
#################################################################################
# Tractus-X - Digital Product Pass Application
#
# Copyright (c) 2022, 2024 BMW AG
# Copyright (c) 2022, 2024 Henkel AG & Co. KGaA
# Copyright (c) 2023, 2024 CGI Deutschland B.V. & Co. KG
# Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License, Version 2.0 which is available at
# https://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 govern in permissions and limitations
# under the License.
#
# SPDX-License-Identifier: Apache-2.0
#################################################################################
CONTAINER_NAME=$1
IMAGE_NAME="consumer-ui"
IMAGE_TAG="latest"
VERSION=""
API_TIMEOUT=""
API_DELAY=""
API_MAX_RETRIES=""
BACKEND_URL=""
SERVER_URL=""
IDP_URL=""
KEYCLOAK_CLIENTID=""
KEYCLOAK_REALM=""
KEYCLOAK_ONLOAD=""
docker rm -f ${CONTAINER_NAME}
echo "Build docker image..."
docker build -t ${IMAGE_NAME}:${IMAGE_TAG} .
echo "Run docker container..."
docker run --name ${CONTAINER_NAME} -p 8080:80 -d -e APP_VERSION=${VERSION} -e APP_API_TIMEOUT=${API_TIMEOUT} -e APP_API_MAX_RETRIES=${API_MAX_RETRIES} -e APP_API_DELAY=${API_DELAY} -e IDENTITY_PROVIDER_URL=${IDP_URL} -e HOST_URL=${SERVER_URL} -e DATA_URL=${BACKEND_URL} -e KEYCLOAK_CLIENTID=${KEYCLOAK_CLIENTID} -e KEYCLOAK_REALM=${KEYCLOAK_REALM} -e KEYCLOAK_ONLOAD=${KEYCLOAK_ONLOAD} ${IMAGE_NAME}:${IMAGE_TAG}
echo "Done"