ATLAS-3934: Dockerfile: updated default to build from local repo (instead of from github) - #2
This commit is contained in:
parent
b8956dfd00
commit
d0e246a709
|
|
@ -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,13 +48,23 @@ then
|
|||
|
||||
cd /home/atlas/src
|
||||
else
|
||||
echo "Building from /home/atlas/git/atlas"
|
||||
echo "Building ${BRANCH} branch from ${GIT_URL}"
|
||||
|
||||
cd /home/atlas/git
|
||||
|
||||
if [ -d atlas ]
|
||||
then
|
||||
renamedDir=atlas-`date +"%Y%m%d-%H%M%S"`
|
||||
|
||||
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
|
||||
|
||||
git checkout ${BRANCH}
|
||||
git pull
|
||||
|
||||
for patch in `ls -1 /home/atlas/patches | sort`
|
||||
do
|
||||
echo "applying patch /home/atlas/patches/${patch}"
|
||||
|
|
|
|||
Loading…
Reference in New Issue