%global _empty_manifest_terminate_build 0 Name: python-ocdeployer Version: 5.7.11 Release: 1 Summary: A tool which wraps the OpenShift command line tools to enable repeatable automated deployment of OpenShift templates License: MIT URL: https://www.github.com/bsquizz/ocdeployer Source0: https://mirrors.nju.edu.cn/pypi/web/packages/d3/53/c9aff3d676c55e07e3eb3145bace1480e6d53157ca56a0a59b6d4d57fa56/ocdeployer-5.7.11.tar.gz BuildArch: noarch Requires: python3-sh Requires: python3-prompter Requires: python3-pyyaml Requires: python3-click Requires: python3-appdirs Requires: python3-wait-for Requires: python3-jinja2 Requires: python3-cached-property Requires: python3-pytz Requires: python3-kubernetes Requires: python3-anytree Requires: python3-ocviapy %description ## Template Configuration The best way to explain how template configuration works is to describe the process for configuring a service set. #### A guide to creating a service set 1. Create a new directory in the `templates` directory for your service set, e.g. "myservice" 2. Add your OpenShift YAML files for your services in this directory. The files should be OpenShift template files that contain all resources needed to get your service running (except for secrets, and image streams of external images, we'll talk about that shortly...). This would commonly be things like `buildConfig`, `deploymentConfig`, `service`, `route`, etc. 3. Create a '_cfg.yml' file in your directory. The contents of this config file are explained below: ```yaml # (optional) requires # # Here you can list other service sets that need to be deployed before this one can. # Deployment will fail when processing this file if we see the required service set has # not yet been deployed in this run of ocdeployer. requires: - "myotherservice" # (optional) secrets # # Lists which secrets apps in this service set rely on; they will be validated or imported at run time. # A secret is only imported once per deploy run, so if other service sets rely on the same # secret it won't be imported again. secrets: - "mysecret" # You can also specify which service accounts a secret should be linked to - name: "othersecret" link: ["builder"] # (optional) custom_deploy_logic # # Indicates that there is a pre_deploy/post_deploy/deploy method defined for this # service set in the 'custom' folder that should be used custom_deploy_logic: true # (optional) post_deploy_timeout # # Indicates how long custom post_deploy logic should take before timeout (in seconds). # A null value can be handled differently depending on the post deploy logic, # but it is recommended that it means there is "no waiting" that will occur post_deploy_timeout: 300 # (optional) images # Lists the image streams these services require to be imported into the destination namespace. # # key = the name or name:tag for the image stream. If no tag is specified, 'latest' is used. # value = the full image docker uri # # 'oc import-image --from=""' is run at deploy time. # # If it already exists, it will be re-imported (and therefore the image will be updated) images: - cp-kafka: "confluentinc/cp-kafka" - cp-zookeeper: "confluentinc/cp-zookeeper" - nginx-stable-openshift: "docker.io/mhuth/nginx-stable-openshift" - python-36-centos7: "centos/python-36-centos7" - postgresql-95-rhel7: "registry.access.redhat.com/rhscl/postgresql-95-rhel7" # (required) deploy_order # # Lists the order in which components in this service set should be deployed. deploy_order: # A stage deploys a group of components in sequentially and then waits for them to reach 'active' # in parallel. By default, at the end of each stage, we wait for: # * DeploymentConfig's to be "active" # * StatefulSet's to be "active" # * BuildConfig's to succeed # # Setting 'wait' to false under the stage disables this behavior. # # Stages are processed after being sorted by name. stage0: wait: false components: - "zookeeper" stage1: # You can specify a wait timeout. By default, 300sec is used timeout: 600 # 'components' lists the template files that should be deployed in this stage. # Their config is applied in openshift in the same order they are listed. components: - "kafka" - "inventory-db" stage2: components: - "insights-inventory" - "upload-service" ``` 4. If you set `custom_deploy_logic` to True, read 'Custom Deploy Logic' below. 5. If you wish to define env vars for this service's templates, read 'Environment Files' below. 5. Add your service folder name to the base `_cfg.yml` in the `templates` directory. Remember that the `deploy_order` specifies the order in which each service set is deployed. So if your service set depends upon other services being deployed first, order it appropriately! 6. Run `ocdeployer list-sets` and you should see your new component listed as a deployable service set. ### Custom Deploy Logic By default, no pre_deploy/post_deploy is run, and the deploy logic is taken care of by the `ocdeployer.deploy.deploy_components` method. So, unless you are doing something complicated and require additional "python scripting" to handle your (pre/post) deploy logic, you don't need to worry about custom logic (and it's quite rare that you'd want to re-write the main deploy logic itself) But let's say you want to perform some tasks prior to deploying your components, or after deploying your components. Custom scripts can be useful for this. You can set `custom_deploy_logic` in your service set's `_cfg.yml` to `true`. You then have two options for defining a custom deploy script: * You can define a single `deploy.py` in the root `custom` directory of your project. This script will apply to all service sets as long as they have `custom_deploy_logic` set to `true`. * You can create a script called `deploy.py` in the `custom` dir of your service set. This script will apply only to that service set. %package -n python3-ocdeployer Summary: A tool which wraps the OpenShift command line tools to enable repeatable automated deployment of OpenShift templates Provides: python-ocdeployer BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-pip %description -n python3-ocdeployer ## Template Configuration The best way to explain how template configuration works is to describe the process for configuring a service set. #### A guide to creating a service set 1. Create a new directory in the `templates` directory for your service set, e.g. "myservice" 2. Add your OpenShift YAML files for your services in this directory. The files should be OpenShift template files that contain all resources needed to get your service running (except for secrets, and image streams of external images, we'll talk about that shortly...). This would commonly be things like `buildConfig`, `deploymentConfig`, `service`, `route`, etc. 3. Create a '_cfg.yml' file in your directory. The contents of this config file are explained below: ```yaml # (optional) requires # # Here you can list other service sets that need to be deployed before this one can. # Deployment will fail when processing this file if we see the required service set has # not yet been deployed in this run of ocdeployer. requires: - "myotherservice" # (optional) secrets # # Lists which secrets apps in this service set rely on; they will be validated or imported at run time. # A secret is only imported once per deploy run, so if other service sets rely on the same # secret it won't be imported again. secrets: - "mysecret" # You can also specify which service accounts a secret should be linked to - name: "othersecret" link: ["builder"] # (optional) custom_deploy_logic # # Indicates that there is a pre_deploy/post_deploy/deploy method defined for this # service set in the 'custom' folder that should be used custom_deploy_logic: true # (optional) post_deploy_timeout # # Indicates how long custom post_deploy logic should take before timeout (in seconds). # A null value can be handled differently depending on the post deploy logic, # but it is recommended that it means there is "no waiting" that will occur post_deploy_timeout: 300 # (optional) images # Lists the image streams these services require to be imported into the destination namespace. # # key = the name or name:tag for the image stream. If no tag is specified, 'latest' is used. # value = the full image docker uri # # 'oc import-image --from=""' is run at deploy time. # # If it already exists, it will be re-imported (and therefore the image will be updated) images: - cp-kafka: "confluentinc/cp-kafka" - cp-zookeeper: "confluentinc/cp-zookeeper" - nginx-stable-openshift: "docker.io/mhuth/nginx-stable-openshift" - python-36-centos7: "centos/python-36-centos7" - postgresql-95-rhel7: "registry.access.redhat.com/rhscl/postgresql-95-rhel7" # (required) deploy_order # # Lists the order in which components in this service set should be deployed. deploy_order: # A stage deploys a group of components in sequentially and then waits for them to reach 'active' # in parallel. By default, at the end of each stage, we wait for: # * DeploymentConfig's to be "active" # * StatefulSet's to be "active" # * BuildConfig's to succeed # # Setting 'wait' to false under the stage disables this behavior. # # Stages are processed after being sorted by name. stage0: wait: false components: - "zookeeper" stage1: # You can specify a wait timeout. By default, 300sec is used timeout: 600 # 'components' lists the template files that should be deployed in this stage. # Their config is applied in openshift in the same order they are listed. components: - "kafka" - "inventory-db" stage2: components: - "insights-inventory" - "upload-service" ``` 4. If you set `custom_deploy_logic` to True, read 'Custom Deploy Logic' below. 5. If you wish to define env vars for this service's templates, read 'Environment Files' below. 5. Add your service folder name to the base `_cfg.yml` in the `templates` directory. Remember that the `deploy_order` specifies the order in which each service set is deployed. So if your service set depends upon other services being deployed first, order it appropriately! 6. Run `ocdeployer list-sets` and you should see your new component listed as a deployable service set. ### Custom Deploy Logic By default, no pre_deploy/post_deploy is run, and the deploy logic is taken care of by the `ocdeployer.deploy.deploy_components` method. So, unless you are doing something complicated and require additional "python scripting" to handle your (pre/post) deploy logic, you don't need to worry about custom logic (and it's quite rare that you'd want to re-write the main deploy logic itself) But let's say you want to perform some tasks prior to deploying your components, or after deploying your components. Custom scripts can be useful for this. You can set `custom_deploy_logic` in your service set's `_cfg.yml` to `true`. You then have two options for defining a custom deploy script: * You can define a single `deploy.py` in the root `custom` directory of your project. This script will apply to all service sets as long as they have `custom_deploy_logic` set to `true`. * You can create a script called `deploy.py` in the `custom` dir of your service set. This script will apply only to that service set. %package help Summary: Development documents and examples for ocdeployer Provides: python3-ocdeployer-doc %description help ## Template Configuration The best way to explain how template configuration works is to describe the process for configuring a service set. #### A guide to creating a service set 1. Create a new directory in the `templates` directory for your service set, e.g. "myservice" 2. Add your OpenShift YAML files for your services in this directory. The files should be OpenShift template files that contain all resources needed to get your service running (except for secrets, and image streams of external images, we'll talk about that shortly...). This would commonly be things like `buildConfig`, `deploymentConfig`, `service`, `route`, etc. 3. Create a '_cfg.yml' file in your directory. The contents of this config file are explained below: ```yaml # (optional) requires # # Here you can list other service sets that need to be deployed before this one can. # Deployment will fail when processing this file if we see the required service set has # not yet been deployed in this run of ocdeployer. requires: - "myotherservice" # (optional) secrets # # Lists which secrets apps in this service set rely on; they will be validated or imported at run time. # A secret is only imported once per deploy run, so if other service sets rely on the same # secret it won't be imported again. secrets: - "mysecret" # You can also specify which service accounts a secret should be linked to - name: "othersecret" link: ["builder"] # (optional) custom_deploy_logic # # Indicates that there is a pre_deploy/post_deploy/deploy method defined for this # service set in the 'custom' folder that should be used custom_deploy_logic: true # (optional) post_deploy_timeout # # Indicates how long custom post_deploy logic should take before timeout (in seconds). # A null value can be handled differently depending on the post deploy logic, # but it is recommended that it means there is "no waiting" that will occur post_deploy_timeout: 300 # (optional) images # Lists the image streams these services require to be imported into the destination namespace. # # key = the name or name:tag for the image stream. If no tag is specified, 'latest' is used. # value = the full image docker uri # # 'oc import-image --from=""' is run at deploy time. # # If it already exists, it will be re-imported (and therefore the image will be updated) images: - cp-kafka: "confluentinc/cp-kafka" - cp-zookeeper: "confluentinc/cp-zookeeper" - nginx-stable-openshift: "docker.io/mhuth/nginx-stable-openshift" - python-36-centos7: "centos/python-36-centos7" - postgresql-95-rhel7: "registry.access.redhat.com/rhscl/postgresql-95-rhel7" # (required) deploy_order # # Lists the order in which components in this service set should be deployed. deploy_order: # A stage deploys a group of components in sequentially and then waits for them to reach 'active' # in parallel. By default, at the end of each stage, we wait for: # * DeploymentConfig's to be "active" # * StatefulSet's to be "active" # * BuildConfig's to succeed # # Setting 'wait' to false under the stage disables this behavior. # # Stages are processed after being sorted by name. stage0: wait: false components: - "zookeeper" stage1: # You can specify a wait timeout. By default, 300sec is used timeout: 600 # 'components' lists the template files that should be deployed in this stage. # Their config is applied in openshift in the same order they are listed. components: - "kafka" - "inventory-db" stage2: components: - "insights-inventory" - "upload-service" ``` 4. If you set `custom_deploy_logic` to True, read 'Custom Deploy Logic' below. 5. If you wish to define env vars for this service's templates, read 'Environment Files' below. 5. Add your service folder name to the base `_cfg.yml` in the `templates` directory. Remember that the `deploy_order` specifies the order in which each service set is deployed. So if your service set depends upon other services being deployed first, order it appropriately! 6. Run `ocdeployer list-sets` and you should see your new component listed as a deployable service set. ### Custom Deploy Logic By default, no pre_deploy/post_deploy is run, and the deploy logic is taken care of by the `ocdeployer.deploy.deploy_components` method. So, unless you are doing something complicated and require additional "python scripting" to handle your (pre/post) deploy logic, you don't need to worry about custom logic (and it's quite rare that you'd want to re-write the main deploy logic itself) But let's say you want to perform some tasks prior to deploying your components, or after deploying your components. Custom scripts can be useful for this. You can set `custom_deploy_logic` in your service set's `_cfg.yml` to `true`. You then have two options for defining a custom deploy script: * You can define a single `deploy.py` in the root `custom` directory of your project. This script will apply to all service sets as long as they have `custom_deploy_logic` set to `true`. * You can create a script called `deploy.py` in the `custom` dir of your service set. This script will apply only to that service set. %prep %autosetup -n ocdeployer-5.7.11 %build %py3_build %install %py3_install install -d -m755 %{buildroot}/%{_pkgdocdir} if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi pushd %{buildroot} if [ -d usr/lib ]; then find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/lib64 ]; then find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/bin ]; then find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/sbin ]; then find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst fi touch doclist.lst if [ -d usr/share/man ]; then find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst fi popd mv %{buildroot}/filelist.lst . mv %{buildroot}/doclist.lst . %files -n python3-ocdeployer -f filelist.lst %dir %{python3_sitelib}/* %files help -f doclist.lst %{_docdir}/* %changelog * Tue Apr 11 2023 Python_Bot - 5.7.11-1 - Package Spec generated