Skip to content

Instantly share code, notes, and snippets.

@ziedHamdi
Created Sep 15, 2021
Embed
What would you like to do?
build docker images from git repositories
#!/bin/sh
# GRAPHQL_SERVER_VERSION=$1
# NEXT_SERVER_VERSION=$2
# set variables from .env to system: https://gist.github.com/mihow/9c7f559807069a03e302605691f85572
if [ -f .env ]
then
export $(cat .env | sed 's/#.*//g' | xargs)
fi
echo Building version $GRAPHQL_SERVER_VERSION of backend and version $NEXT_SERVER_VERSION of frontend
if [ -z $GRAPHQL_SERVER_VERSION ]
then
echo you didn''t specify the tag for then BACKEND git repository
exit
fi
if [ -z $NEXT_SERVER_VERSION ]
then
echo you didn''t specify the tag for then FRONTEND git repository
exit
fi
cd ..
rm -rf weallyback
git clone --depth 1 --branch $GRAPHQL_SERVER_VERSION https://1vu@bitbucket.org/1vu/weallyback.git
cd weallyback
# > prod/weallyback/
echo building doker image for backend server
pwd
docker build . -t graphql:$GRAPHQL_SERVER_VERSION
cd ..
rm -rf weally.org
git clone --depth 1 --branch $NEXT_SERVER_VERSION https://1vu@bitbucket.org/1vu/weally.org.git
cd weally.org
# > prod/weally.org/
echo building doker image for fronted server
pwd
docker build . -t frontend:$NEXT_SERVER_VERSION
cd ..
# > prod/
cp ./weally_conf/docker-compose.yml .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment