UNCLASSIFIED - NO CUI

Skip to content
Snippets Groups Projects
TESTING_DEVELOPMENT.md 3.72 KiB
Newer Older
### Setting up a Renovate Development Environment

1. Clone this repo to your local work station.

2. From within a Local Big Bang Repo (main branch)

3. Run:
***Note: $REGISTRY1_USER and $REGISTRY1_PASSWORD env vars must exist with Iron Bank Creds***
```
./docs/assets/scripts/developer/k3d-dev.sh
export KUBECONFIG=~/.kube/$(aws sts get-caller-identity --query "Arn" --output text | cut -d '/' -f2)-dev-config
./scripts/install_flux.sh -u $REGISTRY1_USER -p $REGISTRY1_PASSWORD
    helm upgrade -i bigbang chart/ -n bigbang --create-namespace \
    --set registryCredentials.username=${REGISTRY1_USER} \
    --set registryCredentials.password="${REGISTRY1_PASSWORD}" \
    -f ./docs/assets/configs/example/policy-overrides-k3d.yaml \
    -f ./chart/ingress-certs.yaml \
    -f https://repo1.dso.mil/big-bang/pipeline-templates/renovate-runner/-/raw/main/dev/renovate.yaml
```

4. From within a Local Renovate Runner Repo (main branch)

5. Install [gum](https://github.com/charmbracelet/gum?tab=readme-ov-file#installation) as a prerequisite for the ./dev/renovate-dev.sh script

6. Run:

***Note: The Gitlab Root Token and Renovate Runner Token are outputs from this script, if needed.***

```
./dev/renovate-dev.sh
```

7. You will be prompted if you want to import packages. If you are importing only some and not all, select your packages using the tab key and press enter.

8. You will then be prompted, "Do you want to delete all existing renovate/ironbank branches?". Select "yes" so Renovate can make new commits to renovations already in progress that were imported from repo1. Select "no" if you want to keep it as is, but Renovate won't be able to make commits, so the MR will be missing.

9. You will then be prompted, "Do you want to revert all packages to previous renovate tag?" Select "yes so all packages main branch (excluding BB maintained packages) will be reverted to the previous -bb.0 release. This will allow all packages to have updates for renovate to run against.
10. You will then be prompted, "Do you want to trigger the Renovate runner pipeline?". This will trigger the Renovate scheduled pipeline, which in turn will run against all packages in big-bang/**, creating new issues and MRs.
11. Grab gitlab's root password:

```
     kubectl get secret -n gitlab gitlab-gitlab-initial-root-password -o json | jq -r ".data.password" | base64 -d
```

12. Login in as root to https://gitlab.dev.bigbang.mil
13. Do your dev work. Trigger new renovate pipeline runs from the pipeline schedule.
## Importing Sandbox Packages
If you would like to import/test against [Sandbox packages](https://repo1.dso.mil/big-bang/apps/sandbox) *instead* of fully supported Big Bang packages, run the script in Step #6 with the `-s` flag:

```
./dev/renovate-dev.sh -s
```

## Destroy
If you need to destroy the Renovate Dev Setup you can use the following:
```
./dev/renovate-dev.sh -d
```

***Note: This will revert back to the state before you ran the ./dev/renovate-dev.sh script.***

## Helpful dev cluster links

- [Renovate runner scheduled jobs](https://gitlab.dev.bigbang.mil/big-bang/pipeline-templates/renovate-runner/-/pipeline_schedules) - Click the :arrow_forward: button to kick off a new run.
- [Pipeline job YAML definition](https://gitlab.dev.bigbang.mil/big-bang/pipeline-templates/pipeline-templates/-/blob/master/pipelines/renovate.yaml) - Update this to feed new environment variables to your renovate runner job.
- [Admin access token management](https://gitlab.dev.bigbang.mil/-/user_settings/personal_access_tokens) - go here if you need to create a new token.
- [Renovate template fields list](https://docs.renovatebot.com/templates/#other-available-fields) - useful tokens like `sourceRepoSlug` and `baseBranch` might come in handy for building your renovate text outputs.