Skip to content

Commit

Permalink
feat: show latest commit when running docker image (#154)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-fenster authored Nov 21, 2019
1 parent 8344bf0 commit 654b3aa
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ pbjs-genfiles/
.client_library
*test-out*
docker/package.tgz
docker/gitlog.txt
*.tgz
.showcase-typescript
.test-application-js
Expand Down
3 changes: 3 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,7 @@ RUN rm -rf /root/files
RUN gapic-generator-typescript --version
RUN protoc --version

# Save git log output for debugging purposes
COPY ./gitlog.txt /root/

ENTRYPOINT [ "/usr/local/bin/start.sh" ]
4 changes: 4 additions & 0 deletions docker/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
SCRIPTDIR=`dirname "$0"`
cd "$SCRIPTDIR"
cd .. # now in the package.json directory
git log | head -n 3 > docker/gitlog.txt
npm pack

VERSION=`cat package.json | grep version | awk -F'"' '{ print $4; }'`
Expand All @@ -27,3 +28,6 @@ cp "google-cloud-gapic-generator-$VERSION.tgz" "docker/package.tgz"
cd docker

docker build -t gapic-generator-typescript .

# Cleanup
rm -f gitlog.txt package.tgz
6 changes: 6 additions & 0 deletions docker/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

### Start script that is an entry point for a Docker image.

# Dump the version of the current code to stderr
echo "gapic-generator-typescript: https://github.com/googleapis/gapic-generator-typescript" 1>&2
echo "Latest commit: " 1>&2
cat /root/gitlog.txt 1>&2
echo 1>&2

# Change directory to the input directory.
# Make it easier to pass gRPC service config relative to it, e.g.
# --grpc-service-config google/cloud/texttospeech/v1/texttospeech_grpc_service_config.json
Expand Down

0 comments on commit 654b3aa

Please sign in to comment.