-
Notifications
You must be signed in to change notification settings - Fork 0
/
build
32 lines (28 loc) · 1.52 KB
/
build
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
#!/bin/sh
read -p "update existing image? " build
if [ -z "$build" ]; then
printf "skipped build and proceeding with the deployment only"
else
# build distribution
mvn -B package --file pom.xml
# create docker image, tag the image and push it into dev repo
docker build -t light-cd -f src/main/docker/Dockerfile.jvm .
docker tag light-cd quay.io/arbhatta/light-cd:master
echo $quay_password | docker login quay.io --username $quay_user --password-stdin
docker push quay.io/arbhatta/light-cd:master
fi
# get the user input of application domain for supporting ingress controller
read -p "Enter app domain: " domain
# based on provided domain either end the flow or deploy the existing helm chart
if [ -z "$domain" ]; then
printf '%s\n' "No domain value found in this session"
exit 1
else
helm delete light-cd
printf "app domain is set to %s \n" "$domain"
prefixUrl="http://spaship-manager-arbhatta-dev."
apiContextPath="/api/v1"
fullPath="${prefixUrl}${domain}${apiContextPath}"
echo "helm install --set image.repository=quay.io/arbhatta/light-cd --set image.tag=master --set app.namespace=light-cd --set app.environment=* --set app.storageclass=local-path --set app.uimemory=1024Mi --set app.domain=$domain --set app.instance="local" light-cd ."
helm install --set image.repository=quay.io/arbhatta/light-cd --set image.tag=master --set app.namespace=light-cd --set app.environment=* --set app.storageclass=local-path --set app.uimemory=1024Mi --set app.domain=$domain --set app.instance="local" light-cd .
fi