Skip to content

Commit

Permalink
Merge pull request #4 from artem-panchenko/releaseByTag
Browse files Browse the repository at this point in the history
Release by tag
  • Loading branch information
artem-panchenko committed May 8, 2017
2 parents 044eac9 + 0a18931 commit e27ad20
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
13 changes: 10 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ services:
script:
- make build
- make test
- docker ps
- netstat -lunp
- make clean
after_success:
- docker login -u="${DOCKER_USERNAME}" -p="${DOCKER_PASSWORD}"
- if [ "${TRAVIS_PULL_REQUEST_BRANCH}" ]; then
DOCKER_PUBLISH_TAG="${TRAVIS_PULL_REQUEST_BRANCH}" make publish;
elif [ "${TRAVIS_TAG}" ]; then
DOCKER_PUBLISH_TAG="${TRAVIS_TAG}" make publish;
DOCKER_PUBLISH_TAG=latest make publish;
else
DOCKER_PUBLISH_TAG="${TRAVIS_BRANCH}" make publish;
fi
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ STEAM_PASSWORD?=""

DOCKER_NO_CACHE?="false"

# Publish options
DOCKER_PUBLISH_NAME?="hlds/server"
DOCKER_PUBLISH_TAG?=$(IMAGE_TAG)

# Test tools
SHELLCHECK_IMAGE?="koalaman/shellcheck:latest"
TEST_CONTAINER_NAME?="test_hlds_auto"
Expand Down Expand Up @@ -52,3 +56,8 @@ test-clean: test-stop-server
.PHONY: clean
clean: test-clean
-docker rmi $(IMAGE_NAME):$(IMAGE_TAG)

.PHONY: publish
publish:
docker tag $(IMAGE_NAME):$(IMAGE_TAG) $(DOCKER_PUBLISH_NAME):$(DOCKER_PUBLISH_TAG)
docker push $(DOCKER_PUBLISH_NAME):$(DOCKER_PUBLISH_TAG)

0 comments on commit e27ad20

Please sign in to comment.