Skip to content

Commit b97cd68

Browse files
authored
Create commands to run after automated Docker build (#30)
* Create commands to run after automated Docker build Tags the Docker image with the commit number and pushes the image up to Docker Hub. * Images are pushed after each build A build is triggered when someone makes a PR.
1 parent 2b5d69d commit b97cd68

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

rich-default/hooks/post_build

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
set -e
3+
4+
# Adapted from the Jupyter Docker Stacks repository
5+
# Example: https://github.com/jupyter/docker-stacks/blob/master/datascience-notebook/hooks/post_push
6+
7+
# Tag the latest build with the short git sha. Push the tag in addition
8+
# to the "latest" tag already pushed.
9+
GIT_SHA_TAG=${SOURCE_COMMIT:0:12}
10+
docker tag $IMAGE_NAME $DOCKER_REPO:$GIT_SHA_TAG
11+
docker push $DOCKER_REPO:$GIT_SHA_TAG

0 commit comments

Comments
 (0)