Skip to content

Commit

Permalink
WIP: EXPERIMENT: Forcing a clone of boot config in boot-vault calling…
Browse files Browse the repository at this point in the history
… boot

Issues like jenkins-x#5929 make me suspect that there are bugs that are
encountered when `jx boot` needs to clone `jenkins-x-boot-config`
rather than operating in an already-existing clone. So I'm trying to
reproduce that here. Let's see what happens.

Signed-off-by: Andrew Bayer <[email protected]>
  • Loading branch information
abayer committed Oct 24, 2019
1 parent a1d1b7d commit 9d7c02f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
11 changes: 6 additions & 5 deletions jx/bdd/boot-vault/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,18 @@ export JX_VALUE_PROW_HMACTOKEN="$GH_ACCESS_TOKEN"
# TODO temporary hack until the batch mode in jx is fixed...
export JX_BATCH_MODE="true"

git clone https://github.com/jenkins-x/jenkins-x-boot-config.git boot-source
cp jx/bdd/boot-vault/jx-requirements.yml boot-source
cp jx/bdd/boot-vault/parameters.yaml boot-source/env
#git clone https://github.com/jenkins-x/jenkins-x-boot-config.git boot-source
mkdir -p boot-source/boot-overrides
cp jx/bdd/boot-vault/jx-requirements.yml boot-source/boot-overrides
cp jx/bdd/boot-vault/parameters.yaml boot-source/boot-overrides/env
cd boot-source

cp env/jenkins-x-platform/values.tmpl.yaml tmp.yaml
cat tmp.yaml ../boot-vault.platform.yaml > env/jenkins-x-platform/values.tmpl.yaml
cat tmp.yaml ../boot-vault.platform.yaml > boot-overrides/env/jenkins-x-platform/values.tmpl.yaml
rm tmp.yaml

cp env/prow/values.tmpl.yaml tmp.yaml
cat tmp.yaml ../boot-vault.prow.yaml > env/prow/values.tmpl.yaml
cat tmp.yaml ../boot-vault.prow.yaml > boot-overrides/env/prow/values.tmpl.yaml
rm tmp.yaml

# TODO hack until we fix boot to do this too!
Expand Down
12 changes: 12 additions & 0 deletions pkg/cmd/boot/boot.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"os"
"path/filepath"

"github.com/jenkins-x/jx/pkg/helm"
"github.com/jenkins-x/jx/pkg/versionstream"

"github.com/jenkins-x/jx/pkg/boot"
Expand Down Expand Up @@ -212,6 +213,17 @@ func (o *BootOptions) Run() error {
if err != nil {
return errors.Wrapf(err, "setting HEAD to %s", commitish)
}

// If there's already an existing "boot-overrides" directory, copy its contents into the repository.
existingOverridesDir := filepath.Join(o.Dir, "boot-overrides")
overridesExist, err := util.DirExists(existingOverridesDir)
if err == nil && overridesExist {
err = util.CopyDirOverwrite(existingOverridesDir, cloneDir)
if err != nil {
return err
}
}

o.Dir, err = filepath.Abs(cloneDir)
if err != nil {
return err
Expand Down

0 comments on commit 9d7c02f

Please sign in to comment.