-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdeploy_db.sh
executable file
·31 lines (25 loc) · 1007 Bytes
/
deploy_db.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
#!/usr/bin/env bash
#*******************************************************************************
# Copyright (c) 2020 Eclipse Foundation and others.
# This program and the accompanying materials are made available
# under the terms of the Eclipse Public License 2.0
# which is available at http://www.eclipse.org/legal/epl-v20.html
# SPDX-License-Identifier: EPL-2.0
#*******************************************************************************
# Bash strict-mode
set -o errexit
set -o nounset
set -o pipefail
SCRIPT_FOLDER="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
# check for errors
pushd "${SCRIPT_FOLDER}"
jq . bots.db.json > /dev/null
# run a clean build
mvn clean package -DskipTests
# build and push docker image
image_name="eclipsefdn/projects-bots-api:latest"
docker build --pull --rm -t "${image_name}" -f src/main/docker/Dockerfile .
docker push "${image_name}"
# deploy to cluster
kubectl rollout restart -n foundation-internal-webdev-apps deployment/projects-bots-api
popd