Use helm 3 in chart build
`helm serve` is removed in helm 3 so this moves to using local `file://` dependencies [0] instead. [0]: https://helm.sh/docs/chart_best_practices/dependencies/#repository-urls Signed-off-by: Sean Eagan <seaneagan1@gmail.com> Change-Id: I2282e231591a89073e65d9db3f59e1baea707380
This commit is contained in:
parent
68747d0815
commit
f3842f9fe1
|
@ -94,13 +94,11 @@ ENV/
|
||||||
# Rope project settings
|
# Rope project settings
|
||||||
.ropeproject
|
.ropeproject
|
||||||
|
|
||||||
# Helm internals
|
# Chart artifacts
|
||||||
*.lock
|
/charts/*.tgz
|
||||||
*/*.lock
|
/charts/*/charts
|
||||||
*.tgz
|
/charts/*/requirements.lock
|
||||||
**/*.tgz
|
/charts/deps/*/
|
||||||
**/_partials.tpl
|
|
||||||
**/_globals.tpl
|
|
||||||
|
|
||||||
# OSX
|
# OSX
|
||||||
.DS_STORE
|
.DS_STORE
|
||||||
|
|
14
Makefile
14
Makefile
|
@ -27,7 +27,7 @@ PUSH_IMAGE ?= false
|
||||||
LABEL ?= org.airshipit.build=community
|
LABEL ?= org.airshipit.build=community
|
||||||
COMMIT ?= $(shell git rev-parse HEAD)
|
COMMIT ?= $(shell git rev-parse HEAD)
|
||||||
PYTHON = python3
|
PYTHON = python3
|
||||||
CHARTS := $(patsubst charts/%/.,%,$(wildcard charts/*/.))
|
CHARTS := $(filter-out deps, $(patsubst charts/%/.,%,$(wildcard charts/*/.)))
|
||||||
DISTRO ?= ubuntu_bionic
|
DISTRO ?= ubuntu_bionic
|
||||||
IMAGE := ${DOCKER_REGISTRY}/${IMAGE_PREFIX}/${IMAGE_NAME}:${IMAGE_TAG}-${DISTRO}
|
IMAGE := ${DOCKER_REGISTRY}/${IMAGE_PREFIX}/${IMAGE_NAME}:${IMAGE_TAG}-${DISTRO}
|
||||||
UBUNTU_BASE_IMAGE ?=
|
UBUNTU_BASE_IMAGE ?=
|
||||||
|
@ -41,8 +41,6 @@ GIT_SHA = $(shell git rev-parse --short HEAD)
|
||||||
GIT_TAG = $(shell git describe --tags --abbrev=0 --exact-match 2>/dev/null)
|
GIT_TAG = $(shell git describe --tags --abbrev=0 --exact-match 2>/dev/null)
|
||||||
GIT_DIRTY = $(shell test -n "`git status --porcelain`" && echo "dirty" || echo "clean")
|
GIT_DIRTY = $(shell test -n "`git status --porcelain`" && echo "dirty" || echo "clean")
|
||||||
|
|
||||||
HELM_PIDFILE ?= $(abspath ./.helm-pid)
|
|
||||||
|
|
||||||
ifdef VERSION
|
ifdef VERSION
|
||||||
DOCKER_VERSION = $(VERSION)
|
DOCKER_VERSION = $(VERSION)
|
||||||
endif
|
endif
|
||||||
|
@ -167,12 +165,12 @@ charts: $(CHARTS)
|
||||||
|
|
||||||
helm-init: $(addprefix helm-init-,$(CHARTS))
|
helm-init: $(addprefix helm-init-,$(CHARTS))
|
||||||
|
|
||||||
helm-init-%: helm-serve
|
helm-init-%: helm-toolkit
|
||||||
@echo Initializing chart $*
|
@echo Initializing chart $*
|
||||||
cd charts;if [ -s $*/requirements.yaml ]; then echo "Initializing $*";$(HELM) dep up $*; fi
|
cd charts;if [ -s $*/requirements.yaml ]; then echo "Initializing $*";$(HELM) dep up --skip-refresh $*; fi
|
||||||
|
|
||||||
helm-serve: helm-install
|
helm-toolkit: helm-install
|
||||||
./tools/helm_tk.sh $(HELM) $(HELM_PIDFILE)
|
./tools/helm_tk.sh $(HELM)
|
||||||
|
|
||||||
helm-lint: $(addprefix helm-lint-,$(CHARTS))
|
helm-lint: $(addprefix helm-lint-,$(CHARTS))
|
||||||
|
|
||||||
|
@ -196,5 +194,5 @@ helm-install:
|
||||||
.PHONY: $(CHARTS) all bootstrap bootstrap-all build build_armada \
|
.PHONY: $(CHARTS) all bootstrap bootstrap-all build build_armada \
|
||||||
build_docs charts check-docker check-tox clean docs dry-run \
|
build_docs charts check-docker check-tox clean docs dry-run \
|
||||||
dry-run-% format helm-init helm-init-% helm-install helm-lint \
|
dry-run-% format helm-init helm-init-% helm-install helm-lint \
|
||||||
helm-lint-% helm-serve images lint protoc run_armada run_images \
|
helm-lint-% helm-toolkit images lint protoc run_armada run_images \
|
||||||
test-all test-bandit test-coverage test-pep8 tests test-unit
|
test-all test-bandit test-coverage test-pep8 tests test-unit
|
||||||
|
|
|
@ -14,5 +14,5 @@
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
- name: helm-toolkit
|
- name: helm-toolkit
|
||||||
repository: http://localhost:8879/charts
|
repository: file://../deps/helm-toolkit
|
||||||
version: ">= 0.1.0"
|
version: ">= 0.1.0"
|
||||||
|
|
|
@ -14,5 +14,5 @@
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
- name: helm-toolkit
|
- name: helm-toolkit
|
||||||
repository: http://localhost:8879/charts
|
repository: file://../deps/helm-toolkit
|
||||||
version: ">= 0.1.0"
|
version: ">= 0.1.0"
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
HELM=$1
|
HELM=$1
|
||||||
HELM_ARTIFACT_URL=${HELM_ARTIFACT_URL:-"https://get.helm.sh/helm-v2.16.9-linux-amd64.tar.gz"}
|
HELM_ARTIFACT_URL=${HELM_ARTIFACT_URL:-"https://get.helm.sh/helm-v3.6.3-linux-amd64.tar.gz"}
|
||||||
|
|
||||||
|
|
||||||
function install_helm_binary {
|
function install_helm_binary {
|
||||||
|
|
|
@ -12,68 +12,20 @@
|
||||||
# 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.
|
||||||
#
|
|
||||||
# Script to setup helm-toolkit and helm dep up the armada chart
|
|
||||||
#
|
|
||||||
|
|
||||||
set -eux
|
set -eux
|
||||||
|
|
||||||
HELM=${1}
|
HTK_REPO=${HTK_REPO:-"https://opendev.org/openstack/openstack-helm-infra.git"}
|
||||||
HELM_PIDFILE=${2}
|
HTK_STABLE_COMMIT=${HTK_COMMIT:-"2d1fe882bb751c03ee741a6166c9c8a5fad8f926"}
|
||||||
SERVE_DIR=$(mktemp -d)
|
|
||||||
|
|
||||||
HTK_STABLE_COMMIT=${HTK_COMMIT:-"4fe6212dad6e3f07d43122485d60ab8f38642293"}
|
TMP_DIR=$(mktemp -d)
|
||||||
|
|
||||||
${HELM} init --client-only --skip-refresh
|
|
||||||
|
|
||||||
if [[ -s ${HELM_PIDFILE} ]]; then
|
|
||||||
HELM_PID=$(cat "${HELM_PIDFILE}")
|
|
||||||
if ps "${HELM_PID}"; then
|
|
||||||
kill "${HELM_PID}"
|
|
||||||
sleep 0.5
|
|
||||||
if ps "${HELM_PID}"; then
|
|
||||||
echo Failed to terminate Helm, PID = "${HELM_PID}"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
${HELM} serve & > /dev/null
|
|
||||||
HELM_PID=${!}
|
|
||||||
echo Started Helm, PID = "${HELM_PID}"
|
|
||||||
echo "${HELM_PID}" > "${HELM_PIDFILE}"
|
|
||||||
|
|
||||||
set +x
|
|
||||||
if [[ -z $(curl -s 127.0.0.1:8879 | grep 'Helm Repository') ]]; then
|
|
||||||
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
|
|
||||||
set -x
|
|
||||||
|
|
||||||
if ${HELM} repo list | grep -q "^stable" ; then
|
|
||||||
${HELM} repo remove stable
|
|
||||||
fi
|
|
||||||
|
|
||||||
${HELM} repo add local http://localhost:8879/charts
|
|
||||||
|
|
||||||
|
|
||||||
#OSH Makefile is bugged, so ensure helm is in the path
|
|
||||||
if [[ ${HELM} != "helm" ]]
|
|
||||||
then
|
|
||||||
export PATH=${PATH}:$(dirname ${HELM})
|
|
||||||
fi
|
|
||||||
|
|
||||||
{
|
{
|
||||||
cd "${SERVE_DIR}"
|
HTK_REPO_DIR=$TMP_DIR/htk
|
||||||
git clone https://git.openstack.org/openstack/openstack-helm-infra.git || true
|
git clone "$HTK_REPO" "$HTK_REPO_DIR"
|
||||||
cd openstack-helm-infra
|
(cd "$HTK_REPO_DIR" && git reset --hard "${HTK_STABLE_COMMIT}")
|
||||||
git reset --hard "${HTK_STABLE_COMMIT}"
|
cp -r "${HTK_REPO_DIR}/helm-toolkit" charts/deps/
|
||||||
|
|
||||||
make helm-toolkit
|
|
||||||
}
|
}
|
||||||
|
|
||||||
rm -rf "${SERVE_DIR}"
|
rm -rf "${TMP_DIR}"
|
||||||
|
|
Loading…
Reference in New Issue