Deploying to Functions

Create a pipeline to deploy artifacts to Oracle Functions.

Before you begin, you must have a deployment pipeline, a Functions environment to deploy to, and a container image repository artifact.

Each service in Oracle Cloud Infrastructure (OCI) integrates with Identity and Access Management (IAM) for authentication and authorization. To grant users permission to access the DevOps deployment pipelines and other resources, you have to create dynamic groups and IAM policies.

For creating dynamic groups and policies for deployment pipelines, see Deployment Pipeline Policies. For more details, see DevOps IAM Policies.

For accessing DevOps using the Oracle Cloud Console, REST API, and CLI, see Accessing DevOps.

    1. Open the navigation menu and click Developer Services. Under DevOps, click Projects.
    2. Select a project, and a deployment pipeline.
    3. To add a stage to the pipeline, click the + icon and select Add stage.
    4. For stage type, select Deploy - Function, and then click Next.
    5. Enter a name and description for the stage. Adding a description is optional.
    6. For Environment, select an existing function.

      The read-only Function name field displays the default Functions strategy that is used for the deployment.

    7. Click Select Artifact, and then select an existing artifact resource from your DevOps project.

      Click Remove Artifact to remove one or more artifacts and select another one. Removing an artifact in the pipeline stage does not delete the artifact resource from your project.

    8. (Optional) To add tags to the pipeline, click Show tagging options. Tagging is a metadata system that lets you organize and track the resources in your tenancy.

      If you have permissions to create a resource, you also have permissions to add free-form tags to it.

      To add a defined tag, you must have permissions to use the tag namespace.

      For more information, see Resource Tags.

    9. To add the Function stage to the pipeline, click Add.

      A stage preview provides a snapshot of the configuration.

    Add more stages sequentially or in parallel to the pipeline, as needed. To deploy the build output to the target environment, run the deployment pipeline.

    To automatically trigger a deployment from the build pipeline, you can add a Trigger Deployment stage to the build pipeline.

  • To create a Functions deployment stage for the pipeline, run the create-deploy-function-stage command:

    oci devops deploy-stage create-deploy-function-stage

    Required parameters for the create-deploy-function-stage command:

    • --docker-image-artifact-id
    • --function-environment-id
    • --pipeline-id
    • --stage-predecessor-collection

    To get all the commands for deploy-stage:

    oci devops deploy-stage -h

    To get help for the create-function-stage command:

    oci devops deploy-stage create-deploy-function-stage -h
  • To create a Function deployment stage for the pipeline, use the CreateDeployStage operation. For deployStageType attribute, specify the DEPLOY_FUNCTION and INVOKE_FUNCTION values.