diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 142acae..2a12614 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -2,7 +2,7 @@ steps: - label: ':sparkles: Lint' plugins: - plugin-linter#v2.0.0: - id: gencer/cache + id: nienbo/cache - label: ':shell: Shellcheck' plugins: - shellcheck#v1.1.2: diff --git a/CHANGELOG.md b/CHANGELOG.md index e12e8dd..e51b243 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# v2.4.14 + ++ Remove existing tar file when cache **always** is set to `true`. See #59 by @ingcsmoreno + # v2.4.13 + Add `save-cache` property to s3 cache. @ingcsmoreno diff --git a/LICENSE b/LICENSE index 5e4c82e..8ab1fff 100644 --- a/LICENSE +++ b/LICENSE @@ -2,6 +2,7 @@ MIT License Copyright (c) 2019 Daniel Thorpe Copyright (c) 2020-2022 Gencer W. Genç +Copyright (c) 2023 Nienbo Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index b3ffa12..3733593 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Cache Buildkite Plugin [![Version badge](https://img.shields.io/badge/cache-v2.4.13-blue?style=flat-square)](https://buildkite.com/plugins) [![CI](https://github.com/nienbo/cache-buildkite-plugin/actions/workflows/ci.yml/badge.svg)](https://github.com/nienbo/cache-buildkite-plugin/actions/workflows/ci.yml) +# Cache Buildkite Plugin [![Version badge](https://img.shields.io/badge/cache-v2.4.14-blue?style=flat-square)](https://buildkite.com/plugins) [![CI](https://github.com/nienbo/cache-buildkite-plugin/actions/workflows/ci.yml/badge.svg)](https://github.com/nienbo/cache-buildkite-plugin/actions/workflows/ci.yml) ### Tarball, Rsync & S3 Cache Kit for Buildkite. Supports Linux, macOS and Windows* @@ -46,6 +46,7 @@ Plus, In addition to tarball & rsync, we also do not re-create another tarball f - [Sharing caches between pipelines](#sharing-caches-between-pipelines) - [Keep the cache file between jobs/builds](#keep-the-cache-file-between-jobsbuilds) - [Auto deletion old caches](#auto-deletion-old-caches) + - [Always upload Cache](#always-upload-cache) - [Globs on paths](#globs-on-paths) - [Roadmap](#roadmap) @@ -82,7 +83,7 @@ S3 backend uses **AWS CLI** v**1** or v**2** to copy and download from/to S3 buc ```yml steps: - plugins: - - nienbo/cache#v2.4.13: + - nienbo/cache#v2.4.14: id: ruby # or ruby-3.0 backend: s3 key: "v1-cache-{{ id }}-{{ runner.os }}-{{ checksum 'Gemfile.lock' }}" @@ -112,7 +113,7 @@ Use `endpoint` and `region` fields to pass host and region parameters to be able ```yml steps: - plugins: - - nienbo/cache#v2.4.13: + - nienbo/cache#v2.4.14: id: ruby # or ruby-3.0 backend: s3 key: "v1-cache-{{ id }}-{{ runner.os }}-{{ checksum 'Gemfile.lock' }}" @@ -148,7 +149,7 @@ Enabling this interoperability in Google Cloud Storage will generate the respect ```yml steps: - plugins: - - nienbo/cache#v2.4.13: + - nienbo/cache#v2.4.14: id: ruby # or ruby-3.0 backend: s3 key: "v1-cache-{{ id }}-{{ runner.os }}-{{ checksum 'Gemfile.lock' }}" @@ -203,7 +204,7 @@ You can also use rsync to store your files using the `rsync` backend. Files will ```yml steps: - plugins: - - nienbo/cache#v2.4.13: + - nienbo/cache#v2.4.14: id: ruby # or ruby-3.0 backend: rsync key: "v1-cache-{{ id }}-{{ runner.os }}-{{ checksum 'Gemfile.lock' }}" @@ -228,7 +229,7 @@ You can also use tarballs to store your files using the `tarball` backend. Files ```yml steps: - plugins: - - nienbo/cache#v2.4.13: + - nienbo/cache#v2.4.14: id: ruby # or ruby-3.0 backend: tarball key: "v1-cache-{{ id }}-{{ runner.os }}-{{ checksum 'Gemfile.lock' }}" @@ -273,7 +274,7 @@ Along with lock files, you can calculate directory that contains multiple files ```yml steps: - plugins: - - nienbo/cache#v2.4.13: + - nienbo/cache#v2.4.14: id: node # or node-16 backend: tarball # Optional. Default `backend` is already set to `tarball` key: "v1-cache-{{ id }}-{{ runner.os }}-{{ checksum './app/javascript' }}" # Calculate whole 'app/javascript' recursively @@ -299,7 +300,7 @@ You can skip caching on Pull Requests (Merge Requests) by simply adding `pr: fal ```yml steps: - plugins: - - nienbo/cache#v2.4.13: + - nienbo/cache#v2.4.14: id: ruby # or ruby-3.0 backend: s3 key: "v1-cache-{{ id }}-{{ runner.os }}-{{ checksum 'Gemfile.lock' }}" @@ -355,8 +356,8 @@ ruby-cache: &ruby-cache - 'bundler/vendor' all-plugins: &all-plugins - - nienbo/cache#v2.4.13: *node-cache - - nienbo/cache#v2.4.13: *ruby-cache + - nienbo/cache#v2.4.14: *node-cache + - nienbo/cache#v2.4.14: *ruby-cache - docker#v3.7.0: ~ # Use your config here steps: @@ -381,7 +382,7 @@ steps: key: jest command: yarn test --runInBand plugins: - - nienbo/cache#v2.4.13: # Define cache *before* docker plugins. + - nienbo/cache#v2.4.14: # Define cache *before* docker plugins. id: ruby # or ruby-3.0 backend: s3 key: "v1-cache-{{ id }}-{{ runner.os }}-{{ checksum 'Gemfile.lock' }}" @@ -406,7 +407,7 @@ steps: key: jest command: yarn test --runInBand plugins: - - nienbo/cache#v2.4.13: + - nienbo/cache#v2.4.14: id: ruby # or ruby-3.0 backend: s3 key: "v1-cache-{{ id }}-{{ runner.os }}-{{ checksum 'Gemfile.lock' }}" @@ -437,7 +438,7 @@ steps: key: jest command: yarn test --runInBand plugins: - - nienbo/cache#v2.4.13: + - nienbo/cache#v2.4.14: id: ruby # or ruby-3.0 backend: s3 key: "v1-cache-{{ id }}-{{ runner.os }}-{{ checksum 'Gemfile.lock' }}" @@ -463,7 +464,7 @@ steps: key: jest command: yarn test --runInBand plugins: - - nienbo/cache#v2.4.13: + - nienbo/cache#v2.4.14: id: ruby # or ruby-3.0 backend: s3 key: "v1-cache-{{ id }}-{{ runner.os }}-{{ checksum 'Gemfile.lock' }}" @@ -488,7 +489,7 @@ steps: key: jest command: yarn test --runInBand plugins: - - nienbo/cache#v2.4.13: + - nienbo/cache#v2.4.14: id: ruby # or ruby-3.0 backend: s3 key: "v1-cache-{{ id }}-{{ runner.os }}-{{ checksum 'Gemfile.lock' }}" @@ -513,7 +514,7 @@ steps: key: jest command: yarn test --runInBand plugins: - - nienbo/cache#v2.4.13: + - nienbo/cache#v2.4.14: id: ruby # or ruby-3.0 backend: s3 key: "v1-cache-{{ id }}-{{ runner.os }}-{{ checksum 'Gemfile.lock' }}" @@ -534,6 +535,33 @@ For tarballs, To keep caches and delete them in _for example_ 7 days, use `max: For S3, As long as you use Lifcecycle policy (AWS and Scaleway supports this feature) you will only have caches for number of days you specify in your Lifecycle policy terms. This will allows you to invalidate old caches and save some storage costs. +## Always upload Cache + +There are some cases where you want to process the cache no matter of what. In this scenario, use `always` option and set it to `true` (Defaults to `false`): + +See #46 and #59 for details. + +```yaml +steps: + - name: ':jest: Run tests' + key: jest + command: yarn test --runInBand + plugins: + - nienbo/cache#v2.4.14: + id: ruby # or ruby-3.0 + backend: s3 + key: "v1-cache-{{ id }}-{{ runner.os }}-{{ checksum 'Gemfile.lock' }}" + restore-keys: + - 'v1-cache-{{ id }}-{{ runner.os }}-' + - 'v1-cache-{{ id }}-' + compress: 2 # fast compression. + always: true # Optional. Always process the cache and upload. Defaults to `false` + s3: + bucket: s3-bucket + paths: + - bundle/vendor +``` + ## Globs on paths You can use glob pattern in paths (to be cached) after `v2.1.x` @@ -544,4 +572,4 @@ You can use glob pattern in paths (to be cached) after `v2.1.x` + BitPaket Easy Storage support. + Azure Blob Storage support. -Copyright (C) 2023 Gencer W. Genç. +Copyright © 2023 Nienbo Corporation. All rights reserved. diff --git a/VERSION b/VERSION index b40e924..e5f3129 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.4.13 +2.4.14 diff --git a/docker-compose.yml b/docker-compose.yml index cff31b8..ac0a733 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,7 +6,7 @@ services: - '.:/plugin:ro' lint: image: buildkite/plugin-linter - command: ['--id', 'gencer/cache'] + command: ['--id', 'nienbo/cache'] volumes: - '.:/plugin:ro' shellcheck: