/
Automate check-in of development OAC catalog items to SCM

Automate check-in of development OAC catalog items to SCM

Oracle OAC projects can source catalog objects from either a source code repository or development OAC instances. In your OAC project, which is used to build and deploy WebCatalog objects, you have the option to Discover from Git (or another SCM type) or Discover from Oracle Analytics Cloud within the File Catalog. Similar to other technologies, FlexDeploy can synchronize files between a development server and a source code repository, promoting the implementation of DevOps best practices for source-controlling developer code.

The OAC plugin modifies the file extensions and paths of exported or downloaded objects to establish metadata for each item. As a result, you cannot simply download the .catalog files from the OAC catalog manager and place them directly into source control, as this would be incompatible with the build and deployment operations of the OAC plugin. To simplify this process, FlexDeploy offers OAC export and download operations, eliminating the need for manual manipulation of files, ensuring the correct structure and extensions are maintained.

exportWebCatalog (OAC)

This operation is useful when you need to export specific files from an Analytics Cloud instance using a package. It is managed through a package-based project with the SCM type set to "None," which is separate from the project used for build and deploy. The build/deploy project is configured with the SCM type set to "Git" or some other SCM type.

Ensure project classification is Package-Based Deployments and project type is Oracle Analytics Cloud. Your project for this purpose may look something like this. 

Similar to other projects, you will configure project properties to specify the folder you're working with from the catalog. The goal is to extract files from a development server and commit them to Git, making necessary changes to file names or extensions. This process is part of the build workflow. Now, let's go through the Extract WebCatalog workflow. This workflow consists of following steps:

  1. Clone the Git repository where the objects are stored.

  2. Extract WebCatalog files into the local Git repository folder. Extraction typically occurs from the development environment. The number of objects extracted depends on whether an "All Files" or "Package" build is executed.

  3. Add any new files to the local Git repository.

  4. Commit any changes to the local Git repository. If no changes are found on the development server, nothing will be committed.

  5. Push changes to the remote repository.

Here is the source code for the build workflow. You will need to update the steps in the workflow according to your Git configuration (e.g. Git Instance, sparse checkout folder, etc.). Also, keep in mind that we are running this build against the main branch (stream), if you want to commit on a different branch then create the stream on the project as appropriate.

We are referencing Git in the example above, but plugins exist for many other popular source control management systems as well and a similar workflow can be created to accomplish the same task.

