Skip to content

Commit

Permalink
Merge pull request #353 from ywk253100/190916_ci
Browse files Browse the repository at this point in the history
Enable Travis CI to do the basic verification for PRs
  • Loading branch information
ywk253100 committed Sep 20, 2019
2 parents d492643 + 0f3201e commit b0187ba
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .helmignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
docs/*
.git/*
.gitignore
CONTRIBUTING.md
CONTRIBUTING.md
.travis.yaml
test/*
15 changes: 15 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
dist: xenial
language: minimal
matrix:
include:
- name: "helm v2"
env: HELM_VERSION=2
- name: "helm v3"
env: HELM_VERSION=3
before_install:
- test/install_helm.sh
before_script:
# rename the "harbor-helm" folder to "harbor" to avoid the helm lint failure
- cd ..; mv harbor-helm harbor; cd harbor
script:
- test/verify.sh
3 changes: 2 additions & 1 deletion Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
apiVersion: v1
name: harbor
version: dev
version: 1.2.0-dev
appVersion: dev
description: An open source trusted cloud native registry that stores, signs, and scans content
keywords:
Expand Down
24 changes: 24 additions & 0 deletions test/install_helm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#/bin/bash
set -e
version=${HELM_VERSION}
if [ "$version" = "2" ]
then
dist="helm-v2.8.0-linux-amd64.tar.gz"
# as the helm v3 removes tiller, here appends the "-c" option
# to args only when running helm v2 to display the client version
version_args="-c"
elif [ "$version" = "3" ]
then
# the "template" command doesn't work for helm beta3:
# https://github.com/helm/helm/issues/6404, use the beta2 for now
dist="helm-v3.0.0-beta.2-linux-amd64.tar.gz"
else
echo "unsupported helm version: $version"
exit 1
fi
wget -O /tmp/${dist} https://get.helm.sh/${dist}
tar -zxvf /tmp/${dist} -C /tmp/

sudo mv /tmp/linux-amd64/helm /usr/local/bin/helm
helm version $version_args
echo "Helm installed"
8 changes: 8 additions & 0 deletions test/verify.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#/bin/bash
set -e

helm lint .
# expose the service via ingress, this disables the deployment of nginx
helm template --set "expose.type=ingress" --output-dir /tmp/ .
# expose the service via node port, this enables the deployment of nginx
helm template --set "expose.type=nodePort,expose.tls.commonName=127.0.0.1" --output-dir /tmp/ .

0 comments on commit b0187ba

Please sign in to comment.