Add initial gate for OpenStack-Helm
This patch set is setting up initial lint gate job for the OpenStack-Helm project. Co-Authored-By: Alexis Rivera <gardlt@tetrasol.org> Change-Id: I6ebf2d22467f1c56f474c437abd94e5cc4055ee1
This commit is contained in:
parent
8af2377860
commit
bab04be137
42
Makefile
42
Makefile
@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
.PHONY: ceph bootstrap mariadb etcd keystone memcached rabbitmq helm-toolkit mistral neutron nova cinder heat senlin ingress all clean
|
.PHONY: ceph bootstrap mariadb etcd keystone memcached rabbitmq helm-toolkit mistral neutron nova cinder heat senlin ingress all clean
|
||||||
|
|
||||||
|
TASK :=build
|
||||||
B64_DIRS := helm-toolkit/secrets
|
B64_DIRS := helm-toolkit/secrets
|
||||||
B64_EXCLUDE := $(wildcard helm-toolkit/secrets/*.b64)
|
B64_EXCLUDE := $(wildcard helm-toolkit/secrets/*.b64)
|
||||||
|
|
||||||
@ -22,40 +23,40 @@ TOOLKIT_TPL := helm-toolkit/templates/_globals.tpl
|
|||||||
|
|
||||||
all: helm-toolkit ceph bootstrap mariadb etcd rabbitmq memcached keystone glance horizon mistral neutron nova cinder heat senlin ingress
|
all: helm-toolkit ceph bootstrap mariadb etcd rabbitmq memcached keystone glance horizon mistral neutron nova cinder heat senlin ingress
|
||||||
|
|
||||||
helm-toolkit: build-helm-toolkit
|
helm-toolkit: $(TASK)-helm-toolkit
|
||||||
|
|
||||||
#ceph: nolint-build-ceph
|
#ceph: nolint-build-ceph
|
||||||
ceph: build-ceph
|
ceph: $(TASK)-ceph
|
||||||
|
|
||||||
bootstrap: build-bootstrap
|
bootstrap: $(TASK)-bootstrap
|
||||||
|
|
||||||
mariadb: build-mariadb
|
mariadb: $(TASK)-mariadb
|
||||||
|
|
||||||
etcd: build-etcd
|
etcd: $(TASK)-etcd
|
||||||
|
|
||||||
keystone: build-keystone
|
keystone: $(TASK)-keystone
|
||||||
|
|
||||||
cinder: build-cinder
|
cinder: $(TASK)-cinder
|
||||||
|
|
||||||
horizon: build-horizon
|
horizon: $(TASK)-horizon
|
||||||
|
|
||||||
rabbitmq: build-rabbitmq
|
rabbitmq: $(TASK)-rabbitmq
|
||||||
|
|
||||||
glance: build-glance
|
glance: $(TASK)-glance
|
||||||
|
|
||||||
mistral: build-mistral
|
mistral: $(TASK)-mistral
|
||||||
|
|
||||||
neutron: build-neutron
|
neutron: $(TASK)-neutron
|
||||||
|
|
||||||
nova: build-nova
|
nova: $(TASK)-nova
|
||||||
|
|
||||||
heat: build-heat
|
heat: $(TASK)-heat
|
||||||
|
|
||||||
senlin: build-senlin
|
senlin: $(TASK)-senlin
|
||||||
|
|
||||||
memcached: build-memcached
|
memcached: $(TASK)-memcached
|
||||||
|
|
||||||
ingress: build-ingress
|
ingress: $(TASK)-ingress
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(shell rm -rf helm-toolkit/secrets/*.b64)
|
$(shell rm -rf helm-toolkit/secrets/*.b64)
|
||||||
@ -70,3 +71,10 @@ build-%:
|
|||||||
helm lint $*
|
helm lint $*
|
||||||
helm package $*
|
helm package $*
|
||||||
@echo
|
@echo
|
||||||
|
|
||||||
|
lint-%:
|
||||||
|
@echo
|
||||||
|
if [ -f $*/Makefile ]; then make -C $*; fi
|
||||||
|
if [ -f $*/requirements.yaml ]; then helm dep up $*; fi
|
||||||
|
helm lint $*
|
||||||
|
@echo
|
||||||
|
@ -11,9 +11,51 @@
|
|||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
#TODO(lamt) Need to replace with actual gate logic. Placeholder for now.
|
HELM_VERSION=${2:-v2.3.0}
|
||||||
env
|
WORK_DIR=$(pwd)
|
||||||
exit 0
|
|
||||||
|
function helm_install {
|
||||||
|
TMP_DIR=$(mktemp -d)
|
||||||
|
sudo apt-get update -y
|
||||||
|
sudo apt-get install -y --no-install-recommends -qq \
|
||||||
|
git \
|
||||||
|
make \
|
||||||
|
curl
|
||||||
|
|
||||||
|
# install helm
|
||||||
|
curl -sSL https://storage.googleapis.com/kubernetes-helm/helm-${HELM_VERSION}-linux-amd64.tar.gz | tar -zxv --strip-components=1 -C ${TMP_DIR}
|
||||||
|
sudo mv ${TMP_DIR}/helm /usr/local/bin/helm
|
||||||
|
rm -rf ${TMP_DIR}
|
||||||
|
}
|
||||||
|
|
||||||
|
function helm_lint {
|
||||||
|
if [[ -d "$HOME/.helm" ]]; then
|
||||||
|
echo ".helm directory found"
|
||||||
|
else
|
||||||
|
helm init --client-only
|
||||||
|
fi
|
||||||
|
if [[ -z $(curl -s 127.0.0.1:8879 | grep 'Helm Repository') ]]; then
|
||||||
|
helm serve & > /dev/null
|
||||||
|
while [[ -z $(curl -s 127.0.0.1:8879 | grep 'Helm Repository') ]]; do
|
||||||
|
sleep 1
|
||||||
|
echo "Waiting for Helm Repository"
|
||||||
|
done
|
||||||
|
else
|
||||||
|
echo "Helm serve already running"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -f "$HOME/.helm/repository/stable/index.yaml" ]]; then
|
||||||
|
helm repo remove stable
|
||||||
|
fi
|
||||||
|
if [[ -z $(-f "$HOME/.helm/repository/local/index.yaml") ]]; then
|
||||||
|
helm repo add local http://localhost:8879/charts
|
||||||
|
fi
|
||||||
|
|
||||||
|
make build-helm-toolkit -C ${WORK_DIR}
|
||||||
|
make TASK=lint -C ${WORK_DIR}
|
||||||
|
}
|
||||||
|
|
||||||
|
helm_install
|
||||||
|
helm_lint
|
||||||
|
Loading…
x
Reference in New Issue
Block a user