name: Extract OAC WebCatalog description: '' steps: - id: '1' name: Git Clone type: INVOKE_PLUGIN data: pluginName: FlexagonGITPlugin pluginOperation: clone inputs: - name: FDGIT_INP_INSTANCE_CODE value: value: FLEXTEST isExpression: false isEncrypted: false - name: FDGIT_INP_DEST_SUBFOLDER value: value: ../oacfiles isExpression: false isEncrypted: false - name: FDGIT_INP_BRANCH value: value: main isExpression: false isEncrypted: false - name: FDGIT_INP_TREELESS_CLONE value: value: 'false' isExpression: false isEncrypted: false - name: FDGIT_INP_DEPTH value: value: '1' isExpression: false isEncrypted: false - name: FDGIT_INP_SPARSE_CHECKOUT_FOLDERS value: value: '' isExpression: false isEncrypted: false endpointInstanceOverride: isExpression: false consumesArtifacts: false producesArtifacts: false endpointSelection: choice: All endpointExecution: choice: Any outputs: [] userInputs: [] userOutputs: [] - id: '2' name: exportWebCatalog type: INVOKE_PLUGIN data: pluginName: FlexagonOACPlugin pluginOperation: exportWebCatalog inputs: - name: FDOAC_INP_EXPORT_FOLDER value: value: ../oacfiles/OACCatalog isExpression: false isEncrypted: false - name: FDOAC_INP_COPY_PERMISSIONS value: value: 'true' isExpression: false isEncrypted: false - name: FDOAC_INP_PRESERVE_TIMESTAMPS value: value: 'false' isExpression: false isEncrypted: false endpointInstanceOverride: isExpression: false consumesArtifacts: false producesArtifacts: false endpointSelection: choice: All endpointExecution: choice: Any outputs: [] userInputs: [] userOutputs: [] - id: '3' name: Add any new Files type: INVOKE_PLUGIN data: pluginName: FlexagonGITPlugin pluginOperation: add inputs: - name: FDGIT_INP_INSTANCE_CODE value: value: FLEXTEST isExpression: false isEncrypted: false - name: FDGIT_INP_DEST_SUBFOLDER value: value: ../oacfiles isExpression: false isEncrypted: false - name: FDGIT_INP_FILELIST value: value: '--all .' isExpression: false isEncrypted: false endpointInstanceOverride: isExpression: false consumesArtifacts: false producesArtifacts: false endpointSelection: choice: All endpointExecution: choice: Any outputs: [] userInputs: [] userOutputs: [] - id: '4' name: Commit to Git type: INVOKE_PLUGIN data: pluginName: FlexagonGITPlugin pluginOperation: commit inputs: - name: FDGIT_INP_INSTANCE_CODE value: value: FLEXTEST isExpression: false isEncrypted: false - name: FDGIT_INP_DEST_SUBFOLDER value: value: ../oacfiles isExpression: false isEncrypted: false - name: FDGIT_INP_NAME value: value: FD_WF_USER isExpression: true isEncrypted: false - name: FDGIT_INP_EMAIL value: value: FD_WF_USER_EMAIL isExpression: true isEncrypted: false - name: FDGIT_INP_REVISION_MESSAGE value: value: OAC files added from flexdeploy workflow. isExpression: false isEncrypted: false endpointInstanceOverride: isExpression: false consumesArtifacts: false producesArtifacts: false endpointSelection: choice: All endpointExecution: choice: Any outputs: [] userInputs: [] userOutputs: [] - id: '5' name: Push to Central Repository type: INVOKE_PLUGIN data: pluginName: FlexagonGITPlugin pluginOperation: push inputs: - name: FDGIT_INP_INSTANCE_CODE value: value: FLEXTEST isExpression: false isEncrypted: false - name: FDGIT_INP_DEST_SUBFOLDER value: value: ../oacfiles isExpression: false isEncrypted: false - name: FDGIT_INP_BRANCH value: value: main isExpression: false isEncrypted: false - name: FDGIT_INP_FOLLOW_TAGS value: value: 'false' isExpression: false isEncrypted: false endpointInstanceOverride: isExpression: false consumesArtifacts: false producesArtifacts: false endpointSelection: choice: All endpointExecution: choice: Any outputs: [] userInputs: [] userOutputs: []

downloadWebCatalog (OAC)

This operation also exports or downloads objects from the OAC WebCatalog. The key difference is that it does not require a Package-based project and can be executed directly within a utility workflow.

Ensure project classification is Utility. Your project for this purpose may look something like this:

Now, let's discuss the Download WebCatalog workflow. This workflow consists of steps as outlined below:

  1. Clone the Git repository where the objects are stored.

  2. Download WebCatalog files into the local Git repository folder. The download typically occurs from the development environment, and all files from the specified path will be downloaded.

  3. Add any new files to the local Git repository.

  4. Commit any changes to the local Git repository. If there are no changes found on the development server, no files will be committed.

  5. Push changes to the remote repository.

Here is the source code for the utility workflow. You will need to update this workflow to indicate project Git instance code and sparse checkout folder for catalog objects:

We are referencing Git in the example above, but plugins exist for many other popular source control management systems as well, and a similar workflow can be created to accomplish the same task.

name: Download OAC WebCatalogs description: '' steps: - id: '1' name: Git Clone type: INVOKE_PLUGIN data: pluginName: FlexagonGITPlugin pluginOperation: clone inputs: - name: FDGIT_INP_INSTANCE_CODE value: value: FLEXTEST isExpression: false isEncrypted: false - name: FDGIT_INP_DEST_SUBFOLDER value: value: ../oacfiles isExpression: false isEncrypted: false - name: FDGIT_INP_BRANCH value: value: main isExpression: false isEncrypted: false - name: FDGIT_INP_TREELESS_CLONE value: value: 'false' isExpression: false isEncrypted: false - name: FDGIT_INP_DEPTH value: value: '1' isExpression: false isEncrypted: false - name: FDGIT_INP_SPARSE_CHECKOUT_FOLDERS value: value: '' isExpression: false isEncrypted: false endpointInstanceOverride: isExpression: false consumesArtifacts: false producesArtifacts: false endpointSelection: choice: All endpointExecution: choice: Any outputs: [] userInputs: [] userOutputs: [] - id: '2' name: downloadWebCatalog type: INVOKE_PLUGIN data: pluginName: FlexagonOACPlugin pluginOperation: downloadWebCatalog inputs: - name: FDOAC_INP_OBJECT_PATH value: value: /shared/Custom isExpression: false isEncrypted: false - name: FDOAC_INP_DOWNLOAD_FOLDER value: value: ../oacfiles/OACCatalog isExpression: false isEncrypted: false - name: FDOAC_INP_COPY_PERMISSIONS value: value: 'true' isExpression: false isEncrypted: false - name: FDOAC_INP_PRESERVE_TIMESTAMPS value: value: 'false' isExpression: false isEncrypted: false - name: FDOAC_INP_DISCOVER_SUB_ITEMS value: value: Scorecard,Dashboard Group isExpression: false isEncrypted: false endpointInstanceOverride: isExpression: false consumesArtifacts: false producesArtifacts: false endpointSelection: choice: All endpointExecution: choice: Any outputs: [] userInputs: [] userOutputs: [] - id: '3' name: Add any new Files type: INVOKE_PLUGIN data: pluginName: FlexagonGITPlugin pluginOperation: add inputs: - name: FDGIT_INP_INSTANCE_CODE value: value: FLEXTEST isExpression: false isEncrypted: false - name: FDGIT_INP_DEST_SUBFOLDER value: value: ../oacfiles isExpression: false isEncrypted: false - name: FDGIT_INP_FILELIST value: value: '--all .' isExpression: false isEncrypted: false endpointInstanceOverride: isExpression: false consumesArtifacts: false producesArtifacts: false endpointSelection: choice: All endpointExecution: choice: Any outputs: [] userInputs: [] userOutputs: [] - id: '4' name: Commit to Git type: INVOKE_PLUGIN data: pluginName: FlexagonGITPlugin pluginOperation: commit inputs: - name: FDGIT_INP_INSTANCE_CODE value: value: FLEXTEST isExpression: false isEncrypted: false - name: FDGIT_INP_DEST_SUBFOLDER value: value: ../oacfiles isExpression: false isEncrypted: false - name: FDGIT_INP_NAME value: value: FD_WF_USER isExpression: true isEncrypted: false - name: FDGIT_INP_EMAIL value: value: FD_WF_USER_EMAIL isExpression: true isEncrypted: false - name: FDGIT_INP_REVISION_MESSAGE value: value: OAC files added from flexdeploy workflow. isExpression: false isEncrypted: false endpointInstanceOverride: isExpression: false consumesArtifacts: false producesArtifacts: false endpointSelection: choice: All endpointExecution: choice: Any outputs: [] userInputs: [] userOutputs: [] - id: '5' name: Push to Central Repository type: INVOKE_PLUGIN data: pluginName: FlexagonGITPlugin pluginOperation: push inputs: - name: FDGIT_INP_INSTANCE_CODE value: value: FLEXTEST isExpression: false isEncrypted: false - name: FDGIT_INP_DEST_SUBFOLDER value: value: ../oacfiles isExpression: false isEncrypted: false - name: FDGIT_INP_BRANCH value: value: main isExpression: false isEncrypted: false - name: FDGIT_INP_FOLLOW_TAGS value: value: 'false' isExpression: false isEncrypted: false endpointInstanceOverride: isExpression: false consumesArtifacts: false producesArtifacts: false endpointSelection: choice: All endpointExecution: choice: Any outputs: [] userInputs: [] userOutputs: []

Summary

Using the exportWebCatalog (OAC) and downloadWebCatalog (OAC) plugin operations enables syncing the OAC WebCatalog objects from a development instance to a source code repository.  You can create your build/deploy project to source from the source code repository instead of an OAC instance.  This allows control over when objects are available/eligible for build and deployment.

Related content

Automate check-in of development OAC catalog items to SCM
Automate check-in of development OAC catalog items to SCM
More like this
Automate check-in of development OAC catalog items to SCM
Automate check-in of development OAC catalog items to SCM
More like this
Automate check-in of development OAC catalog items to SCM
Automate check-in of development OAC catalog items to SCM
More like this
Automate check-in of development OAC catalog items to SCM
Automate check-in of development OAC catalog items to SCM
More like this
Automate check-in of development OTBI catalog items to SCM
Automate check-in of development OTBI catalog items to SCM
More like this
Automate check-in of development OTBI catalog items to SCM
Automate check-in of development OTBI catalog items to SCM
More like this
The following macros are not currently supported in the footer:
  • style