Publishing Methods for Connect
There are three ways to publish content to Connect:
Git-backed publishing
Git-backed publishing is useful as a lightweight continuous deployment solution when data scientists want to use Git for version control.
To deploy content directly from Git, data scientists configure Connect to track a particular branch and directory in a Git repository. Once setup, Connect will poll the repository for changes and automatically deploy updates so the code base and deployed content are always in sync.
Connect can publish content from private Git repositories. Add a service account to the repositories, and add the credentials of this service account to the Connect configuration file, an action that requires the server administrator.
Git-backed deployment does not support running tests prior to deployment. To take advantage of continuous integration workflows, employ API-backed publishing, as described below.
API-backed publishing
Deploying content with the Connect API is the most flexible deployment method but also requires the most setup. In API-backed publishing, an external CI/CD system pushes content updates to Connect using the Connect Server API. A benefit of this method is the ability to add tests and other pre-deployment activities commonly found in CI/CD pipelines. The Connect Server API allows teams to fully automate most actions that would otherwise be done manually in the Connect web interface such as:
- deploying content
- adding users to content
- customizing runtime settings
The API endpoints can be called directly or teams can integrate client packages like rsconnect-python or connnectapi into their CI/CD systems. An example workflow might include these steps:
A few examples: