-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 137 better releases (#141) * Automatic Github and Docker releases from Travis * Improve documentation * 137 better releases (#143) * Fixes path. Fixes #137 * feat(skeleton): skeleton of the project added Closes #144
- Loading branch information
Showing
27 changed files
with
319 additions
and
358 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -112,4 +112,6 @@ modules.xml | |
|
||
### Project ### | ||
/skrop | ||
docker/skrop | ||
docker/sample.eskip | ||
*coverage.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env bash | ||
|
||
. docker/version.sh | ||
|
||
echo "TRAVIS_BRANCH=${TRAVIS_BRANCH}" | ||
echo "TRAVIS_PULL_REQUEST=${TRAVIS_PULL_REQUEST}" | ||
echo "GITHUB_AUTH=${GITHUB_AUTH}" | ||
|
||
if [ "${TRAVIS_BRANCH}_${TRAVIS_PULL_REQUEST}" = "master_false" ]; then | ||
echo "Merge to 'master'. Tagging patch version up." | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Travis CI" | ||
echo "Creating tag for version: ${NEXT_PATCH_VERSION}" | ||
git tag ${NEXT_PATCH_VERSION} -a -m "Generated tag from TravisCI for build ${TRAVIS_BUILD_NUMBER}" | ||
git push -q --tags https://$GITHUB_AUTH@github.com/zalando-stups/skrop | ||
else | ||
echo "Not a merge to 'master'. Don't release a new version." | ||
fi |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,62 +3,18 @@ | |
routes_file ?= ./eskip/sample.eskip | ||
docker_tag ?= skrop/skrop | ||
|
||
CURRENT_VERSION = $(shell git describe --tags --always --dirty) | ||
VERSION ?= $(CURRENT_VERSION) | ||
NEXT_PATCH = $(shell go run packaging/version/version.go patch $(CURRENT_VERSION)) | ||
COMMIT_HASH = $(shell git rev-parse --short HEAD) | ||
|
||
|
||
build: | ||
go build ./cmd/skrop | ||
./docker/skrop-build.sh | ||
|
||
docker: | ||
./packaging/build.sh $(VERSION) $(routes_file) $(docker_tag) | ||
./docker/docker-build.sh | ||
|
||
docker-run: | ||
rm -rf "$$(pwd)"/mylocalfilecache | ||
mkdir "$$(pwd)"/mylocalfilecache | ||
docker run --rm -v "$$(pwd)"/images:/images -v "$$(pwd)"/mylocalfilecache:/mylocalfilecache -e STRIP_METADATA='TRUE' -p 9090:9090 skrop/skrop -verbose | ||
|
||
test: build test-only | ||
./docker/docker-run.sh | ||
|
||
test-only: | ||
test: | ||
go test ./... | ||
|
||
init-deps: | ||
./packaging/build.sh | ||
go get ./cmd/skrop/ | ||
|
||
all: init-deps build test | ||
|
||
tag: | ||
echo "Creating tag for version: $(VERSION)" | ||
git tag $(VERSION) -a -m "Generated tag from TravisCI for build $(TRAVIS_BUILD_NUMBER)" | ||
|
||
push-tags: | ||
git push -q --tags https://$(GITHUB_AUTH)@github.com/zalando-stups/skrop | ||
|
||
release-patch: | ||
echo "Incrementing patch version" | ||
make VERSION=$(NEXT_PATCH) tag push-tags | ||
|
||
ci-user: | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Travis CI" | ||
|
||
ci-release-patch: ci-user release-patch | ||
|
||
ci-test: | ||
./.travis/test.sh | ||
|
||
ci-trigger: ci-test | ||
ifeq ($(TRAVIS_BRANCH)_$(TRAVIS_PULL_REQUEST), master_false) | ||
echo "Merge to 'master'. Tagging patch version up." | ||
make ci-release-patch | ||
else | ||
echo "Not a merge to 'master'. Not versionning this merge." | ||
endif | ||
|
||
build-docker-vips: | ||
docker build -f Dockerfile-Vips --build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` --build-arg VCS_REF=`git rev-parse --short HEAD` -t skrop/alpine-mozjpeg-vips:3.3.1-8.7.0 . | ||
docker push skrop/alpine-mozjpeg-vips:3.3.1-8.7.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/env bash | ||
|
||
readonly ROUTES_FILE=${1-"./sample.eskip"} | ||
readonly IMAGE_NAME=${2-"skrop/skrop"} | ||
|
||
. docker/version.sh | ||
|
||
function build_docker_image() { | ||
docker pull "$IMAGE_NAME" || true | ||
docker build --pull --cache-from "$IMAGE_NAME" \ | ||
--build-arg ROUTES_FILE=${ROUTES_FILE} \ | ||
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \ | ||
--build-arg VCS_REF=`git rev-parse --short HEAD` \ | ||
--build-arg VERSION=${NEXT_PATCH_VERSION} \ | ||
-t ${IMAGE_NAME} ./docker \ | ||
&& return 0 | ||
} | ||
|
||
echo >&2 "Building Docker image…" | ||
build_docker_image | ||
if [ "$?" -ne 0 ]; then | ||
echo >&2 "Aborting!" | ||
exit 1 | ||
fi | ||
echo >&2 "Docker image build successfully…" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/usr/bin/env bash | ||
|
||
readonly IMAGE_NAME=${1-"skrop/skrop"} | ||
|
||
. docker/version.sh | ||
|
||
./docker/skrop-build.sh | ||
|
||
cp skrop ./docker | ||
cp ./eskip/sample.eskip ./docker | ||
|
||
./docker/docker-build.sh | ||
|
||
echo >&2 "Tagging Docker images…" | ||
|
||
docker tag "$IMAGE_NAME" "${IMAGE_NAME}:latest" | ||
docker tag "$IMAGE_NAME" "${IMAGE_NAME}:${NEXT_PATCH_VERSION}" | ||
|
||
echo >&2 "Logging in to Docker Hub…" | ||
|
||
echo "$DOCKER_USERNAME" | ||
echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_USERNAME" --password-stdin | ||
|
||
echo >&2 "Pushing Docker images…" | ||
|
||
docker push "${IMAGE_NAME}:latest" | ||
docker push "${IMAGE_NAME}:${NEXT_PATCH_VERSION}" | ||
|
||
echo >&2 "Success!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/env bash | ||
|
||
rm -rf "$$(pwd)"/mylocalfilecache | ||
mkdir "$$(pwd)"/mylocalfilecache | ||
docker run --rm -v "$$(pwd)"/images:/images -v "$$(pwd)"/mylocalfilecache:/mylocalfilecache -e STRIP_METADATA='TRUE' -p 9090:9090 skrop/skrop -verbose |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/usr/bin/env bash | ||
|
||
PROJECT_DIR="/go/src/github.com/zalando-stups/skrop" | ||
|
||
docker pull skrop/skrop-build | ||
docker run -t -v $(pwd):${PROJECT_DIR} skrop/skrop-build sh -c "cd ${PROJECT_DIR} && go build ./cmd/skrop" | ||
|
||
if [ "$?" -ne 0 ]; then | ||
echo >&2 "Error building Skrop. Aborting!" | ||
exit 1 | ||
fi | ||
|
||
echo >&2 "Skrop executable was successfully built!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/usr/bin/env bash | ||
|
||
export CURRENT_VERSION="$(git describe --tags --always)" | ||
echo "CURRENT_VERSION=${CURRENT_VERSION}" | ||
export NEXT_PATCH_VERSION="$(go run docker/version/version.go patch ${CURRENT_VERSION})" | ||
echo "NEXT_PATCH_VERSION=${NEXT_PATCH_VERSION}" |
File renamed without changes.
Oops, something went wrong.