Skip to content

Commit

Permalink
Fix build info
Browse files Browse the repository at this point in the history
  • Loading branch information
gsfr committed Dec 14, 2017
1 parent 11fde49 commit d325321
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ install: true
script:
- test -f "$DOCKER_DIR/image.tar" && docker load -i "$DOCKER_DIR/image.tar" || true
- docker build -t core:build --target build .
- docker build -t core:dist --target dist .
- docker build -t core:dist --target dist --build-arg VCS_BRANCH="$TRAVIS_BRANCH" --build-arg VCS_COMMIT="$TRAVIS_COMMIT" .
- docker build -t core:testing --target testing .
- docker save -o "$DOCKER_DIR/image.tar" $(docker history -q core:build | grep -v '<missing>') $(docker history -q core:dist | grep -v '<missing>')
- ./tests/bin/run-tests-docker.sh --image core:testing
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ RUN pip install -e .

CMD ["unitd", "--control", "*:8080", "--no-daemon", "--log", "/dev/stdout"]

ARG BRANCH_LABEL=NULL
ARG COMMIT_HASH=0
RUN docker/inject_build_info.sh $BRANCH_LABEL $COMMIT_HASH
ARG VCS_BRANCH=NULL
ARG VCS_COMMIT=NULL
RUN docker/build_info.sh $VCS_BRANCH $VCS_COMMIT | tee /version.json


FROM dist as testing

RUN apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/community mongodb=3.4.4-r0
RUN apk add --no-cache mongodb

RUN pip install -r tests/requirements.txt

Expand Down
4 changes: 2 additions & 2 deletions docker/inject_build_info.sh → docker/build_info.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/usr/bin/env sh

set -eu
cat > version.json <<EOF

cat <<EOF
{
"branch": "$1",
"commit": "$2",
"timestamp": "$(date -u +"%Y-%m-%dT%H:%M:%SZ")"
}
EOF
cat version.json
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ django>=1.11.0,<1.12.0
elasticsearch==5.3.0
enum34==1.1.6
git+https://github.com/flywheel-io/[email protected]#egg=gears
ipython
jsonschema==2.6.0
markdown==2.6.5
pymongo==3.2
Expand Down

0 comments on commit d325321

Please sign in to comment.