Skip to content

Commit

Permalink
Merge pull request kubevirt#129 from screeley44/travis-update
Browse files Browse the repository at this point in the history
WIP: add git tag and release
  • Loading branch information
copejon committed May 3, 2018
2 parents 21ccaf3 + 4660a4b commit bdfe980
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 7 deletions.
32 changes: 32 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,35 @@ script:
- kubectl get pods --all-namespaces

- make test

before_deploy:
- include version
- make controller importer
- git config --local user.name "screeley44"
- git config --local user.email "screeley@redhat.com"
- git tag "$(RELEASE_TAG)"
# - git tag "$(date +'%Y%m%d%H%M%S')-$(git log --format=%h -1)"

deploy:
- provider: script
script: docker login -u="$DOCKER_USER" -p="$DOCKER_PASS"
skip_cleanup: true
on:
branch: master
repo: kubevirt/containerized-data-importer
- provider: script
script: make release
skip_cleanup: true
overwrite: true
on:
branch: master
repo: kubevirt/containerized-data-importer
- provider: releases
skip_cleanup: true
overwrite: true
file:
- build/controller/tmp/*
- build/importer/tmp/*
on:
branch: master
repo: kubevirt/containerized-data-importer
17 changes: 10 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include version # Provides `VERSION` variable
include version # Provides `RELEASE VERSIONING` variables

REPO_ROOT=$(abspath $(dir $(lastword $(MAKEFILE_LIST))))

Expand Down Expand Up @@ -32,9 +32,12 @@ CTRL_IMG_NAME=cdi-$(CONTROLLER)
IMPT_IMG_NAME=cdi-$(IMPORTER)
GIT_USER=$(shell git config --get user.email | sed 's/@.*//')
TAG=$(GIT_USER)-latest
RELEASE_TAG=-$(RELEASE_TAG)
PRERELEASE_TAG=-$(PRERELEASE_TAG)

.PHONY: controller importer controller-bin importer-bin controller-image importer-image push-controller push-importer clean test
.PHONY: controller importer controller-bin importer-bin controller-image importer-image push-controller push-controller-release push-importer-release push-importer clean test
all: clean test controller importer
pre-release: all
controller: controller-bin controller-image
importer: importer-bin importer-image
push: push-importer push-controller
Expand Down Expand Up @@ -133,13 +136,13 @@ clean:
-rm -rf $(IMPORTER_BUILD)/tmp

# push cdi-importer and cdi-controller images to kubevirt repo for general use. Intended to release stable image built from master branch.
release: all
release: controller importer
@echo '********'
@echo 'Releasing CDI images'
docker tag $(IMPT_IMG_NAME) $(RELEASE_REGISTRY)/$(IMPT_IMG_NAME):$(VERSION)
docker push $(RELEASE_REGISTRY)/$(IMPT_IMG_NAME):$(VERSION)
docker tag $(CTRL_IMG_NAME) $(RELEASE_REGISTRY)/$(CTRL_IMG_NAME):$(VERSION)
docker push $(RELEASE_REGISTRY)/$(CTRL_IMG_NAME):$(VERSION)
docker tag $(IMPT_IMG_NAME) $(RELEASE_REGISTRY)/$(IMPT_IMG_NAME):$(RELEASE_TAG)
docker push $(RELEASE_REGISTRY)/$(IMPT_IMG_NAME):$(RELEASE_TAG)
docker tag $(CTRL_IMG_NAME) $(RELEASE_REGISTRY)/$(CTRL_IMG_NAME):$(RELEASE_TAG)
docker push $(RELEASE_REGISTRY)/$(CTRL_IMG_NAME):$(RELEASE_TAG)

my-golden-pvc.yaml: manifests/example/golden-pvc.yaml
sed "s,endpoint:.*,endpoint: \"$(URI)\"," $< > $@
Expand Down
3 changes: 3 additions & 0 deletions version
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
VERSION=0.4.0-alpha.0
# PRERELEASE_TAG indicates current working version in master branch
RELEASE_TAG=v0.5.0-alpha.0

0 comments on commit bdfe980

Please sign in to comment.