diff --git a/src/runboat/kubefiles/kustomization.yaml.jinja b/src/runboat/kubefiles/kustomization.yaml.jinja index c501edd..a3645b6 100644 --- a/src/runboat/kubefiles/kustomization.yaml.jinja +++ b/src/runboat/kubefiles/kustomization.yaml.jinja @@ -41,7 +41,7 @@ configMapGenerator: literals: - PGDATABASE={{ build_name }} - ADDONS_DIR=/mnt/data/odoo-addons-dir - - RUNBOAT_GIT_REPO=https://github.com/{{ commit_info.repo }} + - RUNBOAT_GIT_REPO={{ commit_info.repo }} - RUNBOAT_GIT_REF={{ commit_info.git_commit }} {%- for key, value in build_env.items() %} - {{ key }}={{ value }} diff --git a/src/runboat/kubefiles/runboat-clone-and-install.sh b/src/runboat/kubefiles/runboat-clone-and-install.sh index 2f8d21e..3b1b05a 100755 --- a/src/runboat/kubefiles/runboat-clone-and-install.sh +++ b/src/runboat/kubefiles/runboat-clone-and-install.sh @@ -1,6 +1,6 @@ #!/bin/bash -set -ex +set -exo pipefail # Remove initialization sentinel, in case we are reinitializing. rm -fr /mnt/data/initialized @@ -8,11 +8,10 @@ rm -fr /mnt/data/initialized # Remove addons dir, in case we are reinitializing after a previously # failed installation. rm -fr $ADDONS_DIR -# Clone the repository at git reference into $ADDONS_DIR. -git clone --quiet --filter=blob:none $RUNBOAT_GIT_REPO $ADDONS_DIR +# Download the repository at git reference into $ADDONS_DIR. +mkdir -p $ADDONS_DIR cd $ADDONS_DIR -git fetch origin $RUNBOAT_GIT_REF:build -git checkout build +curl -sSL https://github.com/${RUNBOAT_GIT_REPO}/tarball/${RUNBOAT_GIT_REF} | tar zxf - --strip-components=1 # Install. INSTALL_METHOD=${INSTALL_METHOD:-oca_install_addons} diff --git a/tests/test_render_kubefiles.py b/tests/test_render_kubefiles.py index 05d294a..98efd91 100644 --- a/tests/test_render_kubefiles.py +++ b/tests/test_render_kubefiles.py @@ -37,7 +37,7 @@ configMapGenerator: literals: - PGDATABASE=build-name - ADDONS_DIR=/mnt/data/odoo-addons-dir - - RUNBOAT_GIT_REPO=https://github.com/oca/mis-builder + - RUNBOAT_GIT_REPO=oca/mis-builder - RUNBOAT_GIT_REF=abcdef123456789 - name: runboat-scripts files: