# mimir-cd

The whole deployment is separated into two pulumi projects, one for the infrastructure deployment, and the other for the application deployment.

## Organization

- `aws`: the pulumi project that creates AWS resources
- `mimir-pulumi`: the pulumi project that  provisions the DBaaS base EKS cluster and applies Mimir YAML manifests

## Config the application deployment

Because the application deployment reuses the DBaaS base EKS cluster, you need pull the kubeconfig via `awscli`. Then set it as a pulumi config with `--secret` option to encrypt the kubeconfig that contains credentials.

```bash
cd mimir-pulumi

export KUBECONFIG=./kubeconfig.yml
export PULUMI_CONFIG_PASSPHRASE=wearepingcap

# obtain the kubeconfig of the base eks via aws-cli
aws-vault exec dev -- aws eks update-kubeconfig --name dev-base-us-west-2 --region us-west-2 --kubeconfig $KUBECONFIG

# use --secret to encrypt the kubeconfig
cat $KUBECONFIG | pulumi config set --secret kubeconfig

rm -f $KUBECONFIG

# set github token
pulumi config set --secret github-token <github-token>

# set config.yaml
pulumi config set --secret dbconfig <config>

# set image tag
pulumi config set --secret image <imag-tag>
```

## Edit Jenkins File
Jenkins will scan the git repository every two minutes and find that new commits will run JenkinsFile in the repository and update the entire project in the dbaas dev environment.

which is mimir's jenkins item?
ticloud:mimir-cd
