* feat(api): assist peerJS server * feat(api): install assist_server dependencies and start it with the API * feat(api): assist: list live sessions * feat(nginx): expose assist_server and block peers listing * feat(api): merged sourcemaps reader and assist-server feat(api): change image definition feat(api): changed service start command feat(utilities): created full server & image definition feat(nginx): reset chalice configuration * feat(utilities): utilities.yaml * feat(nginx): utilities URL * feat(utilities): utilities template * feat(ci): Adding utilities GH action. Signed-off-by: Rajesh Rajendran <rjshrjndrn@gmail.com> * feat(utilities): build script * feat(utilities): build script fix image name * feat(utilities): tag and push image as latest * feat(api): tag and push image as latest Co-authored-by: Rajesh Rajendran <rjshrjndrn@gmail.com>
36 lines
1,013 B
Bash
36 lines
1,013 B
Bash
#!/bin/bash
|
|
|
|
# Script to build api module
|
|
# flags to accept:
|
|
# envarg: build for enterprise edition.
|
|
# Default will be OSS build.
|
|
|
|
# Usage: IMAGE_TAG=latest DOCKER_REPO=myDockerHubID bash build.sh <ee>
|
|
|
|
git_sha1=${IMAGE_TAG:-$(git rev-parse HEAD)}
|
|
envarg="default-foss"
|
|
check_prereq() {
|
|
which docker || {
|
|
echo "Docker not installed, please install docker."
|
|
exit=1
|
|
}
|
|
[[ exit -eq 1 ]] && exit 1
|
|
}
|
|
|
|
function build_api(){
|
|
# Copy enterprise code
|
|
[[ $1 == "ee" ]] && {
|
|
cp -rf ../ee/api/* ./
|
|
cp -rf ../ee/api/.chalice/* ./.chalice/
|
|
envarg="default-ee"
|
|
}
|
|
docker build -f ./Dockerfile --build-arg envarg=$envarg -t ${DOCKER_REPO:-'local'}/chalice:${git_sha1} .
|
|
[[ $PUSH_IMAGE -eq 1 ]] && {
|
|
docker push ${DOCKER_REPO:-'local'}/chalice:${git_sha1}
|
|
docker tag ${DOCKER_REPO:-'local'}/chalice:${git_sha1} ${DOCKER_REPO:-'local'}/chalice:latest
|
|
docker push ${DOCKER_REPO:-'local'}/chalice:latest
|
|
}
|
|
}
|
|
|
|
check_prereq
|
|
build_api $1
|