From db8b93a32a838fa404264994815554b598d81a3e Mon Sep 17 00:00:00 2001 From: jrgriffiniii <1443986+jrgriffiniii@users.noreply.github.com> Date: Thu, 9 Feb 2023 13:17:12 -0500 Subject: [PATCH] Integrating samvera-circleci-orb into maintenance as a part of the Core Component reorganization --- .circleci/config.yml | 63 +++++- .yamllint.yml | 7 + Pipfile | 12 + Pipfile.lock | 91 ++++++++ README.md | 97 ++++++--- samvera-circleci-orb/.gitignore | 1 + samvera-circleci-orb/CODE_OF_CONDUCT.md | 36 +++ samvera-circleci-orb/CONTRIBUTING.md | 159 ++++++++++++++ samvera-circleci-orb/LICENSE | 205 ++++++++++++++++++ samvera-circleci-orb/README.md | 94 ++++++++ samvera-circleci-orb/SUPPORT.md | 5 + samvera-circleci-orb/src/@orb.yml | 9 + samvera-circleci-orb/src/commands/bundle.yml | 69 ++++++ .../src/commands/bundle_for_gem.yml | 38 ++++ .../src/commands/cached_checkout.yml | 13 ++ .../src/commands/engine_cart_generate.yml | 21 ++ .../install_solr_active_fedora_core.yml | 28 +++ .../src/commands/install_solr_core.yml | 33 +++ .../src/commands/parallel_rspec.yml | 14 ++ samvera-circleci-orb/src/commands/rubocop.yml | 22 ++ samvera-circleci-orb/src/executors/ruby.yml | 18 ++ .../src/executors/ruby_fcrepo_solr.yml | 37 ++++ .../src/executors/ruby_fcrepo_solr_redis.yml | 41 ++++ .../ruby_fcrepo_solr_redis_postgres.yml | 48 ++++ 24 files changed, 1121 insertions(+), 40 deletions(-) create mode 100644 .yamllint.yml create mode 100644 Pipfile create mode 100644 Pipfile.lock create mode 100644 samvera-circleci-orb/.gitignore create mode 100644 samvera-circleci-orb/CODE_OF_CONDUCT.md create mode 100644 samvera-circleci-orb/CONTRIBUTING.md create mode 100644 samvera-circleci-orb/LICENSE create mode 100644 samvera-circleci-orb/README.md create mode 100644 samvera-circleci-orb/SUPPORT.md create mode 100644 samvera-circleci-orb/src/@orb.yml create mode 100644 samvera-circleci-orb/src/commands/bundle.yml create mode 100644 samvera-circleci-orb/src/commands/bundle_for_gem.yml create mode 100644 samvera-circleci-orb/src/commands/cached_checkout.yml create mode 100644 samvera-circleci-orb/src/commands/engine_cart_generate.yml create mode 100644 samvera-circleci-orb/src/commands/install_solr_active_fedora_core.yml create mode 100644 samvera-circleci-orb/src/commands/install_solr_core.yml create mode 100644 samvera-circleci-orb/src/commands/parallel_rspec.yml create mode 100644 samvera-circleci-orb/src/commands/rubocop.yml create mode 100644 samvera-circleci-orb/src/executors/ruby.yml create mode 100644 samvera-circleci-orb/src/executors/ruby_fcrepo_solr.yml create mode 100644 samvera-circleci-orb/src/executors/ruby_fcrepo_solr_redis.yml create mode 100644 samvera-circleci-orb/src/executors/ruby_fcrepo_solr_redis_postgres.yml diff --git a/.circleci/config.yml b/.circleci/config.yml index d00c008..e896316 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,23 +1,49 @@ --- version: 2.1 + orbs: + orb-tools: circleci/orb-tools@11.6 + # The following error is raised: + # + # The dev version of samvera/circleci-orb@dev:alpha has expired. Dev versions of orbs are only valid for 90 days after publishing. + # samvera: samvera/circleci-orb@dev:alpha samvera: samvera/circleci-orb@1.0 + +orb_promotion_filters: &orb_promotion_filters + branches: + ignore: /.*/ + tags: + only: /^(major|minor|patch)-release-v\d+\.\d+\.\d+$/ + +parameters: + run-integration-tests: + type: boolean + default: false + dev-orb-version: + type: string + # default: 'dev:alpha' + default: "1.0" + jobs: - bundle_and_test: + lint: parameters: ruby_version: type: string bundler_version: type: string default: 2.3.11 + executor: name: "samvera/ruby" ruby_version: << parameters.ruby_version >> + environment: WAIT_FOR_JEKYLL: 10 NOKOGIRI_USE_SYSTEM_LIBRARIES: true + steps: - samvera/cached_checkout + - run: name: Check for a branch named 'master' command: | @@ -27,14 +53,17 @@ jobs: echo "$(git branch --all --list master */master)" fi [[ -z "$(git branch --all --list master */master)" ]] + - run: name: Install the NPM dependencies using Yarn command: | yarn install -D + - run: name: Lint the formatting of source code files using Prettier command: | yarn run prettier --check . + - persist_to_workspace: root: ~/ paths: @@ -45,9 +74,19 @@ workflows: version: 2 ci: jobs: - - bundle_and_test: - name: ruby3-1 - ruby_version: 3.1.1 + - lint: + name: lint + ruby_version: 3.2.0 + - orb-tools/lint: + source-dir: samvera-circleci-orb/src + - orb-tools/pack: + source-dir: samvera-circleci-orb/src + - orb-tools/publish: + vcs-type: github + orb-name: samvera/circleci-orb + requires: + - orb-tools/lint + - orb-tools/pack nightly: triggers: @@ -58,6 +97,16 @@ workflows: only: - main jobs: - - bundle_and_test: - name: ruby3-1 - ruby_version: 3.1.1 + - lint: + name: lint + ruby_version: 3.2.0 + - orb-tools/lint: + source-dir: samvera-circleci-orb/src + - orb-tools/pack: + source-dir: samvera-circleci-orb/src + - orb-tools/publish: + vcs-type: github + orb-name: samvera/circleci-orb + requires: + - orb-tools/lint + - orb-tools/pack diff --git a/.yamllint.yml b/.yamllint.yml new file mode 100644 index 0000000..6f9b33c --- /dev/null +++ b/.yamllint.yml @@ -0,0 +1,7 @@ +--- +extends: default + +rules: + line-length: + max: 80 + level: warning diff --git a/Pipfile b/Pipfile new file mode 100644 index 0000000..05f2caa --- /dev/null +++ b/Pipfile @@ -0,0 +1,12 @@ +[[source]] +url = "https://pypi.org/simple" +verify_ssl = true +name = "pypi" + +[packages] + +[dev-packages] +yamllint = "*" + +[requires] +python_version = "3.10" diff --git a/Pipfile.lock b/Pipfile.lock new file mode 100644 index 0000000..f095f78 --- /dev/null +++ b/Pipfile.lock @@ -0,0 +1,91 @@ +{ + "_meta": { + "hash": { + "sha256": "d0688e7f180348c8ca750f6157a0117322c1264193f69877ec33c147e35516f8" + }, + "pipfile-spec": 6, + "requires": { + "python_version": "3.10" + }, + "sources": [ + { + "name": "pypi", + "url": "https://pypi.org/simple", + "verify_ssl": true + } + ] + }, + "default": {}, + "develop": { + "pathspec": { + "hashes": [ + "sha256:3a66eb970cbac598f9e5ccb5b2cf58930cd8e3ed86d393d541eaf2d8b1705229", + "sha256:64d338d4e0914e91c1792321e6907b5a593f1ab1851de7fc269557a21b30ebbc" + ], + "markers": "python_version >= '3.7'", + "version": "==0.11.0" + }, + "pyyaml": { + "hashes": [ + "sha256:01b45c0191e6d66c470b6cf1b9531a771a83c1c4208272ead47a3ae4f2f603bf", + "sha256:0283c35a6a9fbf047493e3a0ce8d79ef5030852c51e9d911a27badfde0605293", + "sha256:055d937d65826939cb044fc8c9b08889e8c743fdc6a32b33e2390f66013e449b", + "sha256:07751360502caac1c067a8132d150cf3d61339af5691fe9e87803040dbc5db57", + "sha256:0b4624f379dab24d3725ffde76559cff63d9ec94e1736b556dacdfebe5ab6d4b", + "sha256:0ce82d761c532fe4ec3f87fc45688bdd3a4c1dc5e0b4a19814b9009a29baefd4", + "sha256:1e4747bc279b4f613a09eb64bba2ba602d8a6664c6ce6396a4d0cd413a50ce07", + "sha256:213c60cd50106436cc818accf5baa1aba61c0189ff610f64f4a3e8c6726218ba", + "sha256:231710d57adfd809ef5d34183b8ed1eeae3f76459c18fb4a0b373ad56bedcdd9", + "sha256:277a0ef2981ca40581a47093e9e2d13b3f1fbbeffae064c1d21bfceba2030287", + "sha256:2cd5df3de48857ed0544b34e2d40e9fac445930039f3cfe4bcc592a1f836d513", + "sha256:40527857252b61eacd1d9af500c3337ba8deb8fc298940291486c465c8b46ec0", + "sha256:432557aa2c09802be39460360ddffd48156e30721f5e8d917f01d31694216782", + "sha256:473f9edb243cb1935ab5a084eb238d842fb8f404ed2193a915d1784b5a6b5fc0", + "sha256:48c346915c114f5fdb3ead70312bd042a953a8ce5c7106d5bfb1a5254e47da92", + "sha256:50602afada6d6cbfad699b0c7bb50d5ccffa7e46a3d738092afddc1f9758427f", + "sha256:68fb519c14306fec9720a2a5b45bc9f0c8d1b9c72adf45c37baedfcd949c35a2", + "sha256:77f396e6ef4c73fdc33a9157446466f1cff553d979bd00ecb64385760c6babdc", + "sha256:81957921f441d50af23654aa6c5e5eaf9b06aba7f0a19c18a538dc7ef291c5a1", + "sha256:819b3830a1543db06c4d4b865e70ded25be52a2e0631ccd2f6a47a2822f2fd7c", + "sha256:897b80890765f037df3403d22bab41627ca8811ae55e9a722fd0392850ec4d86", + "sha256:98c4d36e99714e55cfbaaee6dd5badbc9a1ec339ebfc3b1f52e293aee6bb71a4", + "sha256:9df7ed3b3d2e0ecfe09e14741b857df43adb5a3ddadc919a2d94fbdf78fea53c", + "sha256:9fa600030013c4de8165339db93d182b9431076eb98eb40ee068700c9c813e34", + "sha256:a80a78046a72361de73f8f395f1f1e49f956c6be882eed58505a15f3e430962b", + "sha256:afa17f5bc4d1b10afd4466fd3a44dc0e245382deca5b3c353d8b757f9e3ecb8d", + "sha256:b3d267842bf12586ba6c734f89d1f5b871df0273157918b0ccefa29deb05c21c", + "sha256:b5b9eccad747aabaaffbc6064800670f0c297e52c12754eb1d976c57e4f74dcb", + "sha256:bfaef573a63ba8923503d27530362590ff4f576c626d86a9fed95822a8255fd7", + "sha256:c5687b8d43cf58545ade1fe3e055f70eac7a5a1a0bf42824308d868289a95737", + "sha256:cba8c411ef271aa037d7357a2bc8f9ee8b58b9965831d9e51baf703280dc73d3", + "sha256:d15a181d1ecd0d4270dc32edb46f7cb7733c7c508857278d3d378d14d606db2d", + "sha256:d4b0ba9512519522b118090257be113b9468d804b19d63c71dbcf4a48fa32358", + "sha256:d4db7c7aef085872ef65a8fd7d6d09a14ae91f691dec3e87ee5ee0539d516f53", + "sha256:d4eccecf9adf6fbcc6861a38015c2a64f38b9d94838ac1810a9023a0609e1b78", + "sha256:d67d839ede4ed1b28a4e8909735fc992a923cdb84e618544973d7dfc71540803", + "sha256:daf496c58a8c52083df09b80c860005194014c3698698d1a57cbcfa182142a3a", + "sha256:dbad0e9d368bb989f4515da330b88a057617d16b6a8245084f1b05400f24609f", + "sha256:e61ceaab6f49fb8bdfaa0f92c4b57bcfbea54c09277b1b4f7ac376bfb7a7c174", + "sha256:f84fbc98b019fef2ee9a1cb3ce93e3187a6df0b2538a651bfb890254ba9f90b5" + ], + "markers": "python_version >= '3.6'", + "version": "==6.0" + }, + "setuptools": { + "hashes": [ + "sha256:23c86b4e44432bfd8899384afc08872ec166a24f48a3f99f293b0a557e6a6b5d", + "sha256:daec07fd848d80676694d6bf69c009d28910aeece68a38dbe88b7e1bb6dba12e" + ], + "markers": "python_version >= '3.7'", + "version": "==67.3.1" + }, + "yamllint": { + "hashes": [ + "sha256:5153bf9f8205aa9dc6af6217e38bd4f5baf09d9a7c6f4ae1e23f90d9c00c49c5", + "sha256:66a755d5fbcbb8831f1a9568676329b5bac82c37995bcc9afd048b6459f9fa48" + ], + "index": "pypi", + "version": "==1.29.0" + } + } +} diff --git a/README.md b/README.md index 30f6aa8..80a476f 100644 --- a/README.md +++ b/README.md @@ -1,46 +1,38 @@ # Component Maintenance Interest Group -This repository holds templates and guidelines to support the maintenance of projects in the [Samvera](https://github.com/samvera) Github organization. +This repository contains [samvera-circleci-orb](./samvera-circleci-orb), documentation, and templates to support the maintenance of projects in the [Samvera](https://github.com/samvera) Github organization. -## Samvera Core Components +## Maintenance Projects -Samvera Core Components are defined as the following: +Within this repository are maintained the following Ruby Gems used for the administration and quality assurance of source code projects: -> The primary Samvera code repository contains the Samvera community’s current consensus on what we are using, maintaining, and recommending. Ideally, this repository only contains code modules that are being actively used and maintained. - -_Please reference [A Guide for the Samvera Community](https://samvera.github.io/core_components.html) for further information._ +- [samvera-circleci-orb](./samvera-circleci-orb) - a [CircleCI Orb](https://circleci.com/orbs/) meant to make testing Samvera and Samvera-based projects easier. The orb provides executors that include common Samvera dependencies, and commands to help set up and run your tests. -Currently, there are twenty Samvera Core Components maintained by the community: +### Linting the Source Code Files +** Please note that Node.js release 16.13.0 or later is required to lint the source code files** -### Ruby Samvera Components +Using `npm`: +```bash +$ npx prettier -c . +# In order to attempt to automatically correct the source code files: +$ npx prettier -w . +``` -| Component | CircleCI Status | Ruby 3.1 Support | Ruby 3.0 Support | Ruby 2.7 Support | Ruby 2.6 Support | Rails 7.0 Support | Rails 6.1 Support | Rails 6.0 Support | Rails 5.2 Support | -| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| [active_fedora](https://github.com/samvera/active_fedora) | [![Build Status](https://circleci.com/gh/samvera/active_fedora.svg?style=svg)](https://circleci.com/gh/samvera/active_fedora) | | | 2.7.0 | 2.6.5 | | | 6.0.2 | 5.2.4 | -| [bixby](https://github.com/samvera/bixby) | [![Build Status](https://circleci.com/gh/samvera/bixby.svg?style=svg)](https://circleci.com/gh/samvera/bixby) | 3.1.1 | 3.0.3 | 2.7.5 | 2.6.9 | N/A | N/A | N/A | N/A | -| [browse-everything](https://github.com/samvera/browse-everything) | [![Build Status](https://circleci.com/gh/samvera/browse-everything.svg?style=svg)](https://circleci.com/gh/samvera/browse-everything) | | | 2.7.5 | 2.6.9 | | | 6.0.4.7 | 5.2.4 | -| [hydra-derivatives](https://github.com/samvera/hydra-derivatives) | [![Build Status](https://circleci.com/gh/samvera/hydra-derivatives.svg?style=svg)](https://circleci.com/gh/samvera/hydra-derivatives) | | | 2.7.5 | 2.6.9 | N/A | N/A | N/A | N/A | -| [hydra-editor](https://github.com/samvera/hydra-editor) | [![Build Status](https://circleci.com/gh/samvera/hydra-editor.svg?style=svg)](https://circleci.com/gh/samvera/hydra-editor) | | | 2.7.5 | 2.6.9 | | | 6.0.3.4 | 5.2.3 | -| [hydra-file_characterization](https://github.com/samvera/hydra-file_characterization) | [![Build Status](https://circleci.com/gh/samvera/hydra-file_characterization.svg?style=svg)](https://circleci.com/gh/samvera/hydra-file_characterization) | | 3.0.3 | 2.7.5 | 2.6.9 | 7.0.2.3 | 6.1.5 | 6.0.4.7 | 5.2.7 | -| [hydra-head](https://github.com/samvera/hydra-head) | [![Build Status](https://circleci.com/gh/samvera/hydra-head.svg?style=svg)](https://circleci.com/gh/samvera/hydra-head) | | | 2.7.3 | 2.6.7 | | | 6.0.3.7 | 5.2.6 | -| [hydra-pcdm](https://github.com/samvera/hydra-pcdm) | [![Build Status](https://circleci.com/gh/samvera/hydra-pcdm.svg?style=svg)](https://circleci.com/gh/samvera/hydra-pcdm) | | | 2.7.5 | 2.6.9 | | | 6.0.2 | 5.2.4 | -| [hydra-role-management](https://github.com/samvera/hydra-role-management) | [![Build Status](https://circleci.com/gh/samvera/hydra-role-management.svg?style=svg)](https://circleci.com/gh/samvera/hydra-role-management) | | | 2.7.5 | 2.6.9 | | | 6.0.2 | 5.2.4 | -| [hydra-works](https://github.com/samvera/hydra-works) | [![Build Status](https://circleci.com/gh/samvera/hydra-works.svg?style=svg)](https://circleci.com/gh/samvera/hydra-works) | | | 2.7.5 | 2.6.9 | | | 6.0.3.1 | 5.2.4.3 | [![Build Status](https://circleci.com/gh/samvera/hydra-works.svg?style=svg)](https://circleci.com/gh/samvera/hydra-works) | -| [iiif_manifest](https://github.com/samvera/iiif_manifest) | [![Build Status](https://circleci.com/gh/samvera/iiif_manifest.svg?style=svg)](https://circleci.com/gh/samvera/iiif_manifest) | | 3.0.3 | 2.7.5 | 2.6.9 | N/A | N/A | N/A | N/A | -| [ldp](https://github.com/samvera/ldp) | [![Build Status](https://circleci.com/gh/samvera/ldp.svg?style=svg)](https://circleci.com/gh/samvera/ldp) | | | 2.7.5 | 2.6.9 | | | 6.0.4.4 | 5.2.0 | -| [noid-rails](https://github.com/samvera/noid-rails) | [![Build Status](https://circleci.com/gh/samvera/noid-rails.svg?style=svg)](https://circleci.com/gh/samvera/noid-rails) | | | 2.7.5 | 2.6.9 | | 6.1.3.2 | 6.0.3.2 | 5.2.4.3 | -| [questioning_authority](https://github.com/samvera/questioning_authority) | [![Build Status](https://circleci.com/gh/samvera/questioning_authority.svg?style=svg)](https://circleci.com/gh/samvera/questioning_authority) | | | 2.7.5 | 2.6.9 | | 6.1.1 | 6.0.2 | 5.2.4 | -| [rubydora](https://github.com/samvera/rubydora) | [![Build Status](https://circleci.com/gh/samvera/rubydora.svg?style=svg)](https://circleci.com/gh/samvera/rubydora) | | | 2.7.5 | 2.6.9 | | | 6.0.2 | 5.2.4 | -| [samvera.github.io](https://github.com/samvera/samvera.github.io) | [![Build Status](https://circleci.com/gh/samvera/samvera.github.io.svg?style=svg)](https://circleci.com/gh/samvera/samvera.github.io) | 3.1.1 | 3.0.3 | 2.7.5 | 2.6.9 | N/A | N/A | N/A | N/A | -| [samvera-circleci-orb](https://github.com/samvera/samvera-circleci-orb) | [![Build Status](https://circleci.com/gh/samvera/samvera-circleci-orb.svg?style=svg)](https://circleci.com/gh/samvera/samvera-circleci-orb) | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | -| [valkyrie](https://github.com/samvera/valkyrie) | [![Build Status](https://circleci.com/gh/samvera/valkyrie.svg?style=svg)](https://circleci.com/gh/samvera/valkyrie) | | | 2.7.5 | 2.6.5 | | | 6.0.5 | 5.2.8 | +Using `yarn`: +```bash +$ yarn run prettier -w . +# In order to attempt to automatically correct the source code files: +$ yarn run prettier -w . +``` -### JavaScript Samvera Components +#### samvera-circle-orb +**Please note that Python release 3.10.0 or later is required to lint the samvera-circle-orb files** -| Component | CircleCI Status | Node.js 18.x Support | Node.js 16.x Support | Node.js 14.x Support | -| ------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | -------------------- | -------------------- | -------------------- | -| [node-iiif](https://github.com/samvera/node-iiif) | [![Build Status](https://circleci.com/gh/samvera/node-iiif.svg?style=svg)](https://circleci.com/gh/samvera/node-iiif) | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | -| [serverless-iiif](https://github.com/samvera/serverless-iiif) | [![Build Status](https://circleci.com/gh/samvera/serverless-iiif.svg?style=svg)](https://circleci.com/gh/samvera/serverless-iiif) | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | +```bash +$ pipenv sync +$ pipenv shell +$ pipenv run yamllint samvera-circleci-orb/src/ +``` ## Maintenance Documentation @@ -74,6 +66,45 @@ This template is something to push to all samvera repositories. The goal in applying a common mailmap is to help understand contributions as people move and change roles/functions/laptops. +## Samvera Core Components + +Samvera Core Components are defined as the following: + +> The primary Samvera code repository contains the Samvera community’s current consensus on what we are using, maintaining, and recommending. Ideally, this repository only contains code modules that are being actively used and maintained. + +_Please reference [A Guide for the Samvera Community](https://samvera.github.io/core_components.html) for further information._ + +Currently, there are twenty Samvera Core Components maintained by the community: + +### Ruby Samvera Components + +| Component | CircleCI Status | Ruby 3.1 Support | Ruby 3.0 Support | Ruby 2.7 Support | Ruby 2.6 Support | Rails 7.0 Support | Rails 6.1 Support | Rails 6.0 Support | Rails 5.2 Support | +| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | +| [active_fedora](https://github.com/samvera/active_fedora) | [![Build Status](https://circleci.com/gh/samvera/active_fedora.svg?style=svg)](https://circleci.com/gh/samvera/active_fedora) | | | 2.7.0 | 2.6.5 | | | 6.0.2 | 5.2.4 | +| [bixby](https://github.com/samvera/bixby) | [![Build Status](https://circleci.com/gh/samvera/bixby.svg?style=svg)](https://circleci.com/gh/samvera/bixby) | 3.1.1 | 3.0.3 | 2.7.5 | 2.6.9 | N/A | N/A | N/A | N/A | +| [browse-everything](https://github.com/samvera/browse-everything) | [![Build Status](https://circleci.com/gh/samvera/browse-everything.svg?style=svg)](https://circleci.com/gh/samvera/browse-everything) | | | 2.7.5 | 2.6.9 | | | 6.0.4.7 | 5.2.4 | +| [hydra-derivatives](https://github.com/samvera/hydra-derivatives) | [![Build Status](https://circleci.com/gh/samvera/hydra-derivatives.svg?style=svg)](https://circleci.com/gh/samvera/hydra-derivatives) | | | 2.7.5 | 2.6.9 | N/A | N/A | N/A | N/A | +| [hydra-editor](https://github.com/samvera/hydra-editor) | [![Build Status](https://circleci.com/gh/samvera/hydra-editor.svg?style=svg)](https://circleci.com/gh/samvera/hydra-editor) | | | 2.7.5 | 2.6.9 | | | 6.0.3.4 | 5.2.3 | +| [hydra-file_characterization](https://github.com/samvera/hydra-file_characterization) | [![Build Status](https://circleci.com/gh/samvera/hydra-file_characterization.svg?style=svg)](https://circleci.com/gh/samvera/hydra-file_characterization) | | 3.0.3 | 2.7.5 | 2.6.9 | 7.0.2.3 | 6.1.5 | 6.0.4.7 | 5.2.7 | +| [hydra-head](https://github.com/samvera/hydra-head) | [![Build Status](https://circleci.com/gh/samvera/hydra-head.svg?style=svg)](https://circleci.com/gh/samvera/hydra-head) | | | 2.7.3 | 2.6.7 | | | 6.0.3.7 | 5.2.6 | +| [hydra-pcdm](https://github.com/samvera/hydra-pcdm) | [![Build Status](https://circleci.com/gh/samvera/hydra-pcdm.svg?style=svg)](https://circleci.com/gh/samvera/hydra-pcdm) | | | 2.7.5 | 2.6.9 | | | 6.0.2 | 5.2.4 | +| [hydra-role-management](https://github.com/samvera/hydra-role-management) | [![Build Status](https://circleci.com/gh/samvera/hydra-role-management.svg?style=svg)](https://circleci.com/gh/samvera/hydra-role-management) | | | 2.7.5 | 2.6.9 | | | 6.0.2 | 5.2.4 | +| [hydra-works](https://github.com/samvera/hydra-works) | [![Build Status](https://circleci.com/gh/samvera/hydra-works.svg?style=svg)](https://circleci.com/gh/samvera/hydra-works) | | | 2.7.5 | 2.6.9 | | | 6.0.3.1 | 5.2.4.3 | [![Build Status](https://circleci.com/gh/samvera/hydra-works.svg?style=svg)](https://circleci.com/gh/samvera/hydra-works) | +| [iiif_manifest](https://github.com/samvera/iiif_manifest) | [![Build Status](https://circleci.com/gh/samvera/iiif_manifest.svg?style=svg)](https://circleci.com/gh/samvera/iiif_manifest) | | 3.0.3 | 2.7.5 | 2.6.9 | N/A | N/A | N/A | N/A | +| [ldp](https://github.com/samvera/ldp) | [![Build Status](https://circleci.com/gh/samvera/ldp.svg?style=svg)](https://circleci.com/gh/samvera/ldp) | | | 2.7.5 | 2.6.9 | | | 6.0.4.4 | 5.2.0 | +| [noid-rails](https://github.com/samvera/noid-rails) | [![Build Status](https://circleci.com/gh/samvera/noid-rails.svg?style=svg)](https://circleci.com/gh/samvera/noid-rails) | | | 2.7.5 | 2.6.9 | | 6.1.3.2 | 6.0.3.2 | 5.2.4.3 | +| [questioning_authority](https://github.com/samvera/questioning_authority) | [![Build Status](https://circleci.com/gh/samvera/questioning_authority.svg?style=svg)](https://circleci.com/gh/samvera/questioning_authority) | | | 2.7.5 | 2.6.9 | | 6.1.1 | 6.0.2 | 5.2.4 | +| [rubydora](https://github.com/samvera/rubydora) | [![Build Status](https://circleci.com/gh/samvera/rubydora.svg?style=svg)](https://circleci.com/gh/samvera/rubydora) | | | 2.7.5 | 2.6.9 | | | 6.0.2 | 5.2.4 | +| [samvera.github.io](https://github.com/samvera/samvera.github.io) | [![Build Status](https://circleci.com/gh/samvera/samvera.github.io.svg?style=svg)](https://circleci.com/gh/samvera/samvera.github.io) | 3.1.1 | 3.0.3 | 2.7.5 | 2.6.9 | N/A | N/A | N/A | N/A | +| [valkyrie](https://github.com/samvera/valkyrie) | [![Build Status](https://circleci.com/gh/samvera/valkyrie.svg?style=svg)](https://circleci.com/gh/samvera/valkyrie) | | | 2.7.5 | 2.6.5 | | | 6.0.5 | 5.2.8 | + +### JavaScript Samvera Components + +| Component | CircleCI Status | Node.js 18.x Support | Node.js 16.x Support | Node.js 14.x Support | +| ------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | -------------------- | -------------------- | -------------------- | +| [node-iiif](https://github.com/samvera/node-iiif) | [![Build Status](https://circleci.com/gh/samvera/node-iiif.svg?style=svg)](https://circleci.com/gh/samvera/node-iiif) | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | +| [serverless-iiif](https://github.com/samvera/serverless-iiif) | [![Build Status](https://circleci.com/gh/samvera/serverless-iiif.svg?style=svg)](https://circleci.com/gh/samvera/serverless-iiif) | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | + ## Ruby Scripts There exist Ruby scripts in this repository that can be used to propagate some of these templates. These are located within `ruby/scripts/`: diff --git a/samvera-circleci-orb/.gitignore b/samvera-circleci-orb/.gitignore new file mode 100644 index 0000000..69e5a99 --- /dev/null +++ b/samvera-circleci-orb/.gitignore @@ -0,0 +1 @@ +src/orb.yml diff --git a/samvera-circleci-orb/CODE_OF_CONDUCT.md b/samvera-circleci-orb/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..f584482 --- /dev/null +++ b/samvera-circleci-orb/CODE_OF_CONDUCT.md @@ -0,0 +1,36 @@ +The Samvera community is dedicated to providing a welcoming and +positive experience for all its members, whether they are at a formal +gathering, in a social setting, or taking part in activities online. +The Samvera community welcomes participation from people all over the +world and these members bring with them a wide variety of +professional, personal and social backgrounds; whatever these may be, +we treat colleagues with dignity and respect. + +Community members communicate primarily in English, though for many of +them this is not their native language. We therefore strive to express +ourselves simply and clearly remembering that unnecessary use of +jargon and slang will be a barrier to understanding for many of our +colleagues. We are sensitive to the fact that the international +nature of the community means that we span many different social norms +around language and behaviour and we strive to conduct ourselves, +online and in person, in ways that are unlikely to cause offence. + +Samvera conversations are often information-rich and intended to +generate discussion and debate. We discuss ideas from a standpoint of +mutual respect and reasoned argument. + +Community members work together to promote a respectful and safe +community. In the event that someone’s conduct is causing offence or +distress, Samvera has a detailed +[Anti-Harassment Policy and Protocol](https://wiki.lyrasis.org/display/samvera/Anti-Harassment+Policy) +which can be applied to address the problem. The first step in dealing +with any serious misconduct is to contact a local meeting organizer, +the +[Samvera community helpers](https://wiki.lyrasis.org/display/samvera/Samvera+Community+Helpers) +([email](mailto:helpers@samvera.org)), a community member you +trust, or the +[Samvera Steering Group](https://wiki.lyrasis.org/display/samvera/Samvera+Steering+Group+membership) +immediately; at Samvera events, these people can be identified by +distinctive name badges. The +[Policy and Protocol](https://wiki.lyrasis.org/display/samvera/Anti-Harassment+Policy) +should be consulted for fuller details. diff --git a/samvera-circleci-orb/CONTRIBUTING.md b/samvera-circleci-orb/CONTRIBUTING.md new file mode 100644 index 0000000..05492b6 --- /dev/null +++ b/samvera-circleci-orb/CONTRIBUTING.md @@ -0,0 +1,159 @@ +# How to Contribute + +We want your help to make the Samvera community great. There are a few guidelines +that we need contributors to follow so that we can have a chance of +keeping on top of things. + +## Code of Conduct + +The Samvera Community is dedicated to providing a welcoming and positive +experience for all its members, whether they are at a formal gathering, in +a social setting, or taking part in activities online. Please see our +[Code of Conduct](CODE_OF_CONDUCT.md) for more information. + +## Samvera Community Intellectual Property Licensing and Ownership + +All code contributors must have an Individual Contributor License Agreement +(iCLA) on file with the Samvera Steering Group. If the contributor works for +an institution, the institution must have a Corporate Contributor License +Agreement (cCLA) on file. + +https://wiki.lyrasis.org/display/samvera/Samvera+Community+Intellectual+Property+Licensing+and+Ownership + +You should also add yourself to the `CONTRIBUTORS.md` file in the root of the project. + +## Contribution Tasks + +- Reporting Issues +- Making Changes +- Documenting Code +- Committing Changes +- Submitting Changes +- Reviewing and Merging Changes + +### Reporting Issues + +- Make sure you have a [GitHub account](https://github.com/signup/free) +- Submit a [Github issue](https://github.com/samvera/samvera-circleci-orb/issues/) by: + - Clearly describing the issue + - Provide a descriptive summary + - Explain the expected behavior + - Explain the actual behavior + - Provide steps to reproduce the actual behavior + +### Making Changes + +- Fork the repository on GitHub +- Create a topic branch from where you want to base your work. + - This is usually the main branch. + - To quickly create a topic branch based on main; `git branch fix/main/my_contribution main` + - Then checkout the new branch with `git checkout fix/main/my_contribution`. + - Please avoid working directly on the `main` branch. + - You may find the [hub suite of commands](https://github.com/defunkt/hub) helpful +- Make sure you have added sufficient tests and documentation for your changes. +- Run _all_ the tests to assure nothing else was accidentally broken. + +### Documenting Code + +- All new public methods, modules, and classes should include inline documentation. + - Documentation should seek to answer the question "why does this code exist?" +- Document private / protected methods as desired. +- If you are working in a file with no prior documentation, do try to document as you gain understanding of the code. + - If you don't know exactly what a bit of code does, it is extra likely that it needs to be documented. Take a stab at it and ask for feedback in your pull request. You can use the 'blame' button on GitHub to identify the original developer of the code and @mention them in your comment. + - This work greatly increases the usability of the code base and supports the on-ramping of new committers. + - We will all be understanding of one another's time constraints in this area. + +### Committing changes + +- Make commits of logical units. +- Check for unnecessary whitespace with `git diff --check` before committing. +- Make sure your commit messages are [well formed](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html). +- If you created an issue, you can close it by including "Closes #issue" in your commit message. See [Github's blog post for more details](https://github.com/blog/1386-closing-issues-via-commit-messages) + +``` + Present tense short summary (50 characters or less) + + More detailed description, if necessary. It should be wrapped to 72 + characters. Try to be as descriptive as you can, even if you think that + the commit content is obvious, it may not be obvious to others. You + should add such description also if it's already present in bug tracker, + it should not be necessary to visit a webpage to check the history. + + Include Closes # when relavent. + + Description can have multiple paragraphs and you can use code examples + inside, just indent it with 4 spaces: + + class PostsController + def index + respond_to do |wants| + wants.html { render 'index' } + end + end + end + + You can also add bullet points: + + - you can use dashes or asterisks + + - also, try to indent next line of a point for readability, if it's too + long to fit in 72 characters +``` + +- Make sure you have added the necessary tests for your changes. +- Run _all_ the tests to assure nothing else was accidentally broken. +- When you are ready to submit a pull request + +### Submitting Changes + +- Read the article ["Using Pull Requests"](https://help.github.com/articles/using-pull-requests) on GitHub. +- Make sure your branch is up to date with its parent branch (i.e. main) + - `git checkout main` + - `git pull --rebase` + - `git checkout ` + - `git rebase main` + - It is a good idea to run your tests again. +- If you've made more than one commit take a moment to consider whether squashing commits together would help improve their logical grouping. + - [Detailed Walkthrough of One Pull Request per Commit](http://ndlib.github.io/practices/one-commit-per-pull-request/) + - `git rebase --interactive main` ([See Github help](https://help.github.com/articles/interactive-rebase)) + - Squashing your branch's changes into one commit is "good form" and helps the person merging your request to see everything that is going on. +- Push your changes to a topic branch in your fork of the repository. +- Submit a pull request from your fork to the project. + +### Reviewing and Merging Changes + +We adopted [Github's Pull Request Review](https://help.github.com/articles/about-pull-request-reviews/) for our repositories. +Common checks that may occur in our repositories: + +1. CircleCI - where our automated tests are running +2. Approval Required - Github enforces at least one person approve a pull request. Also, all reviewers that have chimed in must approve. + +If one or more of the required checks failed (or are incomplete), the code should not be merged (and the UI will not allow it). If all of the checks have passed, then anyone on the project (including the pull request submitter) may merge the code. + +_Example: Carolyn submits a pull request, Justin reviews the pull request and approves. However, Justin is still waiting on other checks (CircleCI is usually the culprit), so he does not merge the pull request. Eventually, all of the checks pass. At this point, Carolyn or anyone else may merge the pull request._ + +#### Things to Consider When Reviewing + +First, the person contributing the code is putting themselves out there. Be mindful of what you say in a review. + +- Ask clarifying questions +- State your understanding and expectations +- Provide example code or alternate solutions, and explain why + +This is your chance for a mentoring moment of another developer. Take time to give an honest and thorough review of what has changed. Things to consider: + +- Does the commit message explain what is going on? +- Does the code changes have tests? _Not all changes need new tests, some changes are refactorings_ +- Do new or changed methods, modules, and classes have documentation? +- Does the commit contain more than it should? Are two separate concerns being addressed in one commit? +- Does the description of the new/changed specs match your understanding of what the spec is doing? +- Did the Travis tests complete successfully? + +If you are uncertain, bring other contributors into the conversation by assigning them as a reviewer. + +# Additional Resources + +- [General GitHub documentation](http://help.github.com/) +- [GitHub pull request documentation](https://help.github.com/articles/about-pull-requests/) +- [Pro Git](http://git-scm.com/book) is both a free and excellent book about Git. +- [A Git Config for Contributing](http://ndlib.github.io/practices/my-typical-per-project-git-config/) diff --git a/samvera-circleci-orb/LICENSE b/samvera-circleci-orb/LICENSE new file mode 100644 index 0000000..6fb4e41 --- /dev/null +++ b/samvera-circleci-orb/LICENSE @@ -0,0 +1,205 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2012 Penn State University + Copyright 2013 University of Notre Dame, Northwestern University, and Data Curation Experts + Copyright 2014 Data Curation Experts + Additional copyright may be held by others, as reflected in the commit log + + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/samvera-circleci-orb/README.md b/samvera-circleci-orb/README.md new file mode 100644 index 0000000..2ae8ae0 --- /dev/null +++ b/samvera-circleci-orb/README.md @@ -0,0 +1,94 @@ +# Samvera CircleCI Orb + +Code: [![Samvera Core Component](https://img.shields.io/badge/samvera-core--component-brightgreen)](https://github.com/samvera/maintenance#samvera-core-components) +[![Build Status](https://circleci.com/gh/samvera/samvera-circleci-orb.svg?style=svg)](https://circleci.com/gh/samvera/samvera-circleci-orb) +[![Version](https://badges.circleci.com/orbs/samvera/circleci-orb.svg)](https://circleci.com/developer/orbs/orb/samvera/circleci-orb) + +Docs: [![Contribution Guidelines](http://img.shields.io/badge/CONTRIBUTING-Guidelines-blue.svg)](./CONTRIBUTING.md) +[![Apache 2.0 License](http://img.shields.io/badge/APACHE2-license-blue.svg)](./LICENSE) + +Community Support: [![Samvera Community Slack](https://img.shields.io/badge/samvera-slack-blueviolet)](http://slack.samvera.org/) + +# What is the CircleCI Orb? + +The Samvera CircleCI Orb is meant to make testing Samvera and Samvera-based projects easier. The orb provides executors that include common Samvera dependencies, and commands to help set up and run your tests. + +More information about orbs in general is available in [CircleCI's docs](https://circleci.com/docs/), +and up-to-date documentation about the Samvera orb exists on [the orb's CircleCI page](https://circleci.com/orbs/registry/orb/samvera/circleci-orb) + +## Help + +The Samvera community is here to help. Please see our [support guide](./SUPPORT.md). + +## Using the orb + +Since using the orb depends on Circle's configuration API, this section will attempt to point you to the latest +documentation rather than copying docs that may become outdated quickly. + +If you are not yet using CircleCI, please start with their [introduction documentation](https://circleci.com/docs/2.0/first-steps/) + +The canonical documentation for setting up the orb is in the [Quick Start Guide](https://circleci.com/orbs/registry/orb/samvera/circleci-orb) +on the orb's CircleCI page. + +Once you have finished with the Quick Start, the executors and commands will be available for use in your +config. The executors are named for the dependencies they include (ruby, ruby\_fcrepo\_solr, etc.), and the +commands are named and documented to avoid surprises. + +Circle has general information about [executors](https://circleci.com/docs/2.0/executor-intro/#section=configuration), +and [commands](https://circleci.com/docs/2.0/using-orbs/#commands) that may be useful as well. + +## Best practices + +The executors allow you to set parameters for the dependencies they use. For instance, you could have in +your parameters + +``` +solr_version: + type: string + default: '7-slim' +``` + +or in your build matrix: + +``` +ruby_type: 'ruby' +``` + +Different dependencies have different parameters, but all of them allow you to specify a version. You should do +this! The orb is permissive in the versions it allows, and may surprise you by upgrading when you least expect +it. + +Be prepared! Control your destiny! Specify versions! + +## Releasing new versions + +The orb will automatically publish two dev versions with every build that passes checks. +The first is always `dev:alpha`. Since this is not a unique identifier, this version may be quickly +overwritten. The other is `dev:`, where the SHA1 is the first seven characters of the commit hash +that was built. +Orb versions that begin with `dev:` can be overwritten by anyone, and only exist for 90 days. + +Additionally, publishing dev and production versions of the orb can be done manually: + +1. Install the CircleCI Client - + [https://circleci.com/docs/2.0/local-cli/#installation](https://circleci.com/docs/2.0/local-cli/#installation) +2. `circleci setup` (You'll need an API key) +3. `circleci config pack src > src/orb.yml` +4. `circleci orb validate src/orb.yml` +5. `circleci orb publish src/orb.yml samvera/circleci-orb@dev:alpha` +6. If Ready for permanent version bump: `circleci orb publish promote + samvera/circleci-orb@dev:alpha [major/minor/patch]` + +## Acknowledgments + +This software has been developed by and is brought to you by the Samvera community. Learn more at the [Samvera website](http://samvera.org/). + +![Samvera Logo](https://samvera.atlassian.net/wiki/download/attachments/1682341933/Samvera_logo_horizontal_200.png?api=v2) + +## Contributing + +Bug reports and pull requests are welcome on GitHub at https://github.com/samvera/samvera-circleci-orb/. + +If you're working on PR for this project, create a feature branch off of `main`. + +This repository follows the [Samvera Community Code of Conduct](https://samvera.atlassian.net/wiki/spaces/samvera/pages/405212316/Code+of+Conduct) and [language recommendations](https://github.com/samvera/maintenance/blob/master/templates/CONTRIBUTING.md#language). Please ***do not*** create a branch called `master` for this repository or as part of your pull request; the branch will either need to be removed or renamed before it can be considered for inclusion in the code base and history of this repository. diff --git a/samvera-circleci-orb/SUPPORT.md b/samvera-circleci-orb/SUPPORT.md new file mode 100644 index 0000000..db7c280 --- /dev/null +++ b/samvera-circleci-orb/SUPPORT.md @@ -0,0 +1,5 @@ +If you would like to report an issue, first search [the list of issues](https://github.com/samvera/samvera-circleci-orb/issues/) to see if someone else has already reported it, and then feel free to [create a new issue](https://github.com/samvera/samvera-circleci-orb/issues/new). + +If you have questions or need help, please email [the Samvera community tech list](https://groups.google.com/forum/#!forum/samvera-tech) or stop by the #dev channel in [the Samvera community Slack team](https://wiki.lyrasis.org/pages/viewpage.action?pageId=87460391#Getintouch!-Slack). + +You can learn more about the various Samvera communication channels on the [Get in touch!](https://wiki.lyrasis.org/pages/viewpage.action?pageId=87460391) wiki page. diff --git a/samvera-circleci-orb/src/@orb.yml b/samvera-circleci-orb/src/@orb.yml new file mode 100644 index 0000000..88cd02e --- /dev/null +++ b/samvera-circleci-orb/src/@orb.yml @@ -0,0 +1,9 @@ +--- +version: 2.1 + +description: | + The Samvera CircleCI Orb is meant to make testing Samvera and Samvera-based projects easier. + +display: + source_url: https://github.com/samvera/samvera-circleci-orb + home_url: https://samvera.org/ diff --git a/samvera-circleci-orb/src/commands/bundle.yml b/samvera-circleci-orb/src/commands/bundle.yml new file mode 100644 index 0000000..1b43ce9 --- /dev/null +++ b/samvera-circleci-orb/src/commands/bundle.yml @@ -0,0 +1,69 @@ +--- +description: Bundles and caches an app or gem. +parameters: + bundler_version: + type: string + default: "2.0.1" + ruby_version: + type: string + cache_version: + type: string + default: "1" +steps: + - run: + name: Generate a cache key for the bundle + # Let's break this command down step by step. + # `command : >` - YAML magic to concatenate the lines, stripping indentation equal to the next line. + # `find .` - To start, we're going to find things decending from the currect directory. + # `-path "*vendor/bundle" -prune -o` - Prevent find from searching the vendor/bundle directory. + # This helps with idempotentcy, as gems will be installed into vendor/bundle, and they have Gemfiles. + # `-path "*.git" -prune -o` - Prevent find from searching the .git directory. + # `-type f \( -name "Gemfile*" -o -name "*.gemspec" \)` - Match any file beginning with "Gemfile" or + # ending in ".gemspec". No, the '.' is not expanded like with regex. + # `-exec md5sum {} \+` - Execute md5sum on the files found. BUT! The '+' means call md5sum only once, + # with all the filenames one after another. + # `| sort -o "BUNDLE_CACHE_KEY"` - Send the output of the find command into sort, and write the output to a + # file named 'BUNDLE_CACHE_KEY'. The files will be sorted by their md5 rather than their name. + command: > + find . + -path "*vendor/bundle" -prune -o + -path "*.git" -prune -o + -type f \( -name "Gemfile*" -o -name "*.gemspec" \) + -exec md5sum {} \+ + | sort -o "BUNDLE_CACHE_KEY" + + - run: + name: Show contents of BUNDLE_CACHE_KEY + command: cat "BUNDLE_CACHE_KEY" + + - restore_cache: + name: Restore bundle from cache + keys: + - v<< parameters.cache_version >>-ruby<< parameters.ruby_version >>-bundler<< parameters.bundler_version >>-bundle{{ checksum "BUNDLE_CACHE_KEY" }} + - v<< parameters.cache_version >>-ruby<< parameters.ruby_version >>-bundler<< parameters.bundler_version >> + - v<< parameters.cache_version >>-ruby<< parameters.ruby_version >> + - v<< parameters.cache_version >> + + - run: + name: Update bundler + command: | + echo 'export BUNDLER_VERSION=<< parameters.bundler_version >>' >> $BASH_ENV + gem install bundler -v << parameters.bundler_version >> + + - run: + name: Install dependencies + command: bundle check || bundle install --jobs=4 --retry=3 + + - save_cache: + name: Save bundle cache + key: v<< parameters.cache_version >>-ruby<< parameters.ruby_version >>-bundler<< parameters.bundler_version >>-bundle{{ checksum "BUNDLE_CACHE_KEY" }} + paths: + - vendor/bundle + + - run: + name: List gems + command: bundle list > /tmp/gem_list.txt + + - store_artifacts: + path: /tmp/gem_list.txt + destination: bundle diff --git a/samvera-circleci-orb/src/commands/bundle_for_gem.yml b/samvera-circleci-orb/src/commands/bundle_for_gem.yml new file mode 100644 index 0000000..f626e62 --- /dev/null +++ b/samvera-circleci-orb/src/commands/bundle_for_gem.yml @@ -0,0 +1,38 @@ +--- +description: Bundles and caches a gem. +parameters: + bundler_version: + type: string + default: "2.0.1" + ruby_version: + type: string + project: + type: string + cache_version: + type: string + default: "1" +steps: + - run: + name: "[DEPRECATED] samvera/bundle_for_gem" + command: echo "This command is deprecated and will be removed in 1.0. Use samvera/bundle instead and remove the project parameter." + + - restore_cache: + name: Restore bundle from cache + keys: + - v<< parameters.cache_version >>-bundle-{{ checksum "Gemfile" }}--{{ checksum "<< parameters.project >>.gemspec" }}-<< parameters.ruby_version >> + + - run: + name: Update bundler + command: | + echo 'export BUNDLER_VERSION=<< parameters.bundler_version >>' >> $BASH_ENV + gem install bundler -v << parameters.bundler_version >> + + - run: + name: Install dependencies + command: bundle check || bundle install + + - save_cache: + name: Save bundle cache + key: v<< parameters.cache_version >>-bundle-{{ checksum "Gemfile" }}--{{ checksum "<< parameters.project >>.gemspec" }}-<< parameters.ruby_version >> + paths: + - ~/project/vendor/bundle diff --git a/samvera-circleci-orb/src/commands/cached_checkout.yml b/samvera-circleci-orb/src/commands/cached_checkout.yml new file mode 100644 index 0000000..1eff974 --- /dev/null +++ b/samvera-circleci-orb/src/commands/cached_checkout.yml @@ -0,0 +1,13 @@ +--- +description: Perform a cache-enabled git checkout. +steps: + - restore_cache: + name: Restore code from cache + keys: + - v1-source-{{ .Branch }}-{{ .Revision }} + - checkout + - save_cache: + name: Save code cache + key: v1-source-{{ .Branch }}-{{ .Revision }} + paths: + - ".git" diff --git a/samvera-circleci-orb/src/commands/engine_cart_generate.yml b/samvera-circleci-orb/src/commands/engine_cart_generate.yml new file mode 100644 index 0000000..2a4a6c3 --- /dev/null +++ b/samvera-circleci-orb/src/commands/engine_cart_generate.yml @@ -0,0 +1,21 @@ +--- +description: Use engine_cart to generate an internal test app and caches it. +parameters: + cache_key: + type: string +steps: + - restore_cache: + name: Restore test app from cache + keys: + - << parameters.cache_key >> + + - run: + name: Generate test app + command: | + [ -e ./.internal_test_app ] || bundle exec rake engine_cart:generate + + - save_cache: + name: Save test app cache + key: << parameters.cache_key >> + paths: + - ./.internal_test_app diff --git a/samvera-circleci-orb/src/commands/install_solr_active_fedora_core.yml b/samvera-circleci-orb/src/commands/install_solr_active_fedora_core.yml new file mode 100644 index 0000000..97c0d0d --- /dev/null +++ b/samvera-circleci-orb/src/commands/install_solr_active_fedora_core.yml @@ -0,0 +1,28 @@ +--- +description: Installs a solr core into a running Solr docker container. +parameters: + core_name: + type: string + default: "hydra-test" + solr_port: + type: string + default: "8985" +steps: + - run: + name: "[DEPRECATED] samvera/install_solr_active_fedora_core" + command: echo "This command is deprecated and will be removed in 1.0. Use samvera/install_solr_core instead." + - run: + name: Wait for Solr + command: dockerize -wait tcp://localhost:<< parameters.solr_port >> -timeout 1m + - run: + name: Load the default Solr config from the active-fedora Gem + command: | + if [ -d "$(bundle show active-fedora)/lib/generators/active_fedora/config/solr/templates/solr/conf" ] + then + cd "$(bundle show active-fedora)/lib/generators/active_fedora/config/solr/templates/solr/conf" + else + cd "$(bundle show active-fedora)/lib/generators/active_fedora/config/solr/templates/solr/config" + fi + zip -1 -r solr_conf.zip ./* + curl -H "Content-type:application/octet-stream" --data-binary @solr_conf.zip "http://localhost:<< parameters.solr_port >>/solr/admin/configs?action=UPLOAD&name=solrconfig" + curl -H 'Content-type: application/json' http://localhost:<< parameters.solr_port >>/api/collections/ -d '{create: {name: << parameters.core_name >>, config: solrconfig, numShards: 1}}' diff --git a/samvera-circleci-orb/src/commands/install_solr_core.yml b/samvera-circleci-orb/src/commands/install_solr_core.yml new file mode 100644 index 0000000..759ac0a --- /dev/null +++ b/samvera-circleci-orb/src/commands/install_solr_core.yml @@ -0,0 +1,33 @@ +--- +description: Installs a solr core into a running Solr docker container. +parameters: + core_name: + type: string + default: "hydra-test" + solr_port: + type: string + default: "8985" + solr_config_path: + type: string + default: "solr/config" +steps: + - run: + name: Wait for Solr + command: dockerize -wait tcp://localhost:<< parameters.solr_port >> -timeout 1m + - run: + name: Create solr core + command: | + if [ -d << parameters.solr_config_path >> ] + then + cd << parameters.solr_config_path >> + else + if [ -d "$(bundle show active-fedora)/lib/generators/active_fedora/config/solr/templates/solr/conf" ] + then + cd "$(bundle show active-fedora)/lib/generators/active_fedora/config/solr/templates/solr/conf" + else + cd "$(bundle show active-fedora)/lib/generators/active_fedora/config/solr/templates/solr/config" + fi + fi + zip -1 -r solr_conf.zip ./* + curl -H "Content-type:application/octet-stream" --data-binary @solr_conf.zip "http://solr:SolrRocks@127.0.0.1:<< parameters.solr_port >>/solr/admin/configs?action=UPLOAD&name=solrconfig" + curl -H 'Content-type: application/json' http://solr:SolrRocks@127.0.0.1:<< parameters.solr_port >>/api/collections/ -d '{create: {name: << parameters.core_name >>, config: solrconfig, numShards: 1}}' diff --git a/samvera-circleci-orb/src/commands/parallel_rspec.yml b/samvera-circleci-orb/src/commands/parallel_rspec.yml new file mode 100644 index 0000000..637810b --- /dev/null +++ b/samvera-circleci-orb/src/commands/parallel_rspec.yml @@ -0,0 +1,14 @@ +--- +description: Run RSpec in Parallel, storing test_results for CircleCI to parse. +steps: + - run: + name: Run rspec in parallel + command: | + mkdir /tmp/test-results + bundle exec rspec $(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings) + # collect reports + - store_test_results: + path: /tmp/test-results + - store_artifacts: + path: /tmp/test-results + destination: test-results diff --git a/samvera-circleci-orb/src/commands/rubocop.yml b/samvera-circleci-orb/src/commands/rubocop.yml new file mode 100644 index 0000000..3e6dcc8 --- /dev/null +++ b/samvera-circleci-orb/src/commands/rubocop.yml @@ -0,0 +1,22 @@ +--- +description: Runs rubocop +parameters: + cache_version: + type: string + default: "1" + +steps: + - restore_cache: + name: Restore rubocop cache + keys: + - v<< parameters.cache_version >>-rubocop-{{ .Environment.CIRCLE_BRANCH }} + - v<< parameters.cache_version >>-rubocop + - run: + name: Call Rubocop in parallel + command: bundle exec rubocop --parallel + + - save_cache: + name: Save rubocop cache + key: v<< parameters.cache_version >>-rubocop-{{ .Environment.CIRCLE_BRANCH }} + paths: + - ~/.cache diff --git a/samvera-circleci-orb/src/executors/ruby.yml b/samvera-circleci-orb/src/executors/ruby.yml new file mode 100644 index 0000000..663631a --- /dev/null +++ b/samvera-circleci-orb/src/executors/ruby.yml @@ -0,0 +1,18 @@ +--- +description: Box just Ruby +parameters: + ruby_type: + type: string + default: "ruby" + ruby_version: + type: string + default: "2.5.5" +docker: + - image: cimg/<< parameters.ruby_type >>:<< parameters.ruby_version >>-browsers +environment: + BUNDLE_PATH: vendor/bundle + BUNDLE_JOBS: 4 + BUNDLE_RETRY: 3 + RAILS_ENV: test + RACK_ENV: test + SPEC_OPTS: --profile 10 --format RspecJunitFormatter --out /tmp/test-results/rspec.xml --format progress diff --git a/samvera-circleci-orb/src/executors/ruby_fcrepo_solr.yml b/samvera-circleci-orb/src/executors/ruby_fcrepo_solr.yml new file mode 100644 index 0000000..1c34da4 --- /dev/null +++ b/samvera-circleci-orb/src/executors/ruby_fcrepo_solr.yml @@ -0,0 +1,37 @@ +--- +description: Box running FCRepo, Solr, and Ruby. +parameters: + fcrepo_version: + type: string + default: "4.7.5" + ruby_type: + type: string + default: "ruby" + ruby_version: + type: string + default: "2.5.5" + solr_port: + type: string + default: "8985" + solr_version: + type: string + default: "slim" +docker: + - image: cimg/<< parameters.ruby_type >>:<< parameters.ruby_version >>-browsers + - image: samvera/fcrepo4:<< parameters.fcrepo_version >> + environment: + CATALINA_OPTS: "-Djava.awt.headless=true -Dfile.encoding=UTF-8 -server -Xms512m -Xmx1024m -XX:NewSize=256m -XX:MaxNewSize=256m -XX:PermSize=256m -XX:MaxPermSize=256m -XX:+DisableExplicitGC" + - image: zookeeper:3.4 + - image: solr:<< parameters.solr_version >> + environment: + VERBOSE: yes + SECURITY_JSON: '{"authentication":{"blockUnknown": false, "class":"solr.BasicAuthPlugin", "credentials":{"solr":"IV0EHq1OnNrj6gvRCwvFwTrZ1+z1oBbnQdiVC3otuq0= Ndd7LKvVBAaZIF0QAVi1ekCfAJXr1GGfLtRUXhgrF8c="}, "realm":"My Solr users", "forwardCredentials": false}, "authorization":{ "class":"solr.RuleBasedAuthorizationPlugin", "permissions":[{"name":"security-edit", "role":"admin"}], "user-role":{"solr":"admin"}}}' + command: sh -c "server/scripts/cloud-scripts/zkcli.sh -zkhost localhost:2181 -cmd put /security.json \"${SECURITY_JSON}\" && solr-fg -cloud -noprompt -p << parameters.solr_port >> -z localhost:2181" +environment: + BUNDLE_PATH: vendor/bundle + BUNDLE_JOBS: 4 + BUNDLE_RETRY: 3 + RAILS_ENV: test + RACK_ENV: test + FCREPO_TEST_PORT: 8080 + SPEC_OPTS: --profile 10 --format RspecJunitFormatter --out /tmp/test-results/rspec.xml --format progress diff --git a/samvera-circleci-orb/src/executors/ruby_fcrepo_solr_redis.yml b/samvera-circleci-orb/src/executors/ruby_fcrepo_solr_redis.yml new file mode 100644 index 0000000..efbcc7b --- /dev/null +++ b/samvera-circleci-orb/src/executors/ruby_fcrepo_solr_redis.yml @@ -0,0 +1,41 @@ +--- +description: Box running FCRepo, Solr, Ruby, and Redis. +parameters: + fcrepo_version: + type: string + default: "4.7.5" + redis_version: + type: string + default: "6.2" + ruby_type: + type: string + default: "ruby" + ruby_version: + type: string + default: "2.5.5" + solr_port: + type: string + default: "8985" + solr_version: + type: string + default: "slim" +docker: + - image: cimg/<< parameters.ruby_type >>:<< parameters.ruby_version >>-browsers + - image: samvera/fcrepo4:<< parameters.fcrepo_version >> + environment: + CATALINA_OPTS: "-Djava.awt.headless=true -Dfile.encoding=UTF-8 -server -Xms512m -Xmx1024m -XX:NewSize=256m -XX:MaxNewSize=256m -XX:PermSize=256m -XX:MaxPermSize=256m -XX:+DisableExplicitGC" + - image: zookeeper:3.4 + - image: solr:<< parameters.solr_version >> + environment: + VERBOSE: yes + SECURITY_JSON: '{"authentication":{"blockUnknown": false, "class":"solr.BasicAuthPlugin", "credentials":{"solr":"IV0EHq1OnNrj6gvRCwvFwTrZ1+z1oBbnQdiVC3otuq0= Ndd7LKvVBAaZIF0QAVi1ekCfAJXr1GGfLtRUXhgrF8c="}, "realm":"My Solr users", "forwardCredentials": false}, "authorization":{ "class":"solr.RuleBasedAuthorizationPlugin", "permissions":[{"name":"security-edit", "role":"admin"}], "user-role":{"solr":"admin"}}}' + command: sh -c "server/scripts/cloud-scripts/zkcli.sh -zkhost localhost:2181 -cmd put /security.json \"${SECURITY_JSON}\" && solr-fg -cloud -noprompt -p << parameters.solr_port >> -z localhost:2181" + - image: redis:<< parameters.redis_version >> +environment: + BUNDLE_PATH: vendor/bundle + BUNDLE_JOBS: 4 + BUNDLE_RETRY: 3 + RAILS_ENV: test + RACK_ENV: test + FCREPO_TEST_PORT: 8080 + SPEC_OPTS: --profile 10 --format RspecJunitFormatter --out /tmp/test-results/rspec.xml --format progress diff --git a/samvera-circleci-orb/src/executors/ruby_fcrepo_solr_redis_postgres.yml b/samvera-circleci-orb/src/executors/ruby_fcrepo_solr_redis_postgres.yml new file mode 100644 index 0000000..0c09532 --- /dev/null +++ b/samvera-circleci-orb/src/executors/ruby_fcrepo_solr_redis_postgres.yml @@ -0,0 +1,48 @@ +--- +description: Box running FCRepo, Solr, Ruby, Redis, Postgres. +parameters: + fcrepo_version: + type: string + default: "4.7.5" + postgres_version: + type: string + default: "9.6" + redis_version: + type: string + default: "6.2" + ruby_type: + type: string + default: "ruby" + ruby_version: + type: string + default: "2.5.5" + solr_port: + type: string + default: "8985" + solr_version: + type: string + default: "slim" +docker: + - image: cimg/<< parameters.ruby_type >>:<< parameters.ruby_version >>-browsers + - image: samvera/fcrepo4:<< parameters.fcrepo_version >> + environment: + CATALINA_OPTS: "-Djava.awt.headless=true -Dfile.encoding=UTF-8 -server -Xms512m -Xmx1024m -XX:NewSize=256m -XX:MaxNewSize=256m -XX:PermSize=256m -XX:MaxPermSize=256m -XX:+DisableExplicitGC" + - image: zookeeper:3.4 + - image: solr:<< parameters.solr_version >> + environment: + VERBOSE: yes + SECURITY_JSON: '{"authentication":{"blockUnknown": false, "class":"solr.BasicAuthPlugin", "credentials":{"solr":"IV0EHq1OnNrj6gvRCwvFwTrZ1+z1oBbnQdiVC3otuq0= Ndd7LKvVBAaZIF0QAVi1ekCfAJXr1GGfLtRUXhgrF8c="}, "realm":"My Solr users", "forwardCredentials": false}, "authorization":{ "class":"solr.RuleBasedAuthorizationPlugin", "permissions":[{"name":"security-edit", "role":"admin"}], "user-role":{"solr":"admin"}}}' + command: sh -c "server/scripts/cloud-scripts/zkcli.sh -zkhost localhost:2181 -cmd put /security.json \"${SECURITY_JSON}\" && solr-fg -cloud -noprompt -p << parameters.solr_port >> -z localhost:2181" + - image: redis:<< parameters.redis_version >> + - image: cimg/postgres:<< parameters.postgres_version >> +environment: + BUNDLE_PATH: vendor/bundle + BUNDLE_JOBS: 4 + BUNDLE_RETRY: 3 + RAILS_ENV: test + RACK_ENV: test + FCREPO_TEST_PORT: 8080 + SPEC_OPTS: --profile 10 --format RspecJunitFormatter --out /tmp/test-results/rspec.xml --format progress + POSTGRES_DB: circle_test + POSTGRES_HOST: 127.0.0.1 + POSTGRES_USER: postgres