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 ...@@ -42,8 +42,4 @@ VOLUME /home/atlas/src
USER atlas USER atlas
WORKDIR /home/atlas/git
RUN git clone https://github.com/apache/atlas.git
ENTRYPOINT [ "/home/atlas/scripts/atlas-build.sh" ] 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 ...@@ -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: 4.3. Build Apache Atlas in a container with one of the following commands:
# to build from a specific branch # 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 # 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. Time taken to complete the build might vary (upto an hour), depending on status of ${HOME}/.m2 directory cache.
......
...@@ -12,10 +12,11 @@ services: ...@@ -12,10 +12,11 @@ services:
networks: networks:
- atlas - atlas
volumes: volumes:
- ~/.m2:/home/atlas/.m2 - ~/.m2:/home/atlas/.m2:delegated
- ./scripts:/home/atlas/scripts - ./scripts:/home/atlas/scripts
- ./patches:/home/atlas/patches - ./patches:/home/atlas/patches
- ./dist:/home/atlas/dist - ./dist:/home/atlas/dist
- ./../..:/home/atlas/src:delegated
depends_on: depends_on:
- atlas-base - atlas-base
environment: environment:
......
...@@ -21,6 +21,11 @@ then ...@@ -21,6 +21,11 @@ then
BRANCH=master BRANCH=master
fi fi
if [ "${GIT_URL}" == "" ]
then
GIT_URL=https://github.com/apache/atlas.git
fi
if [ "${PROFILE}" != "" ] if [ "${PROFILE}" != "" ]
then then
ARG_PROFILES="-P${PROFILE}" ARG_PROFILES="-P${PROFILE}"
...@@ -43,12 +48,22 @@ then ...@@ -43,12 +48,22 @@ then
cd /home/atlas/src cd /home/atlas/src
else 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} echo "Renaming existing directory `pwd`/atlas to ${renamedDir}"
git pull
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` for patch in `ls -1 /home/atlas/patches | sort`
do 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