Skip to content

Commit

Permalink
feat(build): enable arm64 auto build
Browse files Browse the repository at this point in the history
enable arm64 auto build

Signed-off-by: Akhil Mohan <akhil.mohan@mayadata.io>
  • Loading branch information
akhilerm committed Apr 6, 2020
1 parent 7daa3c6 commit c7b96f7
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 16 deletions.
40 changes: 26 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ cache:
go:
- 1.12.16

jobs:
include:
- os: linux
arch: amd64
- os: linux
arch: arm64

addons:
apt:
update: true
Expand All @@ -31,29 +38,34 @@ install:
- make format
before_script:
# Download kubectl, which is a requirement for using minikube.
- curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/v1.13.0/bin/linux/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin/
# Download minikube.
- curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.35.0/minikube-linux-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/
- mkdir -p $HOME/.kube $HOME/.minikube
- touch $KUBECONFIG
- sudo minikube start --vm-driver=none --kubernetes-version=v1.13.0
- "sudo chown -R travis: /home/travis/.minikube/"
- if [ "$TRAVIS_CPU_ARCH" == "amd64" ]; then
curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/v1.13.0/bin/linux/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin/;
curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.35.0/minikube-linux-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/;
mkdir -p $HOME/.kube $HOME/.minikube;
touch $KUBECONFIG;
sudo minikube start --vm-driver=none --kubernetes-version=v1.13.0;
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;
sudo chown -R travis:travis /home/travis/.minikube/;
fi
# 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
# Download and initialize helm.
#- ./ci/ubuntu-compile-nsenter.sh && sudo cp .tmp/util-linux-2.30.2/nsenter /usr/bin
#- curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get > get_helm.sh
#- chmod 700 get_helm.sh
#- ./get_helm.sh
#- helm init
script:
- kubectl cluster-info
# Verify kube-addon-manager.
# kube-addon-manager is responsible for managing other kubernetes components, such as kube-dns, dashboard, storage-provisioner..
- 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
- kubectl get deployment
- if [ "$TRAVIS_CPU_ARCH" == "amd64" ]; then
kubectl cluster-info;
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;
kubectl get deployment;
fi
# Verify kube-addon-manager.
# kube-addon-manager is responsible for managing other kubernetes components, such as kube-dns, dashboard, storage-provisioner..
- ./buildscripts/travis-build.sh
- ./ci/travis-ci.sh
- if [ "$TRAVIS_CPU_ARCH" == "amd64" ]; then
./ci/travis-ci.sh;
fi
after_success:
- make deploy-images
- bash <(curl -s https://codecov.io/bash)
Expand Down
6 changes: 5 additions & 1 deletion buildscripts/travis-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,11 @@ printf "\n"
./buildscripts/test-cov.sh
rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi

make all
if [ "$TRAVIS_CPU_ARCH" == "arm64" ]; then
make all.arm64
else
make all
fi
rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi

if [ $SRC_REPO != $DST_REPO ];
Expand Down
2 changes: 1 addition & 1 deletion ci/build-maya.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if [ ${CI_TAG} != "ci" ]; then
sudo docker tag openebs/provisioner-localpv:ci openebs/provisioner-localpv:${CI_TAG}
fi

#Tag the images with quay.io, since the operator can either have quay or docker images
#Tag the images with quay.io, since the operator can eitest-scther have quay or docker images
sudo docker tag openebs/m-apiserver:ci quay.io/openebs/m-apiserver:${CI_TAG}
sudo docker tag openebs/m-exporter:ci quay.io/openebs/m-exporter:${CI_TAG}
sudo docker tag openebs/cstor-pool-mgmt:ci quay.io/openebs/cstor-pool-mgmt:${CI_TAG}
Expand Down

0 comments on commit c7b96f7

Please sign in to comment.