Skip to content

Commit a9422b0

Browse files
author
Matthew
committed
feat(tests): add travis.yml
1 parent cec5a3b commit a9422b0

11 files changed

Lines changed: 67 additions & 290 deletions

File tree

.gitignore

Whitespace-only changes.

.travis.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
sudo: required
2+
language: go
3+
go:
4+
- 1.5.1
5+
branches:
6+
only:
7+
- master
8+
services:
9+
- docker
10+
install:
11+
- make build
12+
script:
13+
- make test
14+
deploy:
15+
provider: script
16+
script: contrib/ci/deploy.sh
17+
on:
18+
branch: master

CHANGELOG.md

Whitespace-only changes.

Makefile

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,31 @@
1-
export GO15VENDOREXPERIMENT=1
2-
VERSION := 0.0.1
1+
include includes.mk
32

4-
all:
5-
@echo "Use a Makefile to control top-level building of the project."
3+
# Short name, following [a-zA-Z_], used all over the place.
4+
SHORT_NAME := postgres
5+
6+
# SemVer with build information is defined in the SemVer 2 spec, but Docker
7+
# doesn't allow +, so we use -.
8+
VERSION := 0.0.1-$(shell date "+%Y%m%d%H%M%S")
9+
10+
# Legacy support for DEV_REGISTRY, plus new support for DEIS_REGISTRY.
11+
DEIS_REGISTRY ?= ${DEV_REGISTRY}
612

7-
build:
8-
@echo "nothing to build"
13+
IMAGE_PREFIX ?= deis/
914

10-
deploy: kube-service kube-rc
15+
IMAGE := ${DEIS_REGISTRY}/${IMAGE_PREFIX}${SHORT_NAME}:${VERSION}
16+
17+
all:
18+
@echo "Use a Makefile to control top-level building of the project."
1119

12-
kube-service:
13-
kubectl create -f def/postgres-service.json
20+
build: docker-build
1421

15-
kube-rc:
16-
kubectl create -f def/postgres-rc.json
22+
docker-build: check-docker
23+
docker build --rm -t ${IMAGE} rootfs
1724

18-
kube-clean:
19-
kubectl delete rc postgres
25+
docker-push: check-docker check-registry
26+
docker push ${IMAGE}
2027

2128
test:
22-
@echo "no tests"
29+
@echo "No tests"
2330

24-
.PHONY: all build deploy kube-service kube-rc kube-clean test
31+
.PHONY: all build

_docs/.gitkeep

Whitespace-only changes.

_tests/database_test.go

Lines changed: 0 additions & 44 deletions
This file was deleted.

_tests/recovery_test.go

Lines changed: 0 additions & 144 deletions
This file was deleted.

contrib/ci/deploy.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Build and push Docker images to Docker Hub and quay.io.
4+
#
5+
6+
cd "$(dirname "$0")" || exit 1
7+
8+
docker login -e="$DOCKER_EMAIL" -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" docker.io
9+
REGISTRY=docker.io IMAGE_PREFIX=deisci BUILD_TAG=v2-alpha make -C ../.. docker-build docker-push
10+
docker login -e="$QUAY_EMAIL" -u="$QUAY_USERNAME" -p="$QUAY_PASSWORD" quay.io
11+
REGISTRY=quay.io IMAGE_PREFIX=deisci BUILD_TAG=v2-alpha make -C ../.. docker-build docker-push

includes.mk

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
check-docker:
2+
@if [ -z $$(which docker) ]; then \
3+
echo "Missing \`docker\` client which is required for development"; \
4+
exit 2; \
5+
fi
6+
7+
check-kubectl:
8+
@if [ -z $$(which kubectl) ]; then \
9+
echo "Missing \`kubectl\` client which is required for development"; \
10+
exit 2; \
11+
fi
12+
13+
check-registry:
14+
@if [ -z "$$DEIS_REGISTRY" ] && [ -z "$$DEV_REGISTRY" ]; then \
15+
echo "DEIS_REGISTRY is not exported"; \
16+
exit 2; \

manifests/postgres-rc.json

Lines changed: 0 additions & 64 deletions
This file was deleted.

0 commit comments

Comments
 (0)