This repository has been archived by the owner on Jan 22, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #76 from Azure/convert-to-go-modules
Convert to go modules and upgrade support to k8s 1.15
- Loading branch information
Showing
2,643 changed files
with
340,305 additions
and
249,223 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,147 +1,153 @@ | ||
# This pipeline tests the project and builds an image, which is pushed to a | ||
# container registry for later use | ||
|
||
trigger: | ||
- master | ||
pr: | ||
- master | ||
variables: | ||
- group: 'Metrics Adapter' | ||
jobs: | ||
- job: buildAndTest | ||
pool: | ||
vmImage: 'ubuntu-16.04' | ||
steps: | ||
|
||
# Set up the Go workspace | ||
# Go workspace setup from https://docs.microsoft.com/en-us/azure/devops/pipelines/languages/go?view=azure-devops | ||
- script: | | ||
mkdir -p '$(GOBIN)' | ||
mkdir -p '$(GOPATH)/pkg' | ||
mkdir -p '$(modulePath)' | ||
shopt -s extglob | ||
shopt -s dotglob | ||
mv !(go) '$(modulePath)' | ||
echo '##vso[task.prependpath]$(GOBIN)' | ||
echo '##vso[task.prependpath]$(GOROOT)/bin' | ||
cd $(modulePath) | ||
go get -v -t -d ./... | ||
if [ -f Gopkg.toml ]; then | ||
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh | ||
fi | ||
displayName: 'Set up the Go workspace' | ||
# make build | ||
- script: 'make build' | ||
workingDirectory: '$(modulePath)' | ||
displayName: 'make build (Verify autogenerated scripts/Run tests/Build image)' | ||
env: | ||
VERSION: $(Build.BuildId) | ||
|
||
# docker push | ||
- script: 'make push' | ||
workingDirectory: '$(modulePath)' | ||
displayName: 'make push (docker push)' | ||
env: | ||
VERSION: $(Build.BuildId) | ||
DOCKER_PASS: $(DOCKER_PASS) | ||
|
||
- job: e2eTests | ||
dependsOn: buildAndTest | ||
|
||
# This will run this job 4 times with these 4 sets of variables | ||
strategy: | ||
matrix: | ||
K8s10: | ||
SERVICEBUS_SUBSCRIPTION_NAME: 'externalsub-10' | ||
SERVICEBUS_QUEUE_NAME: 'externalq-10' | ||
DOCKER_VERSION: '18.06.1~ce~3-0~ubuntu' | ||
KUBERNETES_VERSION: '1.10.12' | ||
K8s11: | ||
SERVICEBUS_SUBSCRIPTION_NAME: 'externalsub-11' | ||
SERVICEBUS_QUEUE_NAME: 'externalq-11' | ||
DOCKER_VERSION: '17.03.3~ce-0~ubuntu-xenial' | ||
KUBERNETES_VERSION: '1.11.6' | ||
K8s12: | ||
SERVICEBUS_SUBSCRIPTION_NAME: 'externalsub-12' | ||
SERVICEBUS_QUEUE_NAME: 'externalq-12' | ||
DOCKER_VERSION: '18.06.1~ce~3-0~ubuntu' | ||
KUBERNETES_VERSION: '1.12.4' | ||
K8s13: | ||
SERVICEBUS_SUBSCRIPTION_NAME: 'externalsub-13' | ||
SERVICEBUS_QUEUE_NAME: 'externalq-13' | ||
DOCKER_VERSION: '18.06.1~ce~3-0~ubuntu' | ||
KUBERNETES_VERSION: '1.13.1' | ||
|
||
pool: | ||
vmImage: 'ubuntu-16.04' | ||
steps: | ||
|
||
# Print version details | ||
- script: | | ||
echo "This build uses the following versions:" | ||
echo "Kubernetes: $(KUBERNETES_VERSION)" | ||
echo "Minikube: $(MINIKUBE_VERSION)" | ||
echo "Helm: $(HELM_VERSION)" | ||
echo "Docker: $(DOCKER_VERSION)" | ||
displayName: 'Print version details' | ||
# Set up the Go workspace | ||
# Go workspace setup from https://docs.microsoft.com/en-us/azure/devops/pipelines/languages/go?view=azure-devops | ||
- script: | | ||
mkdir -p '$(GOBIN)' | ||
mkdir -p '$(GOPATH)/pkg' | ||
mkdir -p '$(modulePath)' | ||
shopt -s extglob | ||
shopt -s dotglob | ||
mv !(go) '$(modulePath)' | ||
echo '##vso[task.prependpath]$(GOBIN)' | ||
echo '##vso[task.prependpath]$(GOROOT)/bin' | ||
cd $(modulePath) | ||
go get -v -t -d ./... | ||
if [ -f Gopkg.toml ]; then | ||
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh | ||
fi | ||
displayName: 'Set up the Go workspace' | ||
# Install docker | ||
- script: | | ||
chmod +x *.sh | ||
./install-docker.sh | ||
workingDirectory: '$(modulePath)/.azdevops/0_install' | ||
displayName: 'Install docker (must continue on error)' | ||
# Install everything else needed | ||
- script: | | ||
./install-misc.sh | ||
./install-crictl.sh | ||
./install-minikube.sh | ||
./install-helm.sh | ||
workingDirectory: '$(modulePath)/.azdevops/0_install' | ||
displayName: 'Install everything else' | ||
# Start the cluster, get go packages, install tiller, set up metrics server, gen the local values file | ||
- script: | | ||
chmod +x *.sh | ||
./start-cluster.sh | ||
./go-get.sh | ||
./check-cluster.sh | ||
./init-tiller.sh | ||
./gen-values-file.sh | ||
workingDirectory: '$(modulePath)/.azdevops/1_setup' | ||
displayName: 'Cluster set up, Go get, prep for adapter deployment' | ||
env: | ||
VERSION: $(Build.BuildId) | ||
# Run hack/test-e2e.sh | ||
- script: | | ||
chmod +x *.sh | ||
./run-e2e.sh | ||
workingDirectory: '$(modulePath)/hack' | ||
displayName: 'Run e2e test script (deploy adapter & test functionality)' | ||
failOnStderr: true | ||
env: | ||
SERVICEBUS_CONNECTION_STRING: $(SERVICEBUS_CONNECTION_STRING) | ||
SP_CLIENT_ID: $(SP_CLIENT_ID) | ||
SP_TENANT_ID: $(SP_TENANT_ID) | ||
# This pipeline tests the project and builds an image, which is pushed to a | ||
# container registry for later use | ||
|
||
trigger: | ||
- master | ||
pr: | ||
- master | ||
variables: | ||
- group: 'Metrics Adapter' | ||
jobs: | ||
- job: buildAndTest | ||
pool: | ||
vmImage: 'ubuntu-16.04' | ||
steps: | ||
|
||
# Set up the Go workspace | ||
# Go workspace setup from https://docs.microsoft.com/en-us/azure/devops/pipelines/languages/go?view=azure-devops | ||
- script: | | ||
mkdir -p '$(GOBIN)' | ||
mkdir -p '$(GOPATH)/pkg' | ||
mkdir -p '$(modulePath)' | ||
shopt -s extglob | ||
shopt -s dotglob | ||
mv !(go) '$(modulePath)' | ||
echo '##vso[task.prependpath]$(GOBIN)' | ||
echo '##vso[task.prependpath]$(GOROOT)/bin' | ||
cd $(modulePath) | ||
go get -v -t -d ./... | ||
if [ -f Gopkg.toml ]; then | ||
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh | ||
fi | ||
displayName: 'Set up the Go workspace' | ||
# make build | ||
- script: 'make build' | ||
workingDirectory: '$(modulePath)' | ||
displayName: 'make build (Verify autogenerated scripts/Run tests/Build image)' | ||
env: | ||
VERSION: $(Build.BuildId) | ||
GO111MODULE: on | ||
|
||
# docker push | ||
- script: 'make push' | ||
workingDirectory: '$(modulePath)' | ||
displayName: 'make push (docker push)' | ||
env: | ||
VERSION: $(Build.BuildId) | ||
DOCKER_PASS: $(DOCKER_PASS) | ||
|
||
- job: e2eTests | ||
dependsOn: buildAndTest | ||
|
||
# This will run this job 4 times with these 4 sets of variables | ||
strategy: | ||
matrix: | ||
K8s11: | ||
SERVICEBUS_SUBSCRIPTION_NAME: 'externalsub-11' | ||
SERVICEBUS_QUEUE_NAME: 'externalq-11' | ||
DOCKER_VERSION: '17.03.3~ce-0~ubuntu-xenial' | ||
KUBERNETES_VERSION: '1.11.10' | ||
K8s12: | ||
SERVICEBUS_SUBSCRIPTION_NAME: 'externalsub-12' | ||
SERVICEBUS_QUEUE_NAME: 'externalq-12' | ||
DOCKER_VERSION: '18.06.1~ce~3-0~ubuntu' | ||
KUBERNETES_VERSION: '1.12.4' | ||
K8s13: | ||
SERVICEBUS_SUBSCRIPTION_NAME: 'externalsub-13' | ||
SERVICEBUS_QUEUE_NAME: 'externalq-13' | ||
DOCKER_VERSION: '18.06.1~ce~3-0~ubuntu' | ||
KUBERNETES_VERSION: '1.13.1' | ||
K8s14: | ||
SERVICEBUS_SUBSCRIPTION_NAME: 'externalsub-14' | ||
SERVICEBUS_QUEUE_NAME: 'externalq-14' | ||
DOCKER_VERSION: '18.06.1~ce~3-0~ubuntu' | ||
KUBERNETES_VERSION: '1.14.8' | ||
K8s15: | ||
SERVICEBUS_SUBSCRIPTION_NAME: 'externalsub-15' | ||
SERVICEBUS_QUEUE_NAME: 'externalq-15' | ||
DOCKER_VERSION: '18.06.1~ce~3-0~ubuntu' | ||
KUBERNETES_VERSION: '1.15.5' | ||
|
||
pool: | ||
vmImage: 'ubuntu-16.04' | ||
steps: | ||
|
||
# Print version details | ||
- script: | | ||
echo "This build uses the following versions:" | ||
echo "Kubernetes: $(KUBERNETES_VERSION)" | ||
echo "Minikube: $(MINIKUBE_VERSION)" | ||
echo "Helm: $(HELM_VERSION)" | ||
echo "Docker: $(DOCKER_VERSION)" | ||
displayName: 'Print version details' | ||
# Set up the Go workspace | ||
# Go workspace setup from https://docs.microsoft.com/en-us/azure/devops/pipelines/languages/go?view=azure-devops | ||
- script: | | ||
mkdir -p '$(GOBIN)' | ||
mkdir -p '$(GOPATH)/pkg' | ||
mkdir -p '$(modulePath)' | ||
shopt -s extglob | ||
shopt -s dotglob | ||
mv !(go) '$(modulePath)' | ||
echo '##vso[task.prependpath]$(GOBIN)' | ||
echo '##vso[task.prependpath]$(GOROOT)/bin' | ||
cd $(modulePath) | ||
go get -v -t -d ./... | ||
if [ -f Gopkg.toml ]; then | ||
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh | ||
fi | ||
displayName: 'Set up the Go workspace' | ||
# Install docker | ||
- script: | | ||
chmod +x *.sh | ||
./install-docker.sh | ||
workingDirectory: '$(modulePath)/.azdevops/0_install' | ||
displayName: 'Install docker (must continue on error)' | ||
# Install everything else needed | ||
- script: | | ||
./install-misc.sh | ||
./install-crictl.sh | ||
./install-minikube.sh | ||
./install-helm.sh | ||
workingDirectory: '$(modulePath)/.azdevops/0_install' | ||
displayName: 'Install everything else' | ||
# Start the cluster, get go packages, install tiller, set up metrics server, gen the local values file | ||
- script: | | ||
chmod +x *.sh | ||
./start-cluster.sh | ||
./go-get.sh | ||
./check-cluster.sh | ||
./init-tiller.sh | ||
./gen-values-file.sh | ||
workingDirectory: '$(modulePath)/.azdevops/1_setup' | ||
displayName: 'Cluster set up, Go get, prep for adapter deployment' | ||
env: | ||
VERSION: $(Build.BuildId) | ||
# Run hack/test-e2e.sh | ||
- script: | | ||
chmod +x *.sh | ||
./run-e2e.sh | ||
workingDirectory: '$(modulePath)/hack' | ||
displayName: 'Run e2e test script (deploy adapter & test functionality)' | ||
failOnStderr: true | ||
env: | ||
SERVICEBUS_CONNECTION_STRING: $(SERVICEBUS_CONNECTION_STRING) | ||
SP_CLIENT_ID: $(SP_CLIENT_ID) | ||
SP_TENANT_ID: $(SP_TENANT_ID) | ||
SP_CLIENT_SECRET: $(SP_CLIENT_SECRET) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,16 +16,26 @@ or contact [[email protected]](mailto:[email protected]) with any addi | |
## Development | ||
To do development you will need: | ||
|
||
- [Golang](https://golang.org/doc/install) - same as current [Kubernetes version ](https://github.com/kubernetes/community/blob/master/contributors/devel/development.md#go) | ||
- [Golang](https://golang.org/doc/install) - atleast 1.12 - but same as current [Kubernetes version ](https://github.com/kubernetes/community/blob/master/contributors/devel/development.md#go) | ||
- Kubernetes cluster - [minikube](https://github.com/kubernetes/minikube), [Docker for Mac with Kubernetes support](https://docs.docker.com/docker-for-mac/kubernetes/), [Docker for Windows with Kubernetes support](https://docs.docker.com/docker-for-windows/kubernetes/), [AKS](https://docs.microsoft.com/en-us/azure/aks/kubernetes-walkthrough) | ||
- [git](https://git-scm.com/downloads) | ||
- [mercurial](https://www.mercurial-scm.org/downloads) | ||
|
||
### Get the source | ||
This project uses [go modules](https://blog.golang.org/using-go-modules). | ||
|
||
If add the project to your `GOPATH` enable go modules before building. | ||
|
||
```bash | ||
go get github.com/Azure/azure-k8s-metrics-adapter | ||
cd $GOPATH/src/github.com/Azure/azure-k8s-metrics-adapter | ||
export GO111MODULE=on | ||
``` | ||
|
||
Otherwise you can clone outside the project go modules will automatically be used if using go 1.12: | ||
|
||
``` | ||
git clone https://github.com/Azure/azure-k8s-metrics-adapter.git | ||
``` | ||
|
||
### Add your fork | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.