-
Notifications
You must be signed in to change notification settings - Fork 813
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
439e2bb
commit e968490
Showing
23 changed files
with
489 additions
and
257 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 |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# Python CircleCI 2.0 configuration file | ||
# | ||
# Check https://circleci.com/docs/2.0/language-python/ for more details | ||
# | ||
version: 2 | ||
jobs: | ||
build: | ||
docker: | ||
# specify the version you desire here | ||
# use `-browsers` prefix for selenium tests, e.g. `3.6.1-browsers` | ||
- image: circleci/python:3.6.1 | ||
|
||
# Specify service dependencies here if necessary | ||
# CircleCI maintains a library of pre-built images | ||
# documented at https://circleci.com/docs/2.0/circleci-images/ | ||
# - image: circleci/postgres:9.4 | ||
|
||
working_directory: ~/repo | ||
|
||
steps: | ||
- checkout | ||
|
||
# Download and cache dependencies | ||
- restore_cache: | ||
keys: | ||
- v1-dependencies-{{ checksum "requirements.txt" }} | ||
# fallback to using the latest cache if no exact match is found | ||
- v1-dependencies- | ||
|
||
- run: | ||
name: install dependencies | ||
command: | | ||
python3 -m venv venv | ||
. venv/bin/activate | ||
pip install -r requirements.txt | ||
- save_cache: | ||
paths: | ||
- ./venv | ||
key: v1-dependencies-{{ checksum "requirements.txt" }} | ||
|
||
# run tests! | ||
# this example uses Django's built-in test-runner | ||
# other common Python testing frameworks include pytest and nose | ||
# https://pytest.org | ||
# https://nose.readthedocs.io | ||
- run: | ||
name: run tests | ||
command: | | ||
. venv/bin/activate | ||
python manage.py test | ||
- store_artifacts: | ||
path: test-reports | ||
destination: test-reports | ||
|
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
minikube for k8s 1.11, which is requires for kubeadm, which requires systemd, which requires ubutnu 16.04+ | ||
|
||
machine: true | ||
priveliged: true | ||
systemd: true | ||
|
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
/home/erik/dev/z2jh-extended/z2jh/ci |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
1.5:b9aaade0-5d14-4395-885c-a36771b7a698 |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
1533580135 |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
1000 |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
b9aaade0-5d14-4395-885c-a36771b7a698 |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
1683168e9eaf4cb4943e8fc9876239a0 |
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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UFw0Zk+a4gXDnNXq | ||
sIFjf/E3mODLVSrWzurkJCdqJqdN8MCkm0mQTIdLTaA65VzVdXzeWooEU+H0gfXM | ||
mgCwtbb7BeshiU8ZFbFhuY/gz1Nuhfa11w/lRCsCgYAyVMGw21uC8hpwOedRry36 | ||
DUtuIxXlJmGZPGGwgtlTXvs568A4RXowQQ8AmAhoA/GLs+NPrjPBR89ATOmJiqys | ||
M6N61EDz9CT54lwv9dKawtcqWuo2U9sifgMYqV6GRzLvKVvcrUsSqleogJRUjy1F | ||
53N6QZ9YBfXHjbH91HOtkQKBgQC+tC1nQ+EpKgUN8We/I0qhedSypl+MpRyb1wMx | ||
tLQk+n7zEkQ7lL7BcOnnPtf2oztf1qSsWHwhiRrchh6LPVPd9u5a7i6VnhoVwZQw | ||
bTIXKHHNpc4SjFhPAYo07I9zgFM15Ij/SU1EznivV8kQfbNBPpYzvD/3ZqHNe46u | ||
9+k7XwKBgQCicJf77CkB7yyh+59DoknFDqOKNX+Wvak05i0sOVQvACCsstUGkKrf | ||
SldirdgH8kEnec77ZMHdDqlSzJRU5GvgEmpU8Lx0NmNA4wVxEeDU8JRdjhbYTlHW | ||
kFgVodrsa34W4nnN23DOe+Fnylqk467uZnESWyAH+UQl6RRtU60UkQ== | ||
-----END RSA PRIVATE KEY----- |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
{"virtualbox":{"/z2jh":{"guestpath":"/z2jh","hostpath":"/home/erik/dev/z2jh-extended/z2jh","disabled":false,"__vagrantfile":true},"/vagrant":{"guestpath":"/vagrant","hostpath":"/home/erik/dev/z2jh-extended/z2jh/ci","disabled":false,"__vagrantfile":true}}} |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
/home/erik/dev/z2jh-extended/z2jh/ci |
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/sh | ||
|
||
# Meant to be run from the Vagrantfile allowing | ||
|
||
# Set shell options | ||
# -e : Exit immediately if a command exits with a non-zero status. | ||
# -u : Treat unset variables as an error when substituting. | ||
# -x : Print commands and their arguments as they are executed. | ||
set -eux | ||
|
||
apt-get --quiet update | ||
apt-get --quiet install --assume-yes socat | ||
|
||
DOCKER_DEB=docker-ce_18.06.0~ce~3-0~ubuntu_amd64.deb | ||
curl -sL --output $DOCKER_DEB https://download.docker.com/linux/ubuntu/dists/bionic/pool/stable/amd64/$DOCKER_DEB | ||
# dpkg won't install dependencies | ||
dpkg --install $DOCKER_DEB || sudo apt-get install --fix-broken --assume-yes | ||
docker info | ||
|
||
install --owner vagrant --group vagrant --directory /home/vagrant/bin | ||
|
||
# Workaround Minikube DNS problems | ||
# https://github.com/kubernetes/minikube/issues/2027#issuecomment-338221646 | ||
cat << EOF > /etc/resolv.conf | ||
nameserver 8.8.4.4 | ||
nameserver 8.8.8.8 | ||
EOF | ||
sed --in-place --regexp-extended --expression "s/^(127.0.0.1\\s.+)/\\1 `hostname`/" /etc/hosts |
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,63 +1,95 @@ | ||
#!/bin/bash | ||
set -ex | ||
|
||
mkdir -p bin | ||
# Set shell options | ||
# -e : Exit immediately if a command exits with a non-zero status. | ||
# -u : Treat unset variables as an error when substituting. | ||
# -x : Print commands and their arguments as they are executed. | ||
set -eux | ||
|
||
# install nsenter if missing (needed by kube on trusty) | ||
# Install nsenter if missing (needed by kube on trusty) | ||
if ! which nsenter; then | ||
curl -L https://github.com/minrk/git-crypt-bin/releases/download/trusty/nsenter > nsenter | ||
curl -sL --output nsenter https://github.com/minrk/git-crypt-bin/releases/download/trusty/nsenter | ||
echo "5652bda3fbea6078896705130286b491b6b1885d7b13bda1dfc9bdfb08b49a2e nsenter" | shasum -a 256 -c - | ||
chmod +x nsenter | ||
sudo mv nsenter /usr/local/bin/ | ||
fi | ||
|
||
# install kubectl, minikube | ||
# based on https://blog.travis-ci.com/2017-10-26-running-kubernetes-on-travis-ci-with-minikube | ||
echo "installing kubectl" | ||
curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/v${KUBE_VERSION}/bin/linux/amd64/kubectl | ||
chmod +x kubectl | ||
mv kubectl bin/ | ||
# Load environment variables | ||
# -------------------------- | ||
source ./minikube.env | ||
|
||
export KUBE_VERSION=1.11.0 | ||
export MINIKUBE_VERSION=0.28.2 | ||
export HELM_VERSION=2.9.1 | ||
export KUBEVAL_VERSION=0.7.1 | ||
export GIT_CRYPT_VERSION=0.5.0 | ||
export PATH="${PWD}/bin:$PATH" | ||
|
||
export CHANGE_MINIKUBE_NONE_USER=true | ||
export MINIKUBE_WANTUPDATENOTIFICATION=false | ||
export MINIKUBE_WANTREPORTERRORPROMPT=false | ||
|
||
# Download binaries | ||
# ----------------- | ||
mkdir -p bin | ||
|
||
echo "installing minikube" | ||
curl -Lo minikube https://storage.googleapis.com/minikube/releases/v${MINIKUBE_VERSION}/minikube-linux-amd64 | ||
chmod +x minikube | ||
mv minikube bin/ | ||
if ! [ -f bin/minikube-${MINIKUBE_VERSION} ]; then | ||
curl -sL --output bin/minikube-${MINIKUBE_VERSION} https://storage.googleapis.com/minikube/releases/v${MINIKUBE_VERSION}/minikube-linux-amd64 | ||
chmod +x bin/minikube-${MINIKUBE_VERSION} | ||
fi | ||
cp bin/minikube-${MINIKUBE_VERSION} bin/minikube | ||
|
||
echo "installing kubectl" | ||
if ! [ -f bin/kubectl-${KUBE_VERSION} ]; then | ||
curl -sL --output bin/kubectl-${KUBE_VERSION} https://storage.googleapis.com/kubernetes-release/release/v${KUBE_VERSION}/bin/linux/amd64/kubectl | ||
chmod +x bin/kubectl-${KUBE_VERSION} | ||
fi | ||
cp bin/kubectl-${KUBE_VERSION} bin/kubectl | ||
|
||
echo "installing helm" | ||
if ! [ -f bin/helm-${HELM_VERSION} ]; then | ||
curl -sL --output bin/helm-${HELM_VERSION}.tar.gz https://storage.googleapis.com/kubernetes-helm/helm-v${HELM_VERSION}-linux-amd64.tar.gz | ||
tar --extract --file bin/helm-${HELM_VERSION}.tar.gz --directory bin --strip-components 1 linux-amd64/helm | ||
rm bin/helm-${HELM_VERSION}.tar.gz | ||
mv bin/helm bin/helm-${HELM_VERSION} | ||
fi | ||
cp bin/helm-${HELM_VERSION} bin/helm | ||
|
||
echo "installing kubeval" | ||
if ! [ -f bin/kubeval-${KUBEVAL_VERSION} ]; then | ||
curl -sL --output bin/kubeval-${KUBEVAL_VERSION}.tar.gz https://github.com/garethr/kubeval/releases/download/${KUBEVAL_VERSION}/kubeval-linux-amd64.tar.gz | ||
tar --extract --file bin/kubeval-${KUBEVAL_VERSION}.tar.gz --directory bin | ||
rm bin/kubeval-${KUBEVAL_VERSION}.tar.gz | ||
mv bin/kubeval bin/kubeval-${KUBEVAL_VERSION} | ||
fi | ||
cp bin/kubeval-${KUBEVAL_VERSION} bin/kubeval | ||
|
||
# Setup Kubernetes | ||
# ---------------- | ||
echo "starting minikube" | ||
if [[ ${KUBE_VERSION} == 1.9* ]] || [[ ${KUBE_VERSION} == 1.10* ]]; then | ||
BOOTSTRAPPER=localkube | ||
sudo --preserve-env bin/minikube start --kubernetes-version=v${KUBE_VERSION} --vm-driver=none --bootstrapper=localkube --extra-config=apiserver.Authorization.Mode=RBAC | ||
else | ||
BOOTSTRAPPER=kubeadm | ||
sudo --preserve-env bin/minikube start --kubernetes-version=v${KUBE_VERSION} --vm-driver=none --bootstrapper=kubeadm | ||
fi | ||
sudo CHANGE_MINIKUBE_NONE_USER=true $PWD/bin/minikube start --kubernetes-version=v${KUBE_VERSION} --vm-driver=none --bootstrapper=${BOOTSTRAPPER} | ||
minikube update-context | ||
|
||
echo "kubectl convenience details" | ||
kubectl config set-context $(kubectl config current-context) --namespace jh | ||
source <(kubectl completion bash) | ||
|
||
echo "waiting for kubernetes" | ||
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 | ||
kubectl get nodes | ||
|
||
echo "installing helm" | ||
curl -ssL https://storage.googleapis.com/kubernetes-helm/helm-v${HELM_VERSION}-linux-amd64.tar.gz \ | ||
| tar -xz -C bin --strip-components 1 linux-amd64/helm | ||
chmod +x bin/helm | ||
|
||
kubectl --namespace kube-system create sa tiller | ||
echo "initialize helm" | ||
kubectl create serviceaccount tiller --namespace kube-system | ||
kubectl create clusterrolebinding tiller --clusterrole cluster-admin --serviceaccount=kube-system:tiller | ||
helm init --service-account tiller | ||
|
||
echo "waiting for tiller" | ||
kubectl --namespace=kube-system rollout status --watch deployment/tiller-deploy | ||
|
||
echo "installing git-crypt" | ||
curl -L https://github.com/minrk/git-crypt-bin/releases/download/0.5.0/git-crypt > bin/git-crypt | ||
echo "46c288cc849c23a28239de3386c6050e5c7d7acd50b1d0248d86e6efff09c61b bin/git-crypt" | shasum -a 256 -c - | ||
chmod +x bin/git-crypt | ||
|
||
echo "installing kubeval" | ||
curl -L https://github.com/garethr/kubeval/releases/download/0.7.1/kubeval-linux-amd64.tar.gz --output bin/kubeval.tar.gz | ||
echo "8259d462bd19e5fc2db2ea304e51ed4db928be4343f6c9530f909dba66e15713 bin/kubeval.tar.gz" | shasum -a 256 -c - | ||
tar xf bin/kubeval.tar.gz -C bin | ||
chmod +x bin/kubeval | ||
kubectl --namespace=kube-system rollout status --watch=true deployment/tiller-deploy |
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,3 +1,10 @@ | ||
export MINIKUBE_VERSION=0.28.0 | ||
export KUBE_VERSION=1.10.0 | ||
export MINIKUBE_VERSION=0.28.2 | ||
export HELM_VERSION=2.9.1 | ||
export PATH="$PWD/bin:$PATH" | ||
export KUBEVAL_VERSION=0.7.1 | ||
export GIT_CRYPT_VERSION=0.5.0 | ||
export PATH="${PWD}/bin:$PATH" | ||
|
||
export CHANGE_MINIKUBE_NONE_USER=true | ||
export MINIKUBE_WANTUPDATENOTIFICATION=false | ||
export MINIKUBE_WANTREPORTERRORPROMPT=false |
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.