Disclaimer:
CircleCI Labs, including this repo, is a collection of solutions developed by members of CircleCI's field engineering teams through our engagement with various customer needs.
- ✅ Created by engineers @ CircleCI
- ✅ Used by real CircleCI customers
- ❌ not officially supported by CircleCI support
version: 2.1
orbs:
s3-cache: cci-labs/s3-cache@0.0.1
aws-cli: circleci/aws-cli@4.1.3
commands:
aws-auth-setup:
steps:
- aws-cli/setup:
region: << pipeline.parameters.aws-default-region >>
role_arn: << pipeline.parameters.role-name >>
role_session_name: "CircleCI-${CIRCLE_WORKFLOW_ID}-${CIRCLE_JOB}"
parameters:
account-id:
type: string
default: "999999999999"
aws-default-region:
type: string
default: "us-west-2"
role-name:
type: string
default: "arn:aws:iam::999999999999:role/awesome_aws_ci_oidc_role"
cache-path:
type: string
default: "/tmp/cache-dir"
cache-key:
type: string
description: "Cache Key for storing in S3"
default: << pipeline.git.branch >>
jobs:
s3-custom-cache:
docker:
- image: cimg/base:current
parallelism: 1
steps:
- checkout
- aws-auth-setup
- run:
name: "Create a Dummy Cache"
command: |
mkdir << pipeline.parameters.cache-path >>
head -c 85765 </dev/urandom > /tmp/cache-dir/cache-file-$CIRCLE_NODE_INDEX
- s3-cache/save-cache:
cache-path: << pipeline.parameters.cache-path >>
bucket-name: cci-labs-bucket
cache-key: << pipeline.git.branch >>
- s3-cache/restore-cache:
cache-key: << pipeline.git.branch >>
bucket-name: cci-labs-bucket
workflows:
custom-cache-workflow:
jobs:
- s3-custom-cache
CircleCI Orb Registry Page - The official registry page of this orb for all versions, executors, commands, and jobs described.
We welcome issues to and pull requests against this repository!
- Merge pull requests with desired changes to the main branch.
- For the best experience, squash-and-merge and use Conventional Commit Messages.
- Find the current version of the orb.
- You can run
circleci orb info cci-labs/s3-cache | grep "Latest"to see the current version.
- You can run
- Create a new Release on GitHub.
- Click "Choose a tag" and create a new semantically versioned tag. (ex: v1.0.0)
- We will have an opportunity to change this before we publish if needed after the next step.
- Click "Choose a tag" and create a new semantically versioned tag. (ex: v1.0.0)
- Click "+ Auto-generate release notes".
- This will create a summary of all of the merged pull requests since the previous release.
- If you have used Conventional Commit Messages it will be easy to determine what types of changes were made, allowing you to ensure the correct version tag is being published.
- Now ensure the version tag selected is semantically accurate based on the changes included.
- Click "Publish Release".
- This will push a new tag and trigger your publishing pipeline on CircleCI.