-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI Localenv -> Initial automation of backend rollout.
- Loading branch information
Showing
3 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
## How to use | ||
|
||
1. Install Ansible on your machine, e.g on Debian-based systems: | ||
```sh | ||
sudo apt install ansible | ||
``` | ||
|
||
2. Define an inventory.ini with parameters for your hosts. | ||
|
||
3. Make sure you have entries in your SSH config for all the hosts declared in the inventory.ini. | ||
|
||
4. Run the script like so: | ||
```sh | ||
./playbook.yaml -i inventory.ini | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[defaults] | ||
stdout_callback=debug |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/usr/bin/env ansible-playbook | ||
--- | ||
- name: Roll out openDuT Backend | ||
# Setup steps as documented here: https://opendut.eclipse.dev/book/user-manual/carl/setup.html | ||
hosts: backend | ||
tasks: | ||
- name: Checkout openDuT repo | ||
ansible.builtin.git: | ||
repo: "https://github.com/eclipse-opendut/opendut/" | ||
dest: "{{ repo_dir }}" | ||
version: "development" | ||
force: true # Avoid "would clobber existing tag" error for canary-tag | ||
|
||
- name: Provision secrets | ||
ansible.builtin.shell: | ||
cmd: "docker compose --file .ci/deploy/localenv/docker-compose.yml up --build provision-secrets" | ||
chdir: "{{ repo_dir }}" | ||
creates: "{{ repo_dir }}/.ci/deploy/localenv/data/secrets/.env" | ||
|
||
- name: Start containers | ||
ansible.builtin.shell: | ||
cmd: "docker compose --file .ci/deploy/localenv/docker-compose.yml --env-file .ci/deploy/localenv/data/secrets/.env up --detach --build" | ||
chdir: "{{ repo_dir }}" |