| | |
| | | git push -u origin --all |
| | | ``` |
| | | |
| | | #### 5 MongoDB for CI tests |
| | | ### Part 5 MongoDB for CI tests |
| | | > In order to run our API tests in CI in later labs; we need there to be a MongoDB available for executing our tests. As this is part of our CI/CD Lifecycle; we will add it now. |
| | | |
| | | 4. In our `enablement-ci-cd` repo; checkout the mongo templates as shown below to bring in the template and params. The mongodb template we're using is the same as the one for our `todolist-fe` created in previous exercise. |
| | | ```bash |
| | | git checkout exercise3/mongodb params/mongodb templates/mongodb.yml |
| | | git checkout exercise1/mongodb params/mongodb templates/mongodb.yml |
| | | ``` |
| | | |
| | | 4. Open `enablement-ci-cd` in your favourite editor. Edit the `inventory/host_vars/ci-cd-tooling.yml` to include a new object for our mongodb as shown below. This item can be added below the jenkins slave in the `ci-cd-builds` section. |
| | | 4. Open `enablement-ci-cd` in your favourite editor. Edit the `inventory/host_vars/ci-cd-tooling.yml` to include a new object for our mongodb as shown below. This item can be added below the jenkins slave in the `ci-cd-tooling` section. |
| | | ```yaml |
| | | - name: "jenkins-mongodb" |
| | | namespace: "{{ ci_cd_namespace }}" |
| | |
| | | tags: |
| | | - mongodb |
| | | ``` |
| | | ![jenkins-mongo](../images/exercise3/jenkins-mongo.png) |
| | | ![jenkins-mongo](../images/exercise1/jenkins-mongo.png) |
| | | |
| | | 4. Git commit your updates to the inventory to git for traceability. |
| | | ```bash |
| | |
| | | JENKINS_OPTS=--sessionTimeout=720 |
| | | ``` |
| | | |
| | | 5. Add a `jenkins` variable to the ansible inventory underneath the nexus (and git if you have it) in `inventory/host_vars/ci-cd-tooling.yml`. |
| | | 5. Add a `jenkins` variable to the ansible inventory underneath the jenkins-mongo (and git if you have it) in `inventory/host_vars/ci-cd-tooling.yml`. |
| | | ```yaml |
| | | - name: "jenkins" |
| | | namespace: "{{ ci_cd_namespace }}" |