IBM Cloud Docs
Creating an auto deploy button for Schematics actions

Creating an auto deploy button for Schematics actions

Use the instructions to create a button that opens the Schematics actions create page and pre-populates an action name and the GitHub repository URL that stores your Ansible playbook. You can use the button to create Schematics actions more quickly.

For a sample button, see the Deploy to IBM Cloud® button on the Sample Ansible playbook for IBM Cloud® page.

Creating the deployment URL

  1. Create an Ansible playbook and publish the playbook in a GitHub repository. If you do not have a playbook, you can use one of the IBM-provided Ansible playbooks.

  2. Copy the Git repository URL, such as https://github.com/Cloud-Schematics/ansible-app-deploy.

  3. Use the following syntax to create the URL to automatically pre-populate an action name and the Git repository URL on the Schematics actions create page. If you do not provide the name and Git repository URL, the Deploy to IBM Cloud® link defaults to the Create an action page without pre-populating an action name or the Git repository URL.

    Syntax

    https://cloud.ibm.com/schematics/actions/create?name=<action_name>&repository=<git_repository_url>
    

    Example

    https://cloud.ibm.com/schematics/actions/create?name=ansible-app-deploy&repository=https://github.com/Cloud-Schematics/ansible-app-deploy
    
  4. Open your web browser and enter the URL.

  5. Verify that the Schematics actions create page opens and that the Action name and Repository URL are pre-populated.

Adding the button to a website or page

You can add an image to your URL to create your Deploy to IBM Cloud button.

Adding the button in HTML

To add the button in an HTML page, such as a website, copy the following code into the page where you want to position the button. Replace <deployment URL> with the URL for the Schematics action.

<a href="<deployment URL>" target="_blank">
  <img src="https://cloud.ibm.com/media/docs/images/icons/Deploy_to_cloud.svg" alt="Deploy to IBM Cloud button">
</a>

Adding the button in Markdown

To add the button into a markdown file, such as in a repositories readme file, use the following syntax. Replace <deployment URL> with the URL for the deployment link.

Deploy to IBM Cloud button

Next steps

Explore the Schematics samples templates to deploy in your IBM Cloud account. Looking for more code examples? Check out the samples for IBM Cloud Schematics GitHub repositories.