Commit d0e246a7 by Madhan Neethiraj

ATLAS-3934: Dockerfile: updated default to build from local repo (instead of from github) - #2

parent b8956dfd
......@@ -42,8 +42,4 @@ VOLUME /home/atlas/src
USER atlas
WORKDIR /home/atlas/git
RUN git clone https://github.com/apache/atlas.git
ENTRYPOINT [ "/home/atlas/scripts/atlas-build.sh" ]
......@@ -56,10 +56,10 @@ Docker files in this folder create docker images and run them to build Apache At
4.3. Build Apache Atlas in a container with one of the following commands:
# to build from a specific branch
docker run -it --rm -v ${HOME}/.m2:/home/atlas/.m2 -v $(pwd)/scripts:/home/atlas/scripts -v $(pwd)/patches:/home/atlas/patches -v $(pwd)/dist:/home/atlas/dist -e BRANCH=master -e PROFILE=dist,berkeley-solr -e SKIPTESTS=true atlas-build
docker run -it --rm -v ${HOME}/.m2:/home/atlas/.m2:delegated -v $(pwd)/scripts:/home/atlas/scripts -v $(pwd)/patches:/home/atlas/patches -v $(pwd)/dist:/home/atlas/dist -e BRANCH=master -e PROFILE=dist,berkeley-solr -e SKIPTESTS=true atlas-build
# to build from local sources
docker run -it --rm -v ${HOME}/.m2:/home/atlas/.m2 -v $(pwd)/scripts:/home/atlas/scripts -v $(pwd)/../..:/home/atlas/src -v $(pwd)/dist:/home/atlas/dist -e PROFILE=dist,berkeley-solr -e SKIPTESTS=true atlas-build
docker run -it --rm -v ${HOME}/.m2:/home/atlas/.m2:delegated -v $(pwd)/scripts:/home/atlas/scripts -v $(pwd)/../..:/home/atlas/src:delegated -v $(pwd)/dist:/home/atlas/dist -e PROFILE=dist,berkeley-solr -e SKIPTESTS=true atlas-build
Time taken to complete the build might vary (upto an hour), depending on status of ${HOME}/.m2 directory cache.
......
......@@ -12,10 +12,11 @@ services:
networks:
- atlas
volumes:
- ~/.m2:/home/atlas/.m2
- ~/.m2:/home/atlas/.m2:delegated
- ./scripts:/home/atlas/scripts
- ./patches:/home/atlas/patches
- ./dist:/home/atlas/dist
- ./../..:/home/atlas/src:delegated
depends_on:
- atlas-base
environment:
......
......@@ -21,6 +21,11 @@ then
BRANCH=master
fi
if [ "${GIT_URL}" == "" ]
then
GIT_URL=https://github.com/apache/atlas.git
fi
if [ "${PROFILE}" != "" ]
then
ARG_PROFILES="-P${PROFILE}"
......@@ -43,12 +48,22 @@ then
cd /home/atlas/src
else
echo "Building from /home/atlas/git/atlas"
echo "Building ${BRANCH} branch from ${GIT_URL}"
cd /home/atlas/git/atlas
cd /home/atlas/git
if [ -d atlas ]
then
renamedDir=atlas-`date +"%Y%m%d-%H%M%S"`
git checkout ${BRANCH}
git pull
echo "Renaming existing directory `pwd`/atlas to ${renamedDir}"
mv atlas $renamedDir
fi
git clone --single-branch --branch ${BRANCH} ${GIT_URL}
cd /home/atlas/git/atlas
for patch in `ls -1 /home/atlas/patches | sort`
do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment