Skip to content

Commit

Permalink
Merge pull request #3 from oracle-devrel/dip-test
Browse files Browse the repository at this point in the history
Modified fn code for create/update
  • Loading branch information
dipeshrath authored Aug 20, 2024
2 parents b836969 + 4da2e37 commit 41b0699
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
5 changes: 2 additions & 3 deletions fn-ci-cd-deployment-pipeline/oci-fn-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@ name: 'oci-fn-build'
permissions:
contents: read
on:
# Trigger the workflow on push or pull request,
# but only for the main branch
# Add Trigger for push or pull request, if needed
workflow_dispatch:
inputs:
OCI_FN_COMPARTMENT:
description: Function compartment
default: ocid1.compartment.oc1....

jobs:
# This workflow contains a single job called "build"
# This workflow contains a single job called "Build"
Build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
Expand Down
17 changes: 12 additions & 5 deletions fn-ci-cd-deployment-pipeline/oci-fn-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: 'oci-fn-deploy'
permissions:
contents: read
on:
# Trigger the workflow on push or pull request,
# but only for the main branch
# Add Trigger for push or pull request, if needed

workflow_dispatch:
inputs:
OCI_FN_NAME:
Expand All @@ -18,9 +18,15 @@ on:
OCI_FN_IMAGE:
description: OCIR Image to use for Function
default: bom.ocir.io/<imagepath-oci:0.0.2>
WORKFLOW_TYPE:
description: Workflow Type for create or updae function
type: choice
options:
- create
- update

jobs:
# This workflow contains a single job called "build"
# This workflow contains a single job called "Deploy"
Deploy:
runs-on: ubuntu-latest

Expand Down Expand Up @@ -65,7 +71,8 @@ jobs:
fn use context ${{ vars.OCI_TENANCY_NAME }}
fn update context registry ${{ vars.OCI_FN_REGISTRY }}
fn update context oracle.compartment-id ${{ inputs.OCI_FN_COMPARTMENT }}
fn update context api-url ${{ vars.OCI_FN_API_URL }}
fn update context api-url ${{ vars.OCI_FN_API_URL }}
- name: 'Create or Update OCI Function'
run: |
fn update function ${{ inputs.OCI_FN_APP }} ${{ inputs.OCI_FN_NAME }} --image ${{ inputs.OCI_FN_IMAGE }}
fn ${{ inputs.WORKFLOW_TYPE }} function ${{ inputs.OCI_FN_APP }} ${{ inputs.OCI_FN_NAME }} ${{ inputs.OCI_FN_IMAGE }}

0 comments on commit 41b0699

Please sign in to comment.