Skip to content

A concourse resource for interacting with Oracle Cloud Infrastructure's Object Storage

License

Notifications You must be signed in to change notification settings

bitsarvi/ocios-resource

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OCI Object Storage Resource

A concourse resource for interacting with Oracle Cloud Infrastructure's Object Storage

This resource is based on the official S3 resource.

Source Configuration

  • ns (required): the namespace containing the bucket

  • bucket (required): the name of the bucket.

  • config (required): the various configuration entities required by the OCI APIs. Example:

    config: |
      {
        "user": "...",
        "fingerprint": "...",
        "apikey": "...",
        "tenancy": "...",
        "region": "..."
      }
    

File Names

One of the following two options must be specified:

  • regexp: the pattern to match filenames against within a bucket. The first grouped match is used to extract the version.

    The version extracted from this pattern is used to version the resource. Semantic versions, or just numbers, are supported. Accordingly, full regular expressions are supported, to specify the capture groups.

Behavior

check: Extract versions from the bucket.

Objects will be found via the pattern configured by regexp. The versions will be used to order them (using semver). Each object's filename is the resulting version.

in: Fetch an object from the bucket.

Places the following files in the destination:

  • (filename): the file fetched from the bucket.

  • regexp: the pattern to match filenames against within a bucket. The first grouped match is used to extract the version.

  • version: the version identified in the file name (only if using regexp).

Parameters

None

out: Upload an object to the bucket.

Given a file specified by file, upload it to the OCI Object Storage bucket.

Parameters

  • file (required): path to the file to upload, provided by an output of a task. If multiple files are matched by the glob, an error is raised. The file which matches will be placed into the directory structure on GCS as defined in regexp in the resource definition. The matching syntax is bash glob expansion, so no capture groups, etc.

Example Configuration

Resource Type

resource_types:
  - name: ocios-resource
    type: docker-image
    source:
      repository: bitsarvi/ocios-resource

Resource

resources:
  - name: release
    type: ocios-resource
    source:
      bucket: releases
      config: <OCI-SDK-API-CONFIG-CONTENTS>

Plan

- get: release
- put: release
  params:
    file: path/to/release-*.tgz

Developing on this resource

First get the resource via: go get github.com/bitsarvi/ocios-resource

Run the unit-tests: make

Run the integration-tests: make integration-tests

Developing using Concourse

Clone this repository and just run one-off task with concourse

fly -t ConcourseTarget execute -c build.yml -i ocios-resource=. -o built-resource=.

Just build the Docker image to be use inside your pipeline

 docker build -t bitsarvi/ocios-resource .

About

A concourse resource for interacting with Oracle Cloud Infrastructure's Object Storage

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages