Skip to content

Commit

Permalink
release: move to travis
Browse files Browse the repository at this point in the history
Use travis to release the component

Signed-off-by: Francesco Romani <fromani@redhat.com>
  • Loading branch information
ffromani committed May 7, 2019
1 parent c1d518e commit 7561724
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 48 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ _testmain.go

Gopkg.lock
tags
cmd/kubevirt-metrics-collector/kubevirt-metrics-collector
_out
internal/pkg/version/version.go
pkg/monitoring/processes/coverage.out
Expand Down
27 changes: 27 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
sudo: required
dist: xenial
language: go
go: "1.11"

services:
- docker

jobs:
include:
- stage: Build and Deploy
name: Build and Deploy to GitHub
before_script: skip
script: make release "VERSION=$TRAVIS_TAG"
deploy:
provider: releases
api_key: "$GITHUB_TOKEN"
skip_cleanup: true
overwrite: true
file_glob: true
file:
- _out/*
name: $TRAVIS_TAG
on:
tags: true
branch: master
repo: fromanirh/kubevirt-metrics-collector
23 changes: 10 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
all: binary

docker: binary
docker build .
#vendor:
# dep ensure

dockertag: binary
./hack/docker/tag.sh
binary: #vendor
./hack/build/build.sh ${VERSION}

dockerpush: binary
./hack/docker/push.sh

vendor:
dep ensure

binary: vendor
./hack/build/build.sh
release: binary
mkdir -p _out
cp cmd/kubevirt-metrics-collector/kubevirt-metrics-collector _out/kubevirt-metrics-collector-${VERSION}-linux-amd64
hack/container/docker-push.sh ${VERSION}

clean:
rm -f cmd/kubevirt-metrics-collector/kubevirt-metrics-collector
rm -rf _out

.PHONY: all docker dockertag dockerpush binary clean
.PHONY: all vendor binary release clean

Binary file not shown.
8 changes: 6 additions & 2 deletions hack/container/docker-push.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/bin/bash

TAG="${1:-devel}"
set -e

docker build -t fromanirh/kubevirt-metrics-collector:$TAG . && docker push fromanirh/kubevirt-metrics-collector:$TAG
VERSION="${1:-devel}"

echo "$QUAY_BOT_PASS" | docker login -u="$QUAY_BOT_USER" --password-stdin quay.io
docker build -t quay.io/fromani/kubevirt-metrics-collector:$VERSION .
docker push quay.io/fromani/kubevirt-metrics-collector:$VERSION
33 changes: 0 additions & 33 deletions hack/release.sh

This file was deleted.

0 comments on commit 7561724

Please sign in to comment.