Skip to content

Commit

Permalink
Update travis file
Browse files Browse the repository at this point in the history
  • Loading branch information
TommyLike committed Jul 16, 2019
1 parent a4aa2f2 commit bd6b638
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 39 deletions.
46 changes: 16 additions & 30 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,37 +10,23 @@ services:
go_import_path: volcano.sh/volcano
jobs:
include:
- stage: Golint & Gofmt
before_script:
- go get -u golang.org/x/lint/golint
- stage: publish release
before_deploy:
- export TRAVIS_TAG=$(git describe --tags)
script:
- make verify
- stage: UT Tests
before_script:
- go get github.com/mattn/goveralls
script:
- make unit-test && $HOME/gopath/bin/goveralls -coverprofile=coverage.txt -service=travis-ci
- stage: E2E Tests
before_script:
# Download kubectl
- sudo apt-get update && sudo apt-get install -y apt-transport-https
- curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
- echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee -a /etc/apt/sources.list.d/kubernetes.list
- sudo apt-get update
- sudo apt-get install -y kubectl
# Download kind binary (0.2.0)
- sudo curl -o /usr/local/bin/kind -L https://github.com/kubernetes-sigs/kind/releases/download/v0.4.0/kind-linux-amd64
- sudo chmod +x /usr/local/bin/kind
script:
- make vcctl
- make images
- make e2e-test-kind
after_failure:
# Echo logs and upload
- test -f helm-tiller.log && "******<<helm tiller service logs>>******" && cat helm-tiller.log
- test -f volcano-admission.log && echo "******<<admission logs>>******" && cat volcano-admission.log
- test -f volcano-controller.log && echo "******<<controller logs>>******" && cat volcano-controller.log
- test -f volcano-scheduler.log && echo "******<<scheduler logs>>******" && cat volcano-scheduler.log
- echo "publish release to github & dockerhub"
deploy:
- provider: script
script: make TAG=${TRAVIS_TAG} RELEASE_VER=${TRAVIS_TAG} release
on:
tags: true
- provider: releases
api_key: $GITHUB_TOKEN
file_glob: true
file: _output/volcano-${TRAVIS_TAG}-${OSTYPE}.tar.gz
skip_cleanup: true
on:
tags: true
notifications:
webhooks: https://www.travisbuddy.com/
on_success: never
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ unit-test:
e2e-test-kind:
./hack/run-e2e-kind.sh

generate-yaml:
generate-yaml: init
./hack/generate-yaml.sh


release: image_bins generate-yaml
release: images generate-yaml
./hack/publish.sh

clean:
Expand Down
22 changes: 18 additions & 4 deletions hack/generate-yaml.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ set -o pipefail

VK_ROOT=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/..
export HELM_BIN_DIR=${VK_ROOT}/${BIN_DIR}
export RELEASE_FOLDER=${HELM_BIN_DIR}/${RELEASE_DIR}
export RELEASE_FOLDER=${VK_ROOT}/${RELEASE_DIR}

export HELM_VER=${HELM_VER:-v2.13.0}
export YAML_FILENAME=${YAML_FILENAME:-"volcano-deployment.yaml"}
export VOLCANO_IMAGE_TAG=${VOLCANO_IMAGE_TAG:-"latest"}
export VOLCANO_IMAGE_TAG=${TAG:-"latest"}

LOCAL_OS=${OSTYPE}
case $LOCAL_OS in
Expand Down Expand Up @@ -57,10 +57,24 @@ fi
if [[ ! -d ${RELEASE_FOLDER} ]];then
mkdir ${RELEASE_FOLDER}
fi
echo "Generating volcano yaml file into ${DEPLOYMENT_FILE}}"

DEPLOYMENT_FILE=${RELEASE_FOLDER}/${YAML_FILENAME}
echo "Generating volcano yaml file into ${DEPLOYMENT_FILE}}"

if [[ -f ${DEPLOYMENT_FILE} ]];then
rm ${DEPLOYMENT_FILE}
fi
cat ${VK_ROOT}/installer/namespace.yaml > ${DEPLOYMENT_FILE}
${HELM_BIN_DIR}/helm template ${VK_ROOT}/installer/helm/chart/volcano --namespace volcano-system --name volcano --set basic.image_tag_version=${VOLCANO_IMAGE_TAG} --set basic.scheduler_config_file=kube-batch-ci.conf >> ${DEPLOYMENT_FILE}
${HELM_BIN_DIR}/helm template ${VK_ROOT}/installer/helm/chart/volcano --namespace volcano-system \
--name volcano --set basic.image_tag_version=${VOLCANO_IMAGE_TAG} \
--set basic.scheduler_config_file=kube-batch-ci.conf \
-x templates/admission.yaml \
-x templates/batch_v1alpha1_job.yaml \
-x templates/bus_v1alpha1_command.yaml \
-x templates/controllers.yaml \
-x templates/scheduler.yaml \
-x templates/scheduling_v1alpha1_podgroup.yaml \
-x templates/scheduling_v1alpha1_queue.yaml \
-x templates/scheduling_v1alpha2_podgroup.yaml \
-x templates/scheduling_v1alpha2_queue.yaml \
--notes >> ${DEPLOYMENT_FILE}
27 changes: 25 additions & 2 deletions hack/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ set -o pipefail
# 1. cp binaries into release folder
# 2. cp README document into release folder
# 3. cp default queue into release folder
# 4. cp helm charts template into release folder
# 4. cp helm charts template into release folder and update default image tag
# 5. upload docker images to volcano.sh
# 6. generate zip file

VK_ROOT=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/..
BINARY_FOLDER=${VK_ROOT}/${BIN_DIR}/${REL_OSARCH}
Expand All @@ -33,8 +35,11 @@ RELEASE_BINARY=${RELEASE_FOLDER}/bin
QUEUE_FILE=${VK_ROOT}/installer/helm/chart/volcano/templates/default-queue.yaml
README_FILE=${VK_ROOT}/installer/README.md
HELM_FOLDER=${VK_ROOT}/installer/helm
VOLCANO_IMAGE_TAG=${TAG:-"latest"}
DOCKER_PASSWORD=${DOCKER_PASSWORD:-""}
DOCKER_USERNAME=${DOCKER_USERNAME:-""}

if [[ ! -f ${RELEASE_BINARY} ]];then
if [[ ! -d ${RELEASE_BINARY} ]];then
mkdir ${RELEASE_BINARY}
fi

Expand All @@ -46,4 +51,22 @@ cp ${QUEUE_FILE} ${RELEASE_FOLDER}

cp -r ${HELM_FOLDER} ${RELEASE_FOLDER}

# overwrite the tag name into values yaml
sed -i "s/latest/${VOLCANO_IMAGE_TAG}/g" ${HELM_FOLDER}/chart/volcano/values.yaml

if [[ "${DOCKER_USERNAME}xxx" == "xxx" ]];then
if [[ "${DOCKER_PASSWORD}xxx" == "xxx" ]];then
echo "docker username or password not found, quit uploading images"
exit 0
fi
fi

echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_USERNAME}" --password-stdin
echo "pushing ${IMAGE_PREFIX}-controllers:${VOLCANO_IMAGE_TAG}"
docker push ${IMAGE_PREFIX}-controllers:${VOLCANO_IMAGE_TAG}
docker push ${IMAGE_PREFIX}-scheduler:${VOLCANO_IMAGE_TAG}
docker push ${IMAGE_PREFIX}-admission:${VOLCANO_IMAGE_TAG}

echo "Generate release tar files"
cd ${RELEASE_FOLDER}/../
tar -zcvf volcano-${VOLCANO_IMAGE_TAG}-${OSTYPE}.tar.gz ${RELEASE_FOLDER}
6 changes: 6 additions & 0 deletions installer/helm/chart/volcano/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Thank you for installing {{ .Chart.Name }}.

Your release is named {{ .Release.Name }}.

For more information on volcano, visit:
https://volcano.sh/
1 change: 0 additions & 1 deletion installer/namespace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ apiVersion: v1
kind: Namespace
metadata:
name: volcano-system
---

0 comments on commit bd6b638

Please sign in to comment.