-
Notifications
You must be signed in to change notification settings - Fork 4
/
.travis.yml
47 lines (40 loc) · 1.25 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
sudo: required
language: go
env:
global:
- OWNER=containerum
- NAME=kube-events
- IMAGE_NAME=$OWNER/$NAME
- MUSEUM=https://charts.containerum.io
services:
- docker
install:
- curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get | bash
- helm init --client-only
- helm plugin install https://github.com/chartmuseum/helm-push
script:
- docker build -t "$IMAGE_NAME" .
before_deploy:
- docker login -u="$DOCKER_LOGIN" -p="$DOCKER_PASSWORD"
- docker tag "$IMAGE_NAME" "${IMAGE_NAME}:latest"
- docker tag "$IMAGE_NAME" "${IMAGE_NAME}:${TRAVIS_TAG}"
- sed -i "s/v1.0.0/${TRAVIS_TAG}/" charts/$NAME/values.yaml
- mkdir -p /tmp/charts
- helm repo add chartmuseum ${MUSEUM}
- helm package charts/$NAME --version="${TRAVIS_TAG}" --dependency-update --destination /tmp/charts
deploy:
- provider: script
script: docker push "${IMAGE_NAME}:latest" && docker push "${IMAGE_NAME}:${TRAVIS_TAG}"
on:
tags: true
- provider: releases
api_key: $GITHUB_TOKEN
file:
- "/tmp/charts/$NAME-${TRAVIS_TAG}.tgz"
skip_cleanup: true
on:
tags: true
- provider: script
script: helm push -u ${HELM_USER} -p ${HELM_PASSWORD} "/tmp/charts/$NAME-${TRAVIS_TAG}.tgz" chartmuseum
on:
tags: true