Skip to content
This repository has been archived by the owner on Jul 16, 2021. It is now read-only.

Commit

Permalink
build docker images (#273)
Browse files Browse the repository at this point in the history
  • Loading branch information
prydonius authored Jun 15, 2017
1 parent 5f54928 commit ebbe797
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 27 deletions.
20 changes: 18 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,23 @@ install:
- make -C src/api bootstrap
- make -C src/ui install
script:
- make -C src/api test test-cover build
- make -C src/ui compile-aot # Tests disabled for now
- make -C src/api test test-cover docker-build
- make -C src/ui docker-build # Tests disabled for now
after_success:
- |
if [[ "$TRAVIS_PULL_REQUEST" == false ]]; then
if [[ -n "$TRAVIS_TAG" ]]; then
docker tag bitnami/monocular-api:latest bitnami/monocular-api:$TRAVIS_TAG
docker tag bitnami/monocular-ui:latest bitnami/monocular-ui:$TRAVIS_TAG
fi
docker login -u="$DOCKER_USER" -p="$DOCKER_PASSWORD"
docker push bitnami/monocular-api
docker push bitnami/monocular-ui
fi
- bash <(curl -s https://codecov.io/bash)

branches:
only:
- master
# release tags
- /^v\d+\.\d+\.\d+.*/
5 changes: 3 additions & 2 deletions deployment/monocular/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
api:
replicaCount: 2
image:
repository: gcr.io/helm-ui/monocular-api
repository: bitnami/monocular-api
tag: latest
pullPolicy: Always
service:
Expand Down Expand Up @@ -47,7 +47,7 @@ api:
ui:
replicaCount: 2
image:
repository: gcr.io/helm-ui/monocular-ui
repository: bitnami/monocular-ui
tag: latest
pullPolicy: Always
service:
Expand Down Expand Up @@ -85,6 +85,7 @@ prerender:
memory: 128Mi

ingress:
enabled: true
hosts:
# Wildcard
-
Expand Down
1 change: 0 additions & 1 deletion src/api/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,3 @@ test-native:

docker-build: build
docker build --rm -t ${IMAGE} rootfs
docker tag ${IMAGE} ${MUTABLE_IMAGE}
19 changes: 4 additions & 15 deletions src/api/versioning.mk
Original file line number Diff line number Diff line change
@@ -1,19 +1,8 @@
MUTABLE_VERSION ?= canary
VERSION ?= git-$(shell git rev-parse --short HEAD)
IMAGE_REGISTRY ?= # default to dockerhub
IMAGE_PREFIX ?= # we rely upon the user providing an IMAGE_PREFIX, e.g., IMAGE_PREFIX=jackfrancis make docker-push
IMAGE_NAME ?= ${SHORT_NAME}-api
IMAGE_REPO ?= bitnami/${SHORT_NAME}-api
IMAGE_TAG ?= latest

IMAGE := ${IMAGE_REGISTRY}${IMAGE_PREFIX}/${IMAGE_NAME}:${VERSION}
MUTABLE_IMAGE := ${IMAGE_REGISTRY}${IMAGE_PREFIX}/${IMAGE_NAME}:${MUTABLE_VERSION}
IMAGE := ${IMAGE_REPO}:${IMAGE_TAG}

.PHONY: docker-push
docker-push: docker-immutable-push docker-mutable-push

.PHONY: docker-immutable-push
docker-immutable-push:
docker-push:
docker push ${IMAGE}

.PHONY: docker-mutable-push
docker-mutable-push:
docker push ${MUTABLE_IMAGE}
16 changes: 11 additions & 5 deletions src/ui/Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
IMAGE_REPO ?= bitnami/monocular-ui
IMAGE_TAG ?= latest

install:
npm install
docker-compose run --rm ui npm install

test:
npm test
docker-compose run --rm ui npm test

test-ci:
npm run test-ci
docker-compose run --rm ui npm run test-ci

compile:
npm run compile
docker-compose run --rm ui npm run compile

compile-aot:
npm run compile-aot
docker-compose run --rm ui npm run compile-aot

docker-build: compile-aot
docker build --rm -t ${IMAGE_REPO}:${IMAGE_TAG} rootfs/
4 changes: 2 additions & 2 deletions src/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"test-ci": "ng test --single-run",
"pree2e": "webdriver-manager update",
"e2e": "protractor",
"compile": "ng build --prod --progress=false",
"compile-aot": "ng build --prod --aot --progress=false"
"compile": "ng build --prod --progress=false -o rootfs/dist",
"compile-aot": "ng build --prod --aot --progress=false -o rootfs/dist"
},
"private": true,
"dependencies": {
Expand Down

0 comments on commit ebbe797

Please sign in to comment.