summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2022-09-07 20:57:02 +0000
committerGerrit Code Review <review@openstack.org>2022-09-07 20:57:02 +0000
commitccf4fd13f3e105e061734795145535b819457967 (patch)
treee4dd68072724a23b1f91920e2378a8492dc1f490
parentb1ce0c469c04917c94278230b1d2ea232b7c9320 (diff)
parent0df6e2d7ca0e27eb311ad99a4346ac9ae183260c (diff)
downloadzuul-ccf4fd13f3e105e061734795145535b819457967.tar.gz
Merge "Fix and improve Keycloak tutorial"
-rw-r--r--doc/source/tutorials/keycloak.rst6
-rw-r--r--playbooks/tutorial/admin.yaml25
2 files changed, 26 insertions, 5 deletions
diff --git a/doc/source/tutorials/keycloak.rst b/doc/source/tutorials/keycloak.rst
index 5242a4f05..896f35479 100644
--- a/doc/source/tutorials/keycloak.rst
+++ b/doc/source/tutorials/keycloak.rst
@@ -46,14 +46,14 @@ that we can update Zuul's configuration to add authentication.
.. code-block:: shell
cd zuul/doc/source/examples
- sudo -E docker-compose-compose -p zuul-tutorial down
+ sudo -E docker-compose -p zuul-tutorial stop
Restart the containers with a new Zuul configuration.
.. code-block:: shell
cd zuul/doc/source/examples
- ZUUL_TUTORIAL_CONFIG="./keycloak/etc_zuul/" sudo -E docker-compose-compose -p zuul-tutorial up -d
+ ZUUL_TUTORIAL_CONFIG="./keycloak/etc_zuul/" sudo -E docker-compose -p zuul-tutorial up -d
This tells docker-compose to use these Zuul `config files
<https://opendev.org/zuul/zuul/src/branch/master/doc/source/examples/keycloak>`_.
@@ -67,7 +67,7 @@ with this command:
.. code-block:: shell
cd zuul/doc/source/examples/keycloak
- sudo -E docker-compose-compose -p zuul-tutorial-keycloak up -d
+ sudo -E docker-compose -p zuul-tutorial-keycloak up -d
Once Keycloak is running, you can visit the web interface at
http://localhost:8082/
diff --git a/playbooks/tutorial/admin.yaml b/playbooks/tutorial/admin.yaml
index 9b36069e7..92d2b6d1f 100644
--- a/playbooks/tutorial/admin.yaml
+++ b/playbooks/tutorial/admin.yaml
@@ -2,13 +2,13 @@
- name: Run docker-compose down
when: not local
shell:
- cmd: docker-compose -p zuul-tutorial down
+ cmd: docker-compose -p zuul-tutorial stop
chdir: src/opendev.org/zuul/zuul/doc/source/examples
- name: Run docker-compose down
when: local
shell:
- cmd: docker-compose -p zuul-tutorial down
+ cmd: docker-compose -p zuul-tutorial stop
chdir: ../../doc/source/examples
# Restart with the new config
@@ -55,3 +55,24 @@
until: result.status == 200 and result.json["zuul_version"] is defined
changed_when: false
+- name: Verify Keycloak authentication is available
+ uri:
+ url: http://localhost:9000/api/tenant/example-tenant/info
+ method: GET
+ return_content: true
+ status_code: 200
+ body_format: json
+ register: result
+ failed_when: result.json["info"]["capabilities"]["auth"]["realms"]["zuul-demo"]["authority"] != "http://keycloak:8082/realms/zuul-demo"
+ changed_when: false
+
+- name: Verify that old builds are available
+ uri:
+ url: "http://localhost:9000/api/tenant/example-tenant/builds"
+ method: GET
+ return_content: true
+ status_code: 200
+ body_format: json
+ register: result
+ failed_when: "result.json | length < 4"
+ changed_when: false