From 62717199d28f84d34f4281f723f628f759a1d2d2 Mon Sep 17 00:00:00 2001 From: Ihor Borodin Date: Tue, 20 Aug 2019 13:06:34 +0300 Subject: [PATCH] Fixing git clone chart repo 3 (#16) * Fixing git clone chart repo --- .travis.yml | 2 +- package/package.sh | 14 +++++--------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4a4d4a6..b4a0f93 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,7 +21,7 @@ deploy: skip_cleanup: true github_token: $GITHUB_TOKEN keep_history: true - local_dir: dist-repo/out + local_dir: dist-repo committer_from_gh: true on: branch: master diff --git a/package/package.sh b/package/package.sh index e7d6b89..b9d8eed 100755 --- a/package/package.sh +++ b/package/package.sh @@ -16,7 +16,11 @@ helm init --client-only # add helm repos for charts in requirements helm repo add jetstack https://charts.jetstack.io/ -mkdir -p "${BUILD_DIR}" +git clone "https://${GITHUB_USER:-$DEFAULT_GITHUB_USER}:${GITHUB_TOKEN}@github.com/${GIT_REPO}" "${BUILD_DIR}" +pushd "${BUILD_DIR}" +git checkout "${TARGET_BRANCH}" || git checkout --orphan "${TARGET_BRANCH}" +popd + for chart in ./stable/*; do echo "--- Packaging ${chart} into ${BUILD_DIR}" helm dep update "${chart}" || true @@ -24,12 +28,6 @@ for chart in ./stable/*; do done ls "${BUILD_DIR}" -git clone "https://${GITHUB_USER:-$DEFAULT_GITHUB_USER}:${GITHUB_TOKEN}@github.com/${GIT_REPO}" out -cd out -git checkout "${TARGET_BRANCH}" || git checkout --orphan "${TARGET_BRANCH}" -cd .. - -cp out/index.yaml "${BUILD_DIR}" || true pushd "${BUILD_DIR}" echo "--- Reindexing ${BUILD_DIR}" if [ -f index.yaml ]; then @@ -38,5 +36,3 @@ else helm repo index --url "${HELM_REPO_URL}" . fi popd - -cp "${BUILD_DIR}"/* out/