diff --git a/.circleci/config.yml b/.circleci/config.yml index d58d88d..3eeac2c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,72 +1,163 @@ version: 2.1 + +orbs: + slack: circleci/slack@4.8.3 + +ruby_container: &ruby_container + docker: + - image: ruby:3.1.1 + +slack_context: &slack_context + context: + - slack + +only_main: &only_main + filters: + branches: + only: + - main + +only_dependabot: &only_dependabot + filters: + branches: + only: + - /^dependabot.*/ + +only_main_and_dependabot: &only_main_and_dependabot + filters: + branches: + only: + - main + - /^dependabot.*/ + +commands: + notify: + steps: + - when: + condition: + matches: + pattern: "^dependabot.*" + value: << pipeline.git.branch >> + steps: + - slack/notify: + event: fail + channel: builds-dependabot + template: SLACK_FAILURE_NOTIFICATION + - slack/notify: + event: pass + channel: builds-dependabot + template: SLACK_SUCCESS_NOTIFICATION + - when: + condition: + matches: + pattern: "^(?!dependabot).*" + value: << pipeline.git.branch >> + steps: + - slack/notify: + event: fail + channel: dev + template: SLACK_FAILURE_NOTIFICATION + - slack/notify: + event: pass + channel: builds + template: SLACK_SUCCESS_NOTIFICATION + configure_build_tools: + steps: + - run: ./scripts/ci/common/install-openjdk.sh + configure_secrets_tools: + steps: + - run: ./scripts/ci/common/upgrade-gpg.sh + - run: ./scripts/ci/common/install-git-crypt.sh + - run: ./scripts/ci/common/install-gpg-key.sh + configure_release_tools: + steps: + - run: ./scripts/ci/common/configure-git.sh + - run: ./scripts/ci/common/configure-clojars.sh + jobs: build: - working_directory: ~/source - docker: - - image: ruby:3.1.1 + <<: *ruby_container steps: - checkout - - run: ./scripts/ci/common/install-openjdk.sh + - configure_build_tools - run: ./scripts/ci/steps/build.sh + - notify + test: + <<: *ruby_container working_directory: ~/source - docker: - - image: ruby:3.1.1 steps: - checkout - - run: ./scripts/ci/common/install-openjdk.sh + - configure_build_tools - run: ./scripts/ci/steps/test.sh + - notify + prerelease: - working_directory: ~/source - docker: - - image: ruby:3.1.1 + <<: *ruby_container steps: - checkout - - run: ./scripts/ci/common/install-openjdk.sh - - run: ./scripts/ci/common/upgrade-gpg.sh - - run: ./scripts/ci/common/install-git-crypt.sh - - run: ./scripts/ci/common/install-gpg-key.sh - - run: ./scripts/ci/common/configure-git.sh - - run: ./scripts/ci/common/configure-clojars.sh + - configure_build_tools + - configure_secrets_tools + - configure_release_tools - run: ./scripts/ci/steps/prerelease.sh + - notify + release: - working_directory: ~/source - docker: - - image: ruby:3.1.1 + <<: *ruby_container steps: - checkout - - run: ./scripts/ci/common/install-openjdk.sh - - run: ./scripts/ci/common/upgrade-gpg.sh - - run: ./scripts/ci/common/install-git-crypt.sh - - run: ./scripts/ci/common/install-gpg-key.sh - - run: ./scripts/ci/common/configure-git.sh - - run: ./scripts/ci/common/configure-clojars.sh + - configure_build_tools + - configure_secrets_tools + - configure_release_tools - run: ./scripts/ci/steps/release.sh + - notify + + merge_pull_request: + <<: *ruby_container + steps: + - checkout + - configure_build_tools + - configure_secrets_tools + - run: ./scripts/ci/steps/merge-pull-request.sh + - notify workflows: version: 2 pipeline: jobs: - - build + - build: + <<: *only_main_and_dependabot + <<: *slack_context - test: + <<: *only_main_and_dependabot + <<: *slack_context requires: - build + - merge_pull_request: + <<: *only_dependabot + <<: *slack_context + requires: + - test - prerelease: + <<: *only_main + <<: *slack_context requires: - test - filters: - branches: - only: main + - slack/on-hold: + <<: *only_main + <<: *slack_context + requires: + - prerelease + channel: release + template: SLACK_ON_HOLD_NOTIFICATION - hold: + <<: *only_main type: approval requires: - prerelease - filters: - branches: - only: main + - slack/on-hold - release: + <<: *only_main + <<: *slack_context requires: - hold - filters: - branches: - only: main diff --git a/.envrc b/.envrc index 5ef182b..258e286 100644 --- a/.envrc +++ b/.envrc @@ -4,3 +4,9 @@ PROJECT_DIR="$(pwd)" PATH_add "${PROJECT_DIR}" PATH_add "${PROJECT_DIR}"/vendor/**/bin + +if has asdf; then + asdf install +fi + +layout ruby diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..ec870f4 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,7 @@ +version: 2 + +updates: + - package-ecosystem: "bundler" + directory: "/" + schedule: + interval: "daily" diff --git a/.gitignore b/.gitignore index 124acdf..e13b3c2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,22 +1,42 @@ -/target -/classes -/checkouts +# vim +*.swp +*.swo + +# IntelliJ +.idea/ +*.ipr +*.iml +*.iws + +# Build +vendor/ +build/ +dist/ +target/ +classes/ +checkouts/ +run/ +.bundle +.rakeTasks +.direnv + +# OS +.DS_Store + +# Clojure profiles.clj +.eastwood pom.xml pom.xml.asc *.jar *.class -/.lein-* -/.nrepl-port -/run -.hgignore -.bundle -.hg/ -*.iml -*.iws -*.ipr -.DS_Store -/vendor -.eastwood -/.idea -lsp/ \ No newline at end of file +.lein-*/ +lsp/ +.nrepl-port + +# Temporary +run/pids/ +run/logs/ +*.log +.tmp + diff --git a/.lein-failures b/.lein-failures new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/.lein-failures @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/.tool-versions b/.tool-versions new file mode 100644 index 0000000..f0a4ccd --- /dev/null +++ b/.tool-versions @@ -0,0 +1,2 @@ +ruby 3.1.1 +java temurin-11.0.20+101 diff --git a/Gemfile.lock b/Gemfile.lock index 3bd0182..52b5bb0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,17 +1,24 @@ GEM remote: https://rubygems.org/ specs: - activesupport (7.0.5) + activesupport (7.1.1) + base64 + bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) + connection_pool (>= 2.2.5) + drb i18n (>= 1.6, < 2) minitest (>= 5.1) + mutex_m tzinfo (~> 2.0) - addressable (2.8.4) + addressable (2.8.5) public_suffix (>= 2.0.2, < 6.0) ast (2.4.2) aws-eventstream (1.2.0) - aws-sigv4 (1.5.2) + aws-sigv4 (1.6.1) aws-eventstream (~> 1, >= 1.0.2) + base64 (0.2.0) + bigdecimal (3.1.4) colored2 (3.1.2) concurrent-ruby (1.2.2) confidante (0.28.0) @@ -19,13 +26,17 @@ GEM hiera (~> 3.3) shikashi (~> 0.6) vault (~> 0.17) + connection_pool (2.4.1) down (5.4.1) addressable (~> 2.8) + drb (2.2.0) + ruby2_keywords evalhook (0.6.0) partialruby (~> 0.3) sexp_processor (~> 4.0) - excon (0.100.0) - faraday (2.7.6) + excon (0.104.0) + faraday (2.7.11) + base64 faraday-net_http (>= 2.0, < 3.1) ruby2_keywords (>= 0.0.4) faraday-net_http (3.0.2) @@ -40,26 +51,28 @@ GEM concurrent-ruby (~> 1.0) immutable-struct (2.4.1) json (2.6.3) + language_server-protocol (3.17.0.3) lino (3.1.0) hamster (~> 3.0) open4 (~> 1.3) minitar (0.9) - minitest (5.18.0) - octokit (6.1.1) + minitest (5.20.0) + mutex_m (0.2.0) + octokit (8.0.0) faraday (>= 1, < 3) sawyer (~> 0.9) open4 (1.3.4) parallel (1.23.0) - parser (3.2.2.3) + parser (3.2.2.4) ast (~> 2.4.1) racc partialruby (0.3.0) ruby2ruby (~> 2) ruby_parser (~> 3) - public_suffix (5.0.1) - racc (1.7.0) + public_suffix (5.0.3) + racc (1.7.3) rainbow (3.1.1) - rake (13.0.6) + rake (13.1.0) rake_circle_ci (0.11.0) colored2 (~> 3.1) excon (~> 0.72) @@ -74,18 +87,18 @@ GEM rake_factory (0.32.0.pre.2) activesupport (>= 4) rake (~> 13.0) - rake_git (0.1.0.pre.7) + rake_git (0.1.0.pre.10) colored2 (~> 3.1) git (~> 1.13, >= 1.13.2) rake_factory (= 0.32.0.pre.2) - rake_git_crypt (0.1.0.pre.26) + rake_git_crypt (0.1.0.pre.29) colored2 (~> 3.1) rake_factory (= 0.32.0.pre.2) - ruby_git_crypt (= 0.1.0.pre.2) + ruby_git_crypt (= 0.1.0.pre.4) ruby_gpg2 (~> 0.6) - rake_github (0.11.0) + rake_github (0.13.0) colored2 (~> 3.1) - octokit (>= 4.16, < 7.0) + octokit (>= 4.16, < 9.0) rake_factory (~> 0.23) sshkey (~> 2.0) rake_gpg (0.18.0) @@ -101,28 +114,29 @@ GEM rake_factory (~> 0.23) sshkey (~> 2.0) rchardet (1.8.0) - regexp_parser (2.8.1) - rexml (3.2.5) - rubocop (1.52.0) + regexp_parser (2.8.2) + rexml (3.2.6) + rubocop (1.57.2) json (~> 2.3) + language_server-protocol (>= 3.17.0) parallel (~> 1.10) - parser (>= 3.2.0.0) + parser (>= 3.2.2.4) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.28.0, < 2.0) + rubocop-ast (>= 1.28.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.29.0) + rubocop-ast (1.30.0) parser (>= 3.2.1.0) - rubocop-capybara (2.18.0) + rubocop-capybara (2.19.0) rubocop (~> 1.41) - rubocop-factory_bot (2.23.1) + rubocop-factory_bot (2.24.0) rubocop (~> 1.33) rubocop-rake (0.6.0) rubocop (~> 1.0) - rubocop-rspec (2.22.0) - rubocop (~> 1.33) + rubocop-rspec (2.25.0) + rubocop (~> 1.40) rubocop-capybara (~> 2.17) rubocop-factory_bot (~> 2.22) ruby-progressbar (1.13.0) @@ -130,7 +144,7 @@ GEM ruby2ruby (2.5.0) ruby_parser (~> 3.1) sexp_processor (~> 4.6) - ruby_git_crypt (0.1.0.pre.2) + ruby_git_crypt (0.1.0.pre.4) immutable-struct (~> 2.4) lino (~> 3.0) ruby_gpg2 (0.10.0) @@ -138,7 +152,7 @@ GEM ruby_leiningen (0.25.0) activesupport (>= 6.0.2, < 8) lino (~> 3.0) - ruby_parser (3.20.2) + ruby_parser (3.20.3) sexp_processor (~> 4.16) rubyzip (2.3.2) sawyer (0.9.2) @@ -152,8 +166,8 @@ GEM sshkey (2.0.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - unicode-display_width (2.4.2) - vault (0.17.0) + unicode-display_width (2.5.0) + vault (0.18.1) aws-sigv4 PLATFORMS @@ -174,4 +188,4 @@ DEPENDENCIES rubocop-rspec BUNDLED WITH - 2.1.4 + 2.4.21 diff --git a/Rakefile b/Rakefile index 731f973..e0081e0 100644 --- a/Rakefile +++ b/Rakefile @@ -158,7 +158,6 @@ end namespace :pipeline do desc 'Prepare CircleCI Pipeline' task prepare: %i[ - circle_ci:project:follow circle_ci:env_vars:ensure circle_ci:checkout_keys:ensure circle_ci:ssh_keys:ensure diff --git a/config/gpg/jonas.gpg.public b/config/gpg/jonas.gpg.public index a97a256..c6e62bc 100644 --- a/config/gpg/jonas.gpg.public +++ b/config/gpg/jonas.gpg.public @@ -9,33 +9,52 @@ YZ7zHGAI/2GK49ILhhiYnpZjCvnQ70sdVmn7blpRztzJ2ZEPL/St6R/kc9retVUb 5FBLuCR3fcoePxvnw2Fyxi9zI8UpMsssfP5rEv/QFaArQAe3mX0mwUYd3G5zb1+7 eAH35teCT1/Ys4X/foozBjOpMD9wrcybyNkU9vU99AcxSU8MFx4t1JnatU6+D7ld slYWYZHmWMqgFm0AEQEAAbQhSm9uYXMgU3ZhbGluIDxqb25hc0Bnby1hdG9taWMu -aW8+iQHUBBMBCAA+AhsDBQsJCAcCBhUKCQgLAgQWAgMBAh4BAheAFiEE0WSmHGni -PA90R1++X/52rQlfygcFAmRBL8gFCQeMok0ACgkQX/52rQlfygfN9AwAnIc0SjA/ -fTzfpHgjWtTOx/K63k6hLnlOzr0el2nInLnPwjeUD/kTd4BmwIQaFOPymw1s1Fzo -ZZi6mnZCI5Mh6hn9x9+iWmkTiQ87Q82Svaqd80Wdqgp3/rAr0AS5YHPrj8OtRZ58 -Zn6ikkJN72iQ86YI+g7voDJnVSanfYnef5SAPdo6RghVj5CwCRxJSqWWeelyi5Eg -tsy3Rz1ujX7+8MfxKXJV2lWYg7mkliotMnd4kqkEDY2fKVowOHekKyF1iQgKTxP1 -F7nqw1i56Ec/PH9Z8y6Bsmctv+Ot3Igrvs7WFNS7+PVznJfqeHJkyW4+x1lw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YVE1jdHQRws+RYiI2GN +Rb54kkE9q5Bic8IcaVOf+stxdY785oXFd8pIideOVA== +=e5EY -----END PGP PUBLIC KEY BLOCK----- \ No newline at end of file diff --git a/go b/go index 8d08e65..96ad26a 100755 --- a/go +++ b/go @@ -3,11 +3,11 @@ [ -n "$GO_DEBUG" ] && set -x set -e -project_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +project_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" verbose="no" -skip_checks="no" offline="no" +skip_checks="no" missing_dependency="no" @@ -15,42 +15,56 @@ missing_dependency="no" [ -n "$GO_SKIP_CHECKS" ] && skip_checks="yes" [ -n "$GO_OFFLINE" ] && offline="yes" +function loose_version() { + local version="$1" + + IFS="." read -r -a version_parts <<<"$version" + + echo "${version_parts[0]}.${version_parts[1]}" +} -if [[ "$skip_checks" = "no" ]]; then - echo "Checking for system dependencies." - ruby_version="$(cat "$project_dir"/.ruby-version)" - if ! type ruby >/dev/null 2>&1 || ! ruby -v | grep -q "$ruby_version"; then - echo "This codebase requires Ruby $ruby_version." - missing_dependency="yes" - fi +ruby_full_version="$(cat "$project_dir"/.ruby-version)" +ruby_loose_version="$(loose_version "$ruby_full_version")" - if [[ "$missing_dependency" = "yes" ]]; then - echo "Please install missing dependencies to continue." - exit 1 - fi +if [[ "$skip_checks" == "no" ]]; then +echo "Checking for system dependencies." + if ! type ruby >/dev/null 2>&1 || ! ruby -v | grep -q "$ruby_loose_version"; then + echo "This codebase requires Ruby $ruby_loose_version." + missing_dependency="yes" + fi - echo "All system dependencies present. Continuing." + if ! type bundler >/dev/null 2>&1; then + echo "This codebase requires Bundler." + missing_dependency="yes" + fi + + if [[ "$missing_dependency" = "yes" ]]; then + echo "Please install missing dependencies to continue." + exit 1 + fi + + echo "All system dependencies present. Continuing." fi -if [[ "$offline" = "no" ]]; then - echo "Installing bundler." - if [[ "$verbose" = "yes" ]]; then - gem install --no-document bundler - else - gem install --no-document bundler --silent - fi - - echo "Installing ruby dependencies." - if [[ "$verbose" = "yes" ]]; then - bundle install - else - bundle install --quiet - fi +if [[ "$offline" == "no" ]]; then + echo "Installing bundler." + if [[ "$verbose" == "yes" ]]; then + gem install --no-document bundler + else + gem install --no-document bundler >/dev/null + fi + + echo "Installing ruby dependencies." + if [[ "$verbose" == "yes" ]]; then + bundle install + else + bundle install >/dev/null + fi fi echo "Starting rake." -if [[ "$verbose" = "yes" ]]; then - time bundle exec rake --verbose "$@" +if [[ "$verbose" == "yes" ]]; then + time bundle exec rake --verbose "$@" else - time bundle exec rake "$@" + time bundle exec rake "$@" fi diff --git a/scripts/ci/steps/merge-pull-request.sh b/scripts/ci/steps/merge-pull-request.sh new file mode 100755 index 0000000..63be3b1 --- /dev/null +++ b/scripts/ci/steps/merge-pull-request.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +[ -n "$DEBUG" ] && set -x +set -e +set -o pipefail + +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +PROJECT_DIR="$( cd "$SCRIPT_DIR/../../.." && pwd )" + +cd "$PROJECT_DIR" + +git-crypt unlock + +CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD) + +./go github:pull_requests:merge["$CURRENT_BRANCH","%s [skip ci]"]