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 8da7a170a8
commit 126341fecc
7 changed files with 19 additions and 47 deletions

View File

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

1
.gitignore vendored
View File

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

View File

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

0
charts/deps/.gitkeep Normal file
View File

View File

@ -15,5 +15,5 @@
dependencies:
- name: helm-toolkit
repository: http://localhost:8879/charts
repository: file://../deps/helm-toolkit
version: ">= 0.1.0"

View File

@ -17,7 +17,7 @@
set -x
HELM=$1
HELM_ARTIFACT_URL=${HELM_ARTIFACT_URL:-"https://storage.googleapis.com/kubernetes-helm/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 {

View File

@ -12,50 +12,20 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Script to setup helm-toolkit and helm dep up the shipyard chart
#
HELM=$1
HTK_STABLE_COMMIT=${HTK_COMMIT:-"200b5e902b3a176fbfbe669b6a10a254c9b50f5d"}
set -x
set -eux
function helm_serve {
if [[ -d "$HOME/.helm" ]]; then
echo ".helm directory found"
else
${HELM} init --client-only --skip-refresh
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
HTK_REPO=${HTK_REPO:-"https://opendev.org/openstack/openstack-helm-infra.git"}
HTK_STABLE_COMMIT=${HTK_COMMIT:-"2d1fe882bb751c03ee741a6166c9c8a5fad8f926"}
if ${HELM} repo list | grep -q "^stable" ; then
${HELM} repo remove stable
fi
TMP_DIR=$(mktemp -d)
${HELM} repo add local http://localhost:8879/charts
{
HTK_REPO_DIR=$TMP_DIR/htk
git clone "$HTK_REPO" "$HTK_REPO_DIR"
(cd "$HTK_REPO_DIR" && git reset --hard "${HTK_STABLE_COMMIT}")
cp -r "${HTK_REPO_DIR}/helm-toolkit" charts/deps/
}
mkdir -p build
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
rm -rf "${TMP_DIR}"