-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
49 lines (42 loc) · 1.32 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
48
49
sudo: required
language: go
env:
global:
- OWNER=containerum
- NAME=solutions
- 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
- go get github.com/mikefarah/yq
- sudo apt-get install jq
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}"
- yq write --inplace charts/$NAME/values.yaml image.tag "${TRAVIS_TAG}"
- 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