Skip to content

Commit

Permalink
Deploy stf using nightly bundles
Browse files Browse the repository at this point in the history
  • Loading branch information
elfiesmelfie committed Aug 31, 2023
1 parent 833a93b commit 2252e42
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .zuul.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
pre-run:
- ci/prepare.yml
run:
- ci/build_stf.yml
#- ci/deploy_stf.yml
#- ci/build_stf.yml
- ci/deploy_stf.yml
- ci/test_stf.yml

#stf-1.5-ocp-4.10
Expand Down
28 changes: 22 additions & 6 deletions build/stf-run-ci/tasks/setup_stf_from_bundles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,10 @@
ansible.builtin.debug:
msg: "Images: {{ images.stdout }}"

- name: "[tmp] Set the values for the bundle image paths"
ansible.builtin.set_fact:
__smart_gateway_bundle_image_path: "{{ sgo_bundle_image_path }}"
__service_telemetry_bundle_image_path: "{{ sto_bundle_image_path }}"
#- name: "[tmp] Set the values for the bundle image paths"
# ansible.builtin.set_fact:
# __smart_gateway_bundle_image_path: "{{ sgo_bundle_image_path }}"
# __service_telemetry_bundle_image_path: "{{ sto_bundle_image_path }}"

- name: "Ensure that the bundle paths are set."
ansible.builtin.assert:
Expand All @@ -119,12 +119,28 @@
fail_msg: "Bundle path(s) not set. __smart_gateway_bundle_image_path is '{{ __smart_gateway_bundle_image_path }}' and __service_telemetry_bundle_image_path is '{{ __service_telemetry_bundle_image_path }}'. Both values need to be set."
success_msg: "Bundle paths are defined and not None"

- name: "Is pull_secret defined?"
debug:
msg: "{{ pull_secret is defined }}"

- name: "What is the value of pull_secret?"
debug:
var: pull_secret

- name: "unset pull_secret, since it should not have been defined"
set_fact:
pull_secret: ''
# In order to deploy from bundles, the images need to exist locally.
# we can try an oc get image or a docker pull image to check that they exist.
# then give a message warning the user

#:
# I can use sto_bundle_image_path and sgo_bundle_image_path if they are defined. Ideally, we can phase out __smart_gateway_bundle_image_path and __service_telemetry_bundle_image_path
# we don't want duplicates
- name: Deploy SGO via OLM bundle
ansible.builtin.shell:
cmd: "{{ base_dir }}/working/operator-sdk-{{ new_operator_sdk_version }} run bundle {{ __smart_gateway_bundle_image_path }} {% if pull_secret is defined %}--pull-secret-name=pull-secret --ca-secret-name=registry-tls-ca{% endif %} --namespace={{ namespace }} --timeout 600s"
cmd: "{{ base_dir }}/working/operator-sdk-{{ new_operator_sdk_version }} run bundle --verbose {{ __smart_gateway_bundle_image_path }} {% if pull_secret | length > 0 %}--pull-secret-name=pull-secret --ca-secret-name=registry-tls-ca{% endif %} --namespace={{ namespace }} --timeout 600s"

- name: Deploy STO via OLM bundle
ansible.builtin.shell:
cmd: "{{ base_dir }}/working/operator-sdk-{{ new_operator_sdk_version }} run bundle {{ __service_telemetry_bundle_image_path }} {% if pull_secret is defined %}--pull-secret-name=pull-secret --ca-secret-name=registry-tls-ca{% endif %} --namespace={{ namespace }} --timeout 600s"
cmd: "{{ base_dir }}/working/operator-sdk-{{ new_operator_sdk_version }} run bundle --verbose {{ __service_telemetry_bundle_image_path }} {% if pull_secret | length > 0 %}--pull-secret-name=pull-secret --ca-secret-name=registry-tls-ca{% endif %} --namespace={{ namespace }} --timeout 600s"
20 changes: 20 additions & 0 deletions ci/deploy_stf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,26 @@
# sgo_branch: "add_logs_to_generate_bundle"
# new_operator_sdk_version: "v1.5.0"

# ansible-playbook -e __service_telemetry_storage_ephemeral_enabled=true -e __local_build_enabled=false -e __deploy_from_bundles_enabled=true -e __service_telemetry_bundle_image_path=quay.io/infrawatch-operators/service-telemetry-operator-bundle:nightly-head -e __smart_gateway_bundle_image_path=quay.io/infrawatch-operators/smart-gateway-operator-bundle:nightly-head --skip-tags bundle_registry_tls_ca --skip-tags bundle_registry_auth build/run-ci.yaml
#
# from: https://github.com/infrawatch/service-telemetry-operator/pull/437
- name: "Deploy STF from the created bundles"
ansible.builtin.import_role:
name: '../build/stf-run-ci'
vars:
__service_telemetry_storage_ephemeral_enabled: true
__local_build_enabled: false
__deploy_from_bundles_enabled: true
__service_telemetry_bundle_image_path: "quay.io/infrawatch-operators/service-telemetry-operator-bundle:nightly-head"
__smart_gateway_bundle_image_path: "quay.io/infrawatch-operators/smart-gateway-operator-bundle:nightly-head"
#--skip-tags bundle_registry_tls_ca
setup_bundle_registry_tls_ca: false
#--skip-tags bundle_registry_auth
setup_bundle_registry_auth: false

base_dir: "{{ sto_dir }}/build"
sgo_branch: "add_logs_to_generate_bundle"

- name: "Check that the STF deployment was successful"
ansible.builtin.shell:
cmd: |
Expand Down

0 comments on commit 2252e42

Please sign in to comment.