Save the latest git commit ID inside the Docker containers to /app/.git_commit
This commit is contained in:
parent
35160f2fb4
commit
286046e2df
|
@ -35,7 +35,7 @@ matrix:
|
||||||
- sudo service mysql stop || true
|
- sudo service mysql stop || true
|
||||||
- sudo service postgresql stop || true
|
- sudo service postgresql stop || true
|
||||||
- cd $ROOT/docker
|
- cd $ROOT/docker
|
||||||
- docker-compose -f docker-compose.build.yml build
|
- docker-compose -f docker-compose.build.yml build --build-arg GIT_COMMIT=$TRAVIS_COMMIT
|
||||||
- dcfile_mysql=docker-compose.mysql.yml
|
- dcfile_mysql=docker-compose.mysql.yml
|
||||||
- dcfile_postgres=docker-compose.postgresql.yml
|
- dcfile_postgres=docker-compose.postgresql.yml
|
||||||
- BACKEND=mysql WEB_ENTRYPOINT="''" sh create-docker-compose.sh $dcfile_mysql
|
- BACKEND=mysql WEB_ENTRYPOINT="''" sh create-docker-compose.sh $dcfile_mysql
|
||||||
|
|
|
@ -6,7 +6,8 @@ cd tmp
|
||||||
git clone "https://${GIT_TOKEN}@github.com/${GIT_ORG}/${GIT_REPO}"
|
git clone "https://${GIT_TOKEN}@github.com/${GIT_ORG}/${GIT_REPO}"
|
||||||
cd $GIT_REPO
|
cd $GIT_REPO
|
||||||
cp $ROOT/docker/install.sh $WEB/requirements.txt .
|
cp $ROOT/docker/install.sh $WEB/requirements.txt .
|
||||||
docker-compose -f docker-compose.build.yml build
|
git_commit=`git log --format="%H" -n 1`
|
||||||
|
docker-compose -f docker-compose.build.yml build --build-arg GIT_COMMIT="$git_commit"
|
||||||
|
|
||||||
docker tag ottertune-base "${DOCKER_REPO}:base"
|
docker tag ottertune-base "${DOCKER_REPO}:base"
|
||||||
docker tag ottertune-web "${DOCKER_REPO}:web"
|
docker tag ottertune-web "${DOCKER_REPO}:web"
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
FROM ubuntu:18.04
|
FROM ubuntu:18.04
|
||||||
|
|
||||||
ARG DEBUG=true
|
ARG DEBUG=true
|
||||||
|
ARG GIT_COMMIT=
|
||||||
|
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
|
@ -8,6 +9,7 @@ COPY ./docker/install.sh ./server/website/requirements.txt /
|
||||||
WORKDIR /
|
WORKDIR /
|
||||||
|
|
||||||
RUN mkdir -p /app \
|
RUN mkdir -p /app \
|
||||||
|
&& ([ -n "$GIT_COMMIT" ] && echo "base=$GIT_COMMIT" > /app/.git_commit || :) \
|
||||||
&& chmod +x install.sh \
|
&& chmod +x install.sh \
|
||||||
&& ./install.sh base
|
&& ./install.sh base
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue