Skip to content
This repository has been archived by the owner on Jan 28, 2022. It is now read-only.

Commit

Permalink
Merge pull request #8 from microsoft/Azadehkhojandi-patch-2
Browse files Browse the repository at this point in the history
Create azure-pipelines-ci-artifacts.yaml
  • Loading branch information
Azadehkhojandi authored May 23, 2019
2 parents 82b3603 + bdc6fbf commit 7dc920e
Showing 1 changed file with 86 additions and 0 deletions.
86 changes: 86 additions & 0 deletions databricks-operator/azure-pipelines-ci-artifacts.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
pool:
vmImage: 'Ubuntu 16.04'

variables:
GOBIN: '$(GOPATH)/bin' # Go binaries path
GOROOT: '/usr/local/go1.12.1' # Go installation path
GOPATH: '$(system.defaultWorkingDirectory)/gopath' # Go workspace path
modulePath: '$(GOPATH)/src/$(build.repository.name)' # Path to the module's code
IMAGE_NAME: 'public/k8s/azure-databricks/operator:$(Build.SourceVersion)'
#ACR_NAME - set this value in AzureDevops variables
#AZURE_SUBSCRIPTION - set this value in AzureDevops variables
steps:
- script: |
mkdir -p '$(GOBIN)'
mkdir -p '$(GOPATH)/pkg'
mkdir -p '$(modulePath)'
shopt -s extglob
mv !(gopath) '$(modulePath)'
echo '##vso[task.prependpath]$(GOBIN)'
echo '##vso[task.prependpath]$(GOROOT)/bin'
echo 'GOPATH'
ls $(GOPATH)
echo 'modulePath'
ls $(modulePath)
echo 'GOBIN'
echo $(GOBIN)
echo 'GOROOT'
echo $(GOROOT)
echo 'GOPATH'
echo $(GOPATH)
echo 'modulePath'
echo $(modulePath)
displayName: 'Set up the Go workspace'


- script: |
sudo rm -rf $HOME/.minikube/
curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/v1.13.4/bin/linux/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin/
curl -Lo minikube https://storage.googleapis.com/minikube/releases/v1.0.0/minikube-linux-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/
sudo minikube start --vm-driver=none --bootstrapper=kubeadm --kubernetes-version=v1.13.4 --extra-config kubeadm.ignore-preflight-errors=SystemVerification
sudo chmod --recursive 777 $HOME/.minikube
sudo chmod --recursive 777 $HOME/.kube
minikube update-context
# Wait for Kubernetes to be up and ready.
JSONPATH='{range .items[*]}{@.metadata.name}:{range @.status.conditions[*]}{@.type}={@.status};{end}{end}'; until kubectl get nodes -o jsonpath="$JSONPATH" 2>&1 | grep -q "Ready=True"; do sleep 1; done
JSONPATH='{range .items[*]}{@.metadata.name}:{range @.status.conditions[*]}{@.type}={@.status};{end}{end}'; until kubectl -n kube-system get pods -lcomponent=kube-addon-manager -o jsonpath="$JSONPATH" 2>&1 | grep -q "Ready=True"; do sleep 1;echo "waiting for kube-addon-manager to be available"; kubectl get pods --all-namespaces; done
JSONPATH='{range .items[*]}{@.metadata.name}:{range @.status.conditions[*]}{@.type}={@.status};{end}{end}'; until kubectl -n kube-system get pods -lk8s-app=kube-dns -o jsonpath="$JSONPATH" 2>&1 | grep -q "Ready=True"; do sleep 1;echo "waiting for kube-dns to be available"; kubectl get pods --all-namespaces; done
kubectl cluster-info
workingDirectory: '$(modulePath)'
continueOnError: 'true'
displayName: 'Set up the Kubernetes installation'



- script: |
go version
go env
# go get -v -t -d ./...
if [ -f Gopkg.toml ]; then
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
dep ensure
fi
go get github.com/jstemmer/go-junit-report
go get github.com/axw/gocov/gocov
go get github.com/AlekSi/gocov-xml
go get -u gopkg.in/matm/v1/gocov-html
workingDirectory: '$(modulePath)'
displayName: 'Get dependencies'

- script: |
make build
workingDirectory: '$(modulePath)'
continueOnError: 'false'
displayName: 'Build app'

- script: |
make install
make test
continueOnError: 'true'
workingDirectory: '$(modulePath)'
displayName: 'Run unit tests'

- script: docker build -t $(IMAGE_NAME) . # add options to this command to meet your needs
workingDirectory: '$(modulePath)'
displayName: 'Docker build'

0 comments on commit 7dc920e

Please sign in to comment.