IBM Cloud Schematics is an IBM Cloud service, that delivers Infrastructure as Code (IaC) tools as a service. You can use the capabilities of Schematics to consistently deploy and manage your cloud infrastructure environments.
IBM Cloud® Code Engine is a fully managed, serverless platform that runs your containerized workloads, including web apps, micro-services, event-driven functions, or batch jobs. Code Engine even builds container images for you from your source code.
You can use this blog and schedule your schematics jobs in specific time periods.
Step 1: Login IBM Cloud Console.
Open https://cloud.ibm.com/ and login with your credentials.
Step 2: Create Code Engine Project.
IBM Cloud Code Engine →Projects →Create
Press enter or click to view image in full size
Step3: Crate a Code Engine build.
The next step is to setup a code engine build to pull the code from the repository and build the container image.
IBM Cloud Code Engine→Open the Project → Image builds → Image Build →Create.
Code Repo URL: https://github.com/cloud-design-dev/code-engine-schematics-cron.git
Press enter or click to view image in full size
Once the build is configured, then Submit build.
Press enter or click to view image in full size
Step 4: Once the build completes, Create the Code Engine Job.
Jobs → Create → Configure image
Click the Configure image button to be taken to the Container selection menu. Select the image to use and click Done.
Press enter or click to view image in full size
Press enter or click to view image in full size
Add the environment variable for both IBMCLOUD_API_KEY and WORKSPACE_ID
Press enter or click to view image in full size
Press enter or click to view image in full size
IBMCLOUD_API_KEY : Api Key
WORKSPACE_ID: Schematics workspace id.
Once we create the environment variables create the job by clicking on create.
Step 5: Then Event subscriptions
Code Engine → Projects → select your project → Event subscriptions
Press enter or click to view image in full size
Define the timings based on your requirement that is when you would like to trigger the job.
Press enter or click to view image in full size
Press enter or click to view image in full size
Press enter or click to view image in full size
Done…!