-
Notifications
You must be signed in to change notification settings - Fork 5
Add subscription cron #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
@HeavyWombat @Luke-Roy-IBM is it possible to integrate this feature? |
|
@sauterle Thanks a lot for the Pull request I will look into this 👍 |
Signed-off-by: Stefan Sauterleute <stefan.sauterleute@byteleaf.de>
Signed-off-by: Stefan Sauterleute <stefan.sauterleute@byteleaf.de>
Signed-off-by: Stefan Sauterleute <stefan.sauterleute@byteleaf.de>
Signed-off-by: Stefan Sauterleute <stefan.sauterleute@byteleaf.de>
Luke-Roy-IBM
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sauterle Thanks for your pull request and your patience. Please address the changes and i will be able to update the Github action with Cron support
| if: ( inputs.component == 'subscription' || inputs.component == 'sub' ) && inputs.subscription-type == 'cron' | ||
| run: | | ||
| if ibmcloud ce sub cron get --name ${{ inputs.name }} ; then | ||
| ibmcloud ce sub cron update --name ${{ inputs.name }} --destination-type ${{ inputs.destination-type }} --destination ${{ inputs.destination }} --path ${{ inputs.path }} --extension ${{ inputs.extension }} --schedule ${{ inputs.schedule }} --wait ${{ steps.set-resources.outputs.cpu }} ${{ steps.set-resources.outputs.memory }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please replace with following code in order to update existing subscription
| ibmcloud ce sub cron update --name ${{ inputs.name }} --destination-type ${{ inputs.destination-type }} --destination ${{ inputs.destination }} --path ${{ inputs.path }} --extension ${{ inputs.extension }} --schedule ${{ inputs.schedule }} --wait ${{ steps.set-resources.outputs.cpu }} ${{ steps.set-resources.outputs.memory }} | |
| ibmcloud ce sub cron update --name ${{ inputs.name }} --destination-type ${{ inputs.destination-type }} --destination ${{ inputs.destination }} --path ${{ inputs.path }} --extension ${{ inputs.extension }} --schedule "${{ inputs.schedule }}" |
| if ibmcloud ce sub cron get --name ${{ inputs.name }} ; then | ||
| ibmcloud ce sub cron update --name ${{ inputs.name }} --destination-type ${{ inputs.destination-type }} --destination ${{ inputs.destination }} --path ${{ inputs.path }} --extension ${{ inputs.extension }} --schedule ${{ inputs.schedule }} --wait ${{ steps.set-resources.outputs.cpu }} ${{ steps.set-resources.outputs.memory }} | ||
| else | ||
| ibmcloud ce sub cron create --name ${{ inputs.name }} --destination-type ${{ inputs.destination-type }} --destination ${{ inputs.destination }} --path ${{ inputs.path }} --extension ${{ inputs.extension }} --schedule ${{ inputs.schedule }} --wait ${{ steps.set-resources.outputs.cpu }} ${{ steps.set-resources.outputs.memory }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please replace with the following in order to create a cron subscription
| ibmcloud ce sub cron create --name ${{ inputs.name }} --destination-type ${{ inputs.destination-type }} --destination ${{ inputs.destination }} --path ${{ inputs.path }} --extension ${{ inputs.extension }} --schedule ${{ inputs.schedule }} --wait ${{ steps.set-resources.outputs.cpu }} ${{ steps.set-resources.outputs.memory }} | |
| ibmcloud ce sub cron create --name ${{ inputs.name }} --destination-type ${{ inputs.destination-type }} --destination ${{ inputs.destination }} --path ${{ inputs.path }} --extension ${{ inputs.extension }} --schedule "${{ inputs.schedule }}" --wait |
| cpu: 1 | ||
| memory: 4G | ||
| ``` | ||
| *Deploy a Cron Subscription: `deploy-cron-sub.yml`*: Deploy your Cron Subscription to `Default` resource-group in `eu-de` to the project `MY-PROJECT` with its source code in the root of the repository the name of the job is`my-cron-sub`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| *Deploy a Cron Subscription: `deploy-cron-sub.yml`*: Deploy your Cron Subscription to `Default` resource-group in `eu-de` to the project `MY-PROJECT` with its source code in the root of the repository the name of the job is`my-cron-sub`. | |
| *Deploy a Cron Subscription: `deploy-cron-sub.yml`*: Deploy your Cron Subscription to `Default` resource-group in `eu-de` to the project `MY-PROJECT` with its source code in the root of the repository the name of the job is`cron-app`. See the docs for more infromation https://cloud.ibm.com/docs/codeengine?topic=codeengine-subscribe-cron-tutorial. |
| api-key: ${{ secrets.IBM_IAM_API_KEY }} | ||
| resource-group: 'Default' | ||
| region: 'eu-de' | ||
| project: 'MY-PROJECT' | ||
| component: 'sub' | ||
| subscription-type: 'cron' | ||
| destination-type: 'app' | ||
| destination: 'my-app' | ||
| path: '/events' | ||
| extension: 'extA=A' | ||
| schedule: '*/2 * * * *' | ||
| name: 'my-cron-sub' | ||
| build-source: './' | ||
| cpu: 1 | ||
| memory: 4G |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update docs as this is the way it was tested
| api-key: ${{ secrets.IBM_IAM_API_KEY }} | |
| resource-group: 'Default' | |
| region: 'eu-de' | |
| project: 'MY-PROJECT' | |
| component: 'sub' | |
| subscription-type: 'cron' | |
| destination-type: 'app' | |
| destination: 'my-app' | |
| path: '/events' | |
| extension: 'extA=A' | |
| schedule: '*/2 * * * *' | |
| name: 'my-cron-sub' | |
| build-source: './' | |
| cpu: 1 | |
| memory: 4G | |
| api-key: ${{ secrets.IBM_IAM_API_KEY }} | |
| resource-group: 'Default' | |
| region: 'eu-de' | |
| project: 'MY-PROJECT' | |
| component: 'sub' | |
| subscription-type: 'cron' | |
| destination-type: 'app' | |
| destination: 'cron-app' | |
| path: '/events' | |
| extension: 'extA=A' | |
| schedule: '*/2 * * * *' | |
| name: 'cron-sub' |
Add Subscription (cron) and general structure for component
subscription