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: Ibdea9f1ccda043259620add022643e5c9800259a
This commit is contained in:
Sean Eagan 2021-07-28 09:29:33 -05:00
parent 27b4dc952c
commit a0da68409a
7 changed files with 20 additions and 48 deletions

View File

@ -112,6 +112,7 @@ AUTHORS
**/*.tgz **/*.tgz
/charts/shipyard/charts /charts/shipyard/charts
/charts/shipyard/requirements.lock /charts/shipyard/requirements.lock
/charts/deps/*/
.DS_Store .DS_Store
# vscode # vscode

1
.gitignore vendored
View File

@ -113,6 +113,7 @@ AUTHORS
**/*.tgz **/*.tgz
/charts/shipyard/charts /charts/shipyard/charts
/charts/shipyard/requirements.lock /charts/shipyard/requirements.lock
/charts/deps/*/
.DS_Store .DS_Store
# vscode # vscode

View File

@ -55,7 +55,7 @@ $(IMAGE_NAME):
# Create tgz of the chart # Create tgz of the chart
.PHONY: charts .PHONY: charts
charts: clean helm-init charts: clean helm-toolkit
$(HELM) dep up charts/shipyard $(HELM) dep up charts/shipyard
$(HELM) package charts/shipyard $(HELM) package charts/shipyard
@ -65,7 +65,7 @@ lint: pep8 helm_lint build_docs
# Dry run templating of chart # Dry run templating of chart
.PHONY: dry-run .PHONY: dry-run
dry-run: clean helm-init dry-run: clean helm-toolkit
$(HELM) template charts/shipyard $(HELM) template charts/shipyard
.PHONY: security .PHONY: security
@ -136,12 +136,12 @@ pep8:
cd $(BUILD_CTX)/shipyard_airflow; tox -e pep8 cd $(BUILD_CTX)/shipyard_airflow; tox -e pep8
.PHONY: helm_lint .PHONY: helm_lint
helm_lint: clean helm-init helm_lint: clean helm-toolkit
$(HELM) lint charts/shipyard $(HELM) lint charts/shipyard
# Initialize local helm config # Initialize local helm config
.PHONY: helm-init .PHONY: helm-toolkit
helm-init: helm-install helm-toolkit: helm-install
tools/helm_tk.sh $(HELM) tools/helm_tk.sh $(HELM)
# Install helm binary # Install helm binary

0
charts/deps/.gitkeep Normal file
View File

View File

@ -15,5 +15,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"

View File

@ -17,7 +17,7 @@
set -x set -x
HELM=$1 HELM=$1
HELM_ARTIFACT_URL=${HELM_ARTIFACT_URL:-"https://get.helm.sh/helm-v2.17.0-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 {

View File

@ -12,50 +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 shipyard chart
#
HELM=$1
set -eux
HTK_REPO=${HTK_REPO:-"https://opendev.org/openstack/openstack-helm-infra.git"}
HTK_STABLE_COMMIT=${HTK_COMMIT:-"b1a247e7f54ab12d830ab74f7634457b4e43f3ef"} HTK_STABLE_COMMIT=${HTK_COMMIT:-"b1a247e7f54ab12d830ab74f7634457b4e43f3ef"}
set -x TMP_DIR=$(mktemp -d)
function helm_serve { {
if [[ -d "$HOME/.helm" ]]; then HTK_REPO_DIR=$TMP_DIR/htk
echo ".helm directory found" git clone "$HTK_REPO" "$HTK_REPO_DIR"
else (cd "$HTK_REPO_DIR" && git reset --hard "${HTK_STABLE_COMMIT}")
${HELM} init --client-only --skip-refresh cp -r "${HTK_REPO_DIR}/helm-toolkit" charts/deps/
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 ${HELM} repo list | grep -q "^stable" ; then
${HELM} repo remove stable
fi
${HELM} repo add local http://localhost:8879/charts
} }
mkdir -p build rm -rf "${TMP_DIR}"
cd build
git clone https://opendev.org/openstack/openstack-helm-infra.git || true
cd openstack-helm-infra
git reset --hard "${HTK_STABLE_COMMIT}"
helm_serve
if [[ ${HELM} != "helm" ]]
then
export PATH=${PATH}:$(dirname ${HELM})
fi
make helm-toolkit
${HELM} dep up ../../charts/shipyard