openreplay/scripts/helmcharts/local_deploy.sh
Rajesh Rajendran f3b6bda163
Vagrant for local contribution (#434)
* chore(vagrant): initial vagrantfile
* chore(vagrant): adding instructions after installation
* chore(vagrant): Adding vagrant user to docker group
* chore(vagrant): use local docker daemon for k3s
* chore(vagrant): fix comment
* chore(vagrant): adding hostname in /etc/hosts
* chore(vagrant): fix doc
* chore(vagrant): limiting cpu
* chore(frontend): initialize dev env
* chore(docker): adding dockerignore
* chore(dockerfile): using cache for fasten build
* chore(dockerignore): update
* chore(docker): build optimizations
* chore(build): all components build option
* chore(build): utilities build fix
* chore(scrpt): remove debug message
* chore(vagrant): provision using stable branch always

Signed-off-by: rjshrjndrn <rjshrjndrn@gmail.com>
2022-04-27 12:54:40 +00:00

105 lines
2.2 KiB
Bash

#!/bin/bash
set -e
# This script will build and push docker image to registry
# Usage: IMAGE_TAG=latest DOCKER_REPO=rg.fr-par.scw.cloud/foss bash build_deploy.sh
export DOCKER_REPO="rg.fr-par.scw.cloud/foss"
export IMAGE_TAG=`grep fromVersion vars.yaml | awk '{print $NF}'|xargs`
apps=(
api
assets
db
ender
http
integrations
sink
storage
assist
peers
all
)
help(){
cat <<EOF
Valid options are
echo ${apps[*]}
EOF
}
restart(){
kubectl rollout restart deployment -n app "$1-openreplay"
kubectl rollout status deployment -n app "$1-openreplay"
}
[[ -z DOCKER_REPO ]] && {
echo Set DOCKER_REPO="your docker registry"
exit 1
} || {
case "$1" in
api)
echo $IMAGE_TAG
cd ../../api
source build.sh $@
restart chalice
;;
assets)
cd ../../backend
source build.sh nil assets
restart assets
;;
db)
cd ../../backend
source build.sh nil db
restart db
;;
ender)
cd ../../backend
source build.sh nil ender
restart ender
;;
http)
cd ../../backend
source build.sh nil http
restart http
;;
integrations)
cd ../../backend
source build.sh nil integrations
restart integrations
;;
sink)
cd ../../backend
source build.sh nil sink
restart sink
;;
storage)
cd ../../backend
source build.sh nil storage
restart storage
;;
assist)
cd ../../utilities
source build.sh $@
restart assist
;;
peers)
cd ../../peers
source build.sh $@
restart peers
;;
all)
for app in ${apps[*]}
do
bash local_deploy.sh $app
done
;;
*)
echo "unknown option;"
help
exit 1
;;
esac
}