diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..4d3c6fa --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,40 @@ +name: Test + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +permissions: + contents: read + +jobs: + kitchen: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + platform: [ "default-debian-11", "default-debian-12", "default-ubuntu-2204" ] + recipe: [ "binary", "source" ] + variant: [ "core" ] + steps: + - uses: actions/checkout@v4 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: 3.1 + bundler-cache: true # runs 'bundle install' and caches installed gems automatically + - name: Run Test Kitchen platform ${{ matrix.platform }} + run: env KITCHEN_RECIPE=${{ matrix.recipe }} KITCHEN_VARIANT=${{ matrix.variant }} bundle exec rake kitchen:${{ matrix.platform }} + style: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: 3.1 + bundler-cache: true # runs 'bundle install' and caches installed gems automatically + - name: Run style checks + run: bundle exec rake style:ruby diff --git a/.kitchen.yml b/.kitchen.yml index 656a925..9c0a05b 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -1,21 +1,39 @@ --- driver: - name: docker + name: dokken + privileged: true # allows systemd services to start + chef_image: cincproject/cinc + chef_version: <%= ENV.fetch('CHEF_VERSION', 18) %> provisioner: - name: chef_zero - product_name: chef - product_version: <%= ENV["CHEF_VERSION"] || '14' %> + name: dokken + product_name: cinc + chef_binary: /opt/cinc/bin/cinc-client + deprecations_as_errors: true + multiple_converge: 2 + +transport: + name: dokken + +verifier: + name: inspec platforms: - - name: <%= ENV["KITCHEN_PLATFORM"] %> - driver_config: - use_sudo: false + # @see https://github.com/chef-cookbooks/testing_examples/blob/main/kitchen.dokken.yml + # @see https://hub.docker.com/u/dokken + - name: debian-12 + driver: + image: dokken/debian-12 + pid_one_command: /bin/systemd + intermediate_instructions: + - RUN /usr/bin/apt-get update + - RUN /usr/bin/apt-get upgrade -y + - RUN /usr/bin/apt-get purge exim4* -y suites: - name: default run_list: - - recipe[bitcoin::<%= ENV["KITCHEN_RECIPE"] %>] + - recipe[bitcoin::<%= ENV.fetch('KITCHEN_RECIPE', 'binary') %>] attributes: bitcoin: - variant: <%= ENV["KITCHEN_VARIANT"] %> + variant: <%= ENV.fetch('KITCHEN_VARIANT', 'core') %> diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 643dbee..0000000 --- a/.travis.yml +++ /dev/null @@ -1,34 +0,0 @@ -language: ruby -sudo: required -services: - - docker -before_install: - - gem update --system - - gem install bundler -rvm: 2.7.0 -matrix: - exclude: - - rvm: 2.7.0 - include: - - rvm: ruby-head - env: BUNDLE_WITHOUT=test - - rvm: 2.6.5 - env: BUNDLE_WITHOUT=test - - - env: KITCHEN_PLATFORM=debian KITCHEN_RECIPE=binary KITCHEN_VARIANT=abc - - env: KITCHEN_PLATFORM=debian KITCHEN_RECIPE=binary KITCHEN_VARIANT=bucash - - env: KITCHEN_PLATFORM=debian KITCHEN_RECIPE=binary KITCHEN_VARIANT=core - - env: KITCHEN_PLATFORM=debian KITCHEN_RECIPE=binary KITCHEN_VARIANT=unlimited - - env: KITCHEN_PLATFORM=debian KITCHEN_RECIPE=source KITCHEN_VARIANT=abc - - env: KITCHEN_PLATFORM=debian KITCHEN_RECIPE=source KITCHEN_VARIANT=bucash - - env: KITCHEN_PLATFORM=debian KITCHEN_RECIPE=source KITCHEN_VARIANT=core - - env: KITCHEN_PLATFORM=debian KITCHEN_RECIPE=source KITCHEN_VARIANT=unlimited - - - env: KITCHEN_PLATFORM=debian KITCHEN_RECIPE=source KITCHEN_VARIANT=abc CHEF_VERSION=13.12 - - env: KITCHEN_PLATFORM=debian KITCHEN_RECIPE=source KITCHEN_VARIANT=bucash CHEF_VERSION=13.12 - - env: KITCHEN_PLATFORM=debian KITCHEN_RECIPE=source KITCHEN_VARIANT=core CHEF_VERSION=13.12 - - env: KITCHEN_PLATFORM=debian KITCHEN_RECIPE=source KITCHEN_VARIANT=unlimited CHEF_VERSION=13.12 - allow_failures: - - rvm: ruby-head -script: - - travis_wait 30 bundle exec rake diff --git a/Gemfile b/Gemfile index 663dc27..50ebf07 100644 --- a/Gemfile +++ b/Gemfile @@ -1,17 +1,11 @@ source 'https://rubygems.org' -group :development do - gem 'berkshelf' - gem 'chef', '~> 14' - gem 'rake' -end - -group :style do - gem 'cookstyle' - gem 'foodcritic' -end +gem 'rake' group :test do - gem 'kitchen-docker' + gem 'berkshelf' # needed by test-kitchen + gem 'cookstyle' + gem 'kitchen-dokken' + gem 'kitchen-inspec' gem 'test-kitchen' end diff --git a/Gemfile.lock b/Gemfile.lock index 8df1dfc..a047fcf 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,10 +1,276 @@ GEM remote: https://rubygems.org/ specs: - addressable (2.8.4) + activesupport (7.1.3.3) + 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.6) public_suffix (>= 2.0.2, < 6.0) ast (2.4.2) - bcrypt_pbkdf (1.1.0) + aws-eventstream (1.3.0) + aws-partitions (1.863.0) + aws-sdk-accessanalyzer (1.44.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-account (1.20.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-alexaforbusiness (1.67.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-amplify (1.54.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-apigateway (1.90.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-apigatewayv2 (1.53.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-applicationautoscaling (1.79.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-athena (1.79.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-autoscaling (1.102.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-batch (1.79.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-budgets (1.62.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-cloudformation (1.97.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-cloudfront (1.86.1) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-cloudhsm (1.50.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-cloudhsmv2 (1.53.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-cloudtrail (1.74.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-cloudwatch (1.83.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-cloudwatchevents (1.69.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-cloudwatchlogs (1.77.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-codecommit (1.62.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-codedeploy (1.62.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-codepipeline (1.67.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-cognitoidentity (1.51.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-cognitoidentityprovider (1.85.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-configservice (1.103.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-core (3.190.3) + aws-eventstream (~> 1, >= 1.3.0) + aws-partitions (~> 1, >= 1.651.0) + aws-sigv4 (~> 1.8) + jmespath (~> 1, >= 1.6.1) + aws-sdk-costandusagereportservice (1.53.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-databasemigrationservice (1.91.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-dynamodb (1.98.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-ec2 (1.429.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-ecr (1.68.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-ecrpublic (1.25.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-ecs (1.135.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-efs (1.71.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-eks (1.95.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-elasticache (1.95.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-elasticbeanstalk (1.63.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-elasticloadbalancing (1.51.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-elasticloadbalancingv2 (1.96.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-elasticsearchservice (1.79.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-emr (1.81.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-eventbridge (1.54.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-firehose (1.60.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-glue (1.165.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-guardduty (1.85.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-iam (1.92.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-kafka (1.67.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-kinesis (1.54.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-kms (1.76.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-lambda (1.113.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-macie2 (1.64.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-mq (1.58.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-networkfirewall (1.39.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-networkmanager (1.40.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-organizations (1.83.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-ram (1.52.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-rds (1.208.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-redshift (1.107.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-route53 (1.83.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-route53domains (1.54.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-route53resolver (1.51.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-s3 (1.141.0) + aws-sdk-core (~> 3, >= 3.189.0) + aws-sdk-kms (~> 1) + aws-sigv4 (~> 1.8) + aws-sdk-s3control (1.74.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-secretsmanager (1.87.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-securityhub (1.98.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-servicecatalog (1.90.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-ses (1.58.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-shield (1.60.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-signer (1.50.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-simpledb (1.42.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv2 (~> 1.0) + aws-sdk-sms (1.52.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-sns (1.70.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-sqs (1.69.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-ssm (1.162.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-states (1.63.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-synthetics (1.39.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-transfer (1.86.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-waf (1.58.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-wafv2 (1.74.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sigv2 (1.2.0) + aws-sigv4 (1.8.0) + aws-eventstream (~> 1, >= 1.0.2) + azure_graph_rbac (0.17.2) + ms_rest_azure (~> 0.12.0) + azure_mgmt_key_vault (0.17.7) + ms_rest_azure (~> 0.12.0) + azure_mgmt_resources (0.18.2) + ms_rest_azure (~> 0.12.0) + azure_mgmt_security (0.19.0) + ms_rest_azure (~> 0.12.0) + azure_mgmt_storage (0.23.0) + ms_rest_azure (~> 0.12.0) + base64 (0.2.0) + bcrypt_pbkdf (1.1.1) berkshelf (7.0.10) chef (>= 13.6.52) chef-config @@ -18,6 +284,7 @@ GEM retryable (>= 2.0, < 4.0) solve (~> 4.0) thor (>= 0.20) + bigdecimal (3.1.8) builder (3.2.4) chef (14.14.29) addressable @@ -55,7 +322,10 @@ GEM mixlib-config (>= 2.2.12, < 4.0) mixlib-shellout (>= 2.0, < 4.0) tomlrb (~> 1.2) - chef-utils (18.2.7) + chef-telemetry (1.1.1) + chef-config + concurrent-ruby (~> 1.0) + chef-utils (18.4.12) concurrent-ruby chef-zero (15.0.11) ffi-yajl (~> 2.2) @@ -65,28 +335,64 @@ GEM uuidtools (~> 2.1) webrick cleanroom (1.0.0) - concurrent-ruby (1.2.2) - cookstyle (7.32.2) + coderay (1.1.3) + concurrent-ruby (1.3.1) + connection_pool (2.4.1) + cookstyle (7.32.8) rubocop (= 1.25.1) - diff-lcs (1.5.0) + declarative (0.0.20) + diff-lcs (1.5.1) + docker-api (2.2.0) + excon (>= 0.47.0) + multi_json + domain_name (0.6.20240107) + drb (2.2.1) ed25519 (1.3.0) erubi (1.12.0) erubis (2.7.0) - faraday (2.7.4) - faraday-net_http (>= 2.0, < 3.1) + excon (0.110.0) + faraday (1.3.1) + faraday-net_http (~> 1.0) + multipart-post (>= 1.2, < 3) ruby2_keywords (>= 0.0.4) - faraday-net_http (3.0.2) - ffi (1.15.5) - ffi-yajl (2.4.0) + faraday-cookie_jar (0.0.7) + faraday (>= 0.8.0) + http-cookie (~> 1.0.0) + faraday-net_http (1.0.1) + faraday_middleware (1.0.0) + faraday (~> 1.0) + ffi (1.16.3) + ffi-yajl (2.6.0) libyajl2 (>= 1.2) - foodcritic (16.3.0) - erubis - ffi-yajl (~> 2.0) - nokogiri (>= 1.5, < 2.0) - rake - rufus-lru (~> 1.0) - treetop (~> 1.4) fuzzyurl (0.9.0) + google-apis-admin_directory_v1 (0.46.0) + google-apis-core (>= 0.11.0, < 2.a) + google-apis-cloudkms_v1 (0.41.0) + google-apis-core (>= 0.11.0, < 2.a) + google-apis-cloudresourcemanager_v1 (0.35.0) + google-apis-core (>= 0.11.0, < 2.a) + google-apis-compute_v1 (0.83.0) + google-apis-core (>= 0.11.0, < 2.a) + google-apis-core (0.11.3) + addressable (~> 2.5, >= 2.5.1) + googleauth (>= 0.16.2, < 2.a) + httpclient (>= 2.8.1, < 3.a) + mini_mime (~> 1.0) + representable (~> 3.0) + retriable (>= 2.0, < 4.a) + rexml + google-apis-iam_v1 (0.50.0) + google-apis-core (>= 0.11.0, < 2.a) + google-apis-monitoring_v3 (0.51.0) + google-apis-core (>= 0.11.0, < 2.a) + google-apis-storage_v1 (0.30.0) + google-apis-core (>= 0.11.0, < 2.a) + googleauth (1.8.1) + faraday (>= 0.17.3, < 3.a) + jwt (>= 1.4, < 3.0) + multi_json (~> 1.11) + os (>= 0.9, < 2.0) + signet (>= 0.16, < 2.a) gssapi (1.3.1) ffi (>= 1.0.1) gyoku (1.4.0) @@ -94,11 +400,55 @@ GEM rexml (~> 3.0) hashie (4.1.0) highline (1.7.10) + http-cookie (1.0.5) + domain_name (~> 0.5) httpclient (2.8.3) + i18n (1.14.5) + concurrent-ruby (~> 1.0) + inifile (3.0.0) iniparse (1.5.0) + inspec (4.24.32) + faraday_middleware (>= 0.12.2, < 1.1) + inspec-core (= 4.24.32) + train (~> 3.0) + train-aws (~> 0.1) + train-habitat (~> 0.1) + train-winrm (~> 0.2) + inspec-core (4.24.32) + addressable (~> 2.4) + chef-telemetry (~> 1.0) + faraday (>= 0.9.0, < 1.4) + hashie (>= 3.4, < 5.0) + license-acceptance (>= 0.2.13, < 3.0) + method_source (>= 0.8, < 2.0) + mixlib-log (~> 3.0) + multipart-post (~> 2.0) + parallel (~> 1.9) + parslet (>= 1.5, < 3.0) + pry (~> 0.13) + rspec (~> 3.10) + rspec-its (~> 1.2) + rubyzip (>= 1.2.2, < 3.0) + semverse (~> 3.0) + sslshake (~> 1.2) + thor (>= 0.20, < 2.0) + tomlrb (>= 1.2, < 2.1) + train-core (~> 3.0) + tty-prompt (~> 0.17) + tty-table (~> 0.10) ipaddress (0.8.3) - kitchen-docker (2.13.0) - test-kitchen (>= 1.0.0) + jmespath (1.6.2) + json (2.7.2) + jwt (2.8.1) + base64 + kitchen-dokken (2.20.4) + docker-api (>= 1.33, < 3) + lockfile (~> 2.1) + test-kitchen (>= 1.15, < 4) + kitchen-inspec (2.6.2) + hashie (>= 3.4, <= 5.0) + inspec (>= 2.2.64, < 6.0) + test-kitchen (>= 2.7, < 4) libyajl2 (2.1.0) license-acceptance (2.1.13) pastel (~> 0.7) @@ -106,18 +456,21 @@ GEM tty-box (~> 0.6) tty-prompt (~> 0.20) little-plugger (1.1.4) + lockfile (2.1.3) logging (2.3.1) little-plugger (~> 1.1) multi_json (~> 1.14) - mini_portile2 (2.8.1) + method_source (1.1.0) + mini_mime (1.1.5) minitar (0.9) + minitest (5.23.1) mixlib-archive (1.1.7) mixlib-log mixlib-authentication (2.1.1) mixlib-cli (2.1.8) mixlib-config (3.0.27) tomlrb - mixlib-install (3.12.27) + mixlib-install (3.12.30) mixlib-shellout mixlib-versioning thor @@ -126,7 +479,18 @@ GEM chef-utils mixlib-versioning (1.2.12) molinillo (0.8.0) + ms_rest (0.7.6) + concurrent-ruby (~> 1.0) + faraday (>= 0.9, < 2.0.0) + timeliness (~> 0.3.10) + ms_rest_azure (0.12.0) + concurrent-ruby (~> 1.0) + faraday (>= 0.9, < 2.0.0) + faraday-cookie_jar (~> 0.0.6) + ms_rest (~> 0.7.6) multi_json (1.15.0) + multipart-post (2.4.1) + mutex_m (0.2.0) net-scp (4.0.0) net-ssh (>= 2.6.5, < 8.0.0) net-sftp (2.1.2) @@ -137,11 +501,9 @@ GEM net-ssh-multi (1.2.1) net-ssh (>= 2.6.5) net-ssh-gateway (>= 1.2.0) - net-telnet (0.1.1) - nokogiri (1.14.3) - mini_portile2 (~> 2.8.0) - racc (~> 1.4) - nori (2.6.0) + net-telnet (0.2.0) + nori (2.7.0) + bigdecimal octokit (4.25.1) faraday (>= 1, < 3) sawyer (~> 0.9) @@ -157,38 +519,49 @@ GEM plist (~> 3.1) systemu (~> 2.6.4) wmi-lite (~> 1.0) - parallel (1.22.1) - parser (3.2.2.0) + os (1.1.4) + parallel (1.24.0) + parser (3.3.1.0) ast (~> 2.4.1) + racc + parslet (2.0.0) pastel (0.8.0) tty-color (~> 0.5) - plist (3.7.0) - polyglot (0.3.5) + plist (3.7.1) proxifier (1.0.3) - public_suffix (5.0.1) - racc (1.6.2) - rack (2.2.6.4) + pry (0.14.2) + coderay (~> 1.1) + method_source (~> 1.0) + public_suffix (5.0.5) + racc (1.8.0) + rack (2.2.9) rainbow (3.1.1) - rake (13.0.6) - regexp_parser (2.7.0) + rake (13.2.1) + regexp_parser (2.9.2) + representable (3.2.0) + declarative (< 0.1.0) + trailblazer-option (>= 0.1.1, < 0.2.0) + uber (< 0.2.0) + retriable (3.1.2) retryable (3.0.5) - rexml (3.2.5) - rspec (3.12.0) - rspec-core (~> 3.12.0) - rspec-expectations (~> 3.12.0) - rspec-mocks (~> 3.12.0) - rspec-core (3.12.1) - rspec-support (~> 3.12.0) - rspec-expectations (3.12.2) + rexml (3.2.8) + strscan (>= 3.0.9) + rspec (3.13.0) + rspec-core (~> 3.13.0) + rspec-expectations (~> 3.13.0) + rspec-mocks (~> 3.13.0) + rspec-core (3.13.0) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) + rspec-support (~> 3.13.0) rspec-its (1.3.0) rspec-core (>= 3.0.0) rspec-expectations (>= 3.0.0) - rspec-mocks (3.12.5) + rspec-mocks (3.13.1) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-support (3.12.0) + rspec-support (~> 3.13.0) + rspec-support (3.13.1) rspec_junit_formatter (0.2.3) builder (< 4) rspec-core (>= 2, < 4, != 2.12.0) @@ -201,39 +574,45 @@ GEM rubocop-ast (>= 1.15.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.28.0) - parser (>= 3.2.1.0) + rubocop-ast (1.31.3) + parser (>= 3.3.1.0) ruby-progressbar (1.13.0) ruby2_keywords (0.0.5) rubyntlm (0.6.3) rubyzip (2.3.2) - rufus-lru (1.1.0) sawyer (0.9.2) addressable (>= 2.3.5) faraday (>= 0.17.3, < 3) semverse (3.0.2) - serverspec (2.42.2) + serverspec (2.42.3) multi_json rspec (~> 3.0) rspec-its specinfra (~> 2.72) sfl (2.3) + signet (0.19.0) + addressable (~> 2.8) + faraday (>= 0.17.5, < 3.a) + jwt (>= 1.5, < 3.0) + multi_json (~> 1.10) solve (4.0.4) molinillo (~> 0.6) semverse (>= 1.1, < 4.0) - specinfra (2.85.0) + specinfra (2.89.0) net-scp net-ssh (>= 2.7) - net-telnet (= 0.1.1) + net-telnet sfl + sslshake (1.3.1) strings (0.2.1) strings-ansi (~> 0.2) unicode-display_width (>= 1.5, < 3.0) unicode_utils (~> 1.4) strings-ansi (0.2.0) + strscan (3.1.0) syslog-logger (1.6.8) systemu (2.6.5) - test-kitchen (3.5.0) + test-kitchen (3.6.0) bcrypt_pbkdf (~> 1.0) chef-utils (>= 16.4.35) ed25519 (~> 1.2) @@ -247,10 +626,122 @@ GEM winrm (~> 2.0) winrm-elevated (~> 1.0) winrm-fs (~> 1.1) - thor (1.2.1) + thor (1.3.1) + timeliness (0.3.10) tomlrb (1.3.0) - treetop (1.6.12) - polyglot (~> 0.3) + trailblazer-option (0.1.2) + train (3.12.3) + activesupport (>= 6.0.3.1) + azure_graph_rbac (~> 0.16) + azure_mgmt_key_vault (~> 0.17) + azure_mgmt_resources (~> 0.15) + azure_mgmt_security (~> 0.18) + azure_mgmt_storage (~> 0.18) + docker-api (>= 1.26, < 3.0) + google-apis-admin_directory_v1 (~> 0.46.0) + google-apis-cloudkms_v1 (~> 0.41.0) + google-apis-cloudresourcemanager_v1 (~> 0.35.0) + google-apis-compute_v1 (~> 0.83.0) + google-apis-iam_v1 (~> 0.50.0) + google-apis-monitoring_v3 (~> 0.51.0) + google-apis-storage_v1 (~> 0.30.0) + googleauth (>= 0.16.2, < 1.9.0) + inifile (~> 3.0) + train-core (= 3.12.3) + train-winrm (~> 0.2) + train-aws (0.2.41) + aws-partitions (~> 1.863.0) + aws-sdk-accessanalyzer (~> 1.44.0) + aws-sdk-account (~> 1.20.0) + aws-sdk-alexaforbusiness (~> 1.67.0) + aws-sdk-amplify (~> 1.54.0) + aws-sdk-apigateway (~> 1.90.0) + aws-sdk-apigatewayv2 (~> 1.53.0) + aws-sdk-applicationautoscaling (~> 1.79.0) + aws-sdk-athena (>= 1.78, < 1.80) + aws-sdk-autoscaling (= 1.102.0) + aws-sdk-batch (~> 1.79.0) + aws-sdk-budgets (~> 1.62.0) + aws-sdk-cloudformation (>= 1.96, < 1.98) + aws-sdk-cloudfront (~> 1.86.0) + aws-sdk-cloudhsm (~> 1.50.0) + aws-sdk-cloudhsmv2 (~> 1.53.0) + aws-sdk-cloudtrail (~> 1.74.0) + aws-sdk-cloudwatch (~> 1.83.0) + aws-sdk-cloudwatchevents (~> 1.69.0) + aws-sdk-cloudwatchlogs (~> 1.75) + aws-sdk-codecommit (~> 1.62.0) + aws-sdk-codedeploy (~> 1.62.0) + aws-sdk-codepipeline (~> 1.67.0) + aws-sdk-cognitoidentity (~> 1.51.0) + aws-sdk-cognitoidentityprovider (~> 1.84) + aws-sdk-configservice (~> 1.103.0) + aws-sdk-core (~> 3.190.0) + aws-sdk-costandusagereportservice (~> 1.53.0) + aws-sdk-databasemigrationservice (~> 1.91.0) + aws-sdk-dynamodb (~> 1.98.0) + aws-sdk-ec2 (>= 1.427, < 1.430) + aws-sdk-ecr (~> 1.68.0) + aws-sdk-ecrpublic (~> 1.25.0) + aws-sdk-ecs (~> 1.135.0) + aws-sdk-efs (~> 1.71.0) + aws-sdk-eks (~> 1.95.0) + aws-sdk-elasticache (~> 1.95.0) + aws-sdk-elasticbeanstalk (~> 1.63.0) + aws-sdk-elasticloadbalancing (~> 1.51.0) + aws-sdk-elasticloadbalancingv2 (~> 1.96.0) + aws-sdk-elasticsearchservice (~> 1.79.0) + aws-sdk-emr (~> 1.81.0) + aws-sdk-eventbridge (~> 1.54.0) + aws-sdk-firehose (~> 1.60.0) + aws-sdk-glue (~> 1.164) + aws-sdk-guardduty (~> 1.85.0) + aws-sdk-iam (~> 1.92.0) + aws-sdk-kafka (~> 1.67.0) + aws-sdk-kinesis (~> 1.54.0) + aws-sdk-kms (~> 1.74) + aws-sdk-lambda (~> 1.113.0) + aws-sdk-macie2 (~> 1.64.0) + aws-sdk-mq (~> 1.58.0) + aws-sdk-networkfirewall (~> 1.39.0) + aws-sdk-networkmanager (~> 1.40.0) + aws-sdk-organizations (~> 1.83.0) + aws-sdk-ram (~> 1.52.0) + aws-sdk-rds (~> 1.208.0) + aws-sdk-redshift (~> 1.107.0) + aws-sdk-route53 (~> 1.83.0) + aws-sdk-route53domains (~> 1.54.0) + aws-sdk-route53resolver (~> 1.51.0) + aws-sdk-s3 (~> 1.141.0) + aws-sdk-s3control (~> 1.74.0) + aws-sdk-secretsmanager (~> 1.87.0) + aws-sdk-securityhub (~> 1.98.0) + aws-sdk-servicecatalog (~> 1.90.0) + aws-sdk-ses (~> 1.58.0) + aws-sdk-shield (~> 1.60.0) + aws-sdk-signer (~> 1.50.0) + aws-sdk-simpledb (~> 1.42.0) + aws-sdk-sms (~> 1.52.0) + aws-sdk-sns (~> 1.70.0) + aws-sdk-sqs (~> 1.69.0) + aws-sdk-ssm (~> 1.162.0) + aws-sdk-states (~> 1.63.0) + aws-sdk-synthetics (~> 1.39.0) + aws-sdk-transfer (~> 1.86.0) + aws-sdk-waf (~> 1.58.0) + aws-sdk-wafv2 (~> 1.74.0) + train-core (3.12.3) + addressable (~> 2.5) + ffi (!= 1.13.0) + json (>= 1.8, < 3.0) + mixlib-shellout (>= 2.0, < 4.0) + net-scp (>= 1.2, < 5.0) + net-ssh (>= 2.9, < 8.0) + train-habitat (0.2.22) + train-winrm (0.2.13) + winrm (>= 2.3.6, < 3.0) + winrm-elevated (~> 1.2.2) + winrm-fs (~> 1.0) tty-box (0.7.0) pastel (~> 0.8) strings (~> 0.2.0) @@ -264,8 +755,15 @@ GEM tty-cursor (~> 0.7) tty-screen (~> 0.8) wisper (~> 2.0) - tty-screen (0.8.1) - unicode-display_width (2.4.2) + tty-screen (0.8.2) + tty-table (0.12.0) + pastel (~> 0.8) + strings (~> 0.2.0) + tty-screen (~> 0.8) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + uber (0.1.0) + unicode-display_width (2.5.0) unicode_utils (1.4.0) uuidtools (2.1.5) webrick (1.8.1) @@ -291,16 +789,15 @@ GEM wmi-lite (1.0.7) PLATFORMS - ruby + x86_64-linux DEPENDENCIES berkshelf - chef (~> 14) cookstyle - foodcritic - kitchen-docker + kitchen-dokken + kitchen-inspec rake test-kitchen BUNDLED WITH - 2.4.10 + 2.5.10 diff --git a/Rakefile b/Rakefile index 204c8ff..53a8fd2 100644 --- a/Rakefile +++ b/Rakefile @@ -8,21 +8,12 @@ namespace :style do task.options << '--extra-details' task.options << '--display-style-guide' end - - desc 'Run Chef style checks' - require 'foodcritic' - FoodCritic::Rake::LintTask.new(:chef) do |task| - task.options[:fail_tags] = ['any'] - end end desc 'Run all style checks' -task 'style:all' => ['style:ruby', 'style:chef'] +task 'style:all' => ['style:ruby'] -if ENV['KITCHEN_PLATFORM'] - require 'kitchen/rake_tasks' - Kitchen::RakeTasks.new - task default: ['style:all', 'kitchen:all'] -else - task default: ['style:all'] -end +require 'kitchen/rake_tasks' +Kitchen::RakeTasks.new + +task default: %w(kitchen:all style:all) diff --git a/attributes/default.rb b/attributes/default.rb index 58f60db..b17425e 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -5,7 +5,7 @@ # common settings -default['bitcoin']['variant'] = nil # possible variants: abc, bucash, core, unlimited, xt +default['bitcoin']['variant'] = 'core' # possible variants: core default['bitcoin']['binary_name'] = 'bitcoind' default['bitcoin']['binary_cli_name'] = 'bitcoin-cli' @@ -24,18 +24,9 @@ # 'binary' recipe -default['bitcoin']['binary']['version']['core'] = '0.18.1' -default['bitcoin']['binary']['version']['unlimited'] = '1.0.3.0' -default['bitcoin']['binary']['version']['bucash'] = '1.6.0.1' -default['bitcoin']['binary']['version']['abc'] = '0.20.0' -default['bitcoin']['binary']['url']['core'] = "https://bitcoin.org/bin/bitcoin-core-#{node['bitcoin']['binary']['version']['core']}/bitcoin-#{node['bitcoin']['binary']['version']['core']}-x86_64-linux-gnu.tar.gz" -default['bitcoin']['binary']['url']['unlimited'] = "https://www.bitcoinunlimited.info/downloads/bitcoinUnlimited-#{node['bitcoin']['binary']['version']['unlimited']}-linux64.tar.gz" -default['bitcoin']['binary']['url']['bucash'] = "https://www.bitcoinunlimited.info/downloads/BUcash-#{node['bitcoin']['binary']['version']['bucash']}-linux64.tar.gz" -default['bitcoin']['binary']['url']['abc'] = "https://download.bitcoinabc.org/#{node['bitcoin']['binary']['version']['abc']}/linux/bitcoin-abc-#{node['bitcoin']['binary']['version']['abc']}-x86_64-linux-gnu.tar.gz" -default['bitcoin']['binary']['checksum']['core'] = '600d1db5e751fa85903e935a01a74f5cc57e1e7473c15fd3e17ed21e202cfe5a' -default['bitcoin']['binary']['checksum']['unlimited'] = 'a6658bac22f082539969a243943c7d1a865abd40cdfe39465ff82b4eba387b22' -default['bitcoin']['binary']['checksum']['bucash'] = '68023e6faefe7cfee8eee6cffb6200f52d47aa89c305323d97063664b514c94c' -default['bitcoin']['binary']['checksum']['abc'] = 'c00afe0f23163a64b692f9633ab0f49af7eedde32aa7b768582a0a731bb6d013' +default['bitcoin']['binary']['version']['core'] = '27.0' +default['bitcoin']['binary']['url']['core'] = "https://bitcoincore.org/bin/bitcoin-core-#{node['bitcoin']['binary']['version']['core']}/bitcoin-#{node['bitcoin']['binary']['version']['core']}-x86_64-linux-gnu.tar.gz" +default['bitcoin']['binary']['checksum']['core'] = '2a6974c5486f528793c79d42694b5987401e4a43c97f62b1383abf35bcee44a8' # 'package' recipe @@ -46,18 +37,9 @@ # 'source' recipe -default['bitcoin']['source']['version']['core'] = 'v0.18.1' -default['bitcoin']['source']['version']['unlimited'] = '1.0.1.3' -default['bitcoin']['source']['version']['bucash'] = '1.6.0.1' -default['bitcoin']['source']['version']['abc'] = '0.20.0' +default['bitcoin']['source']['version']['core'] = '27.0' default['bitcoin']['source']['url']['core'] = "https://github.com/bitcoin/bitcoin/archive/#{node['bitcoin']['source']['version']['core']}.tar.gz" -default['bitcoin']['source']['url']['unlimited'] = "https://github.com/BitcoinUnlimited/BitcoinUnlimited/archive/#{node['bitcoin']['source']['version']['unlimited']}.tar.gz" -default['bitcoin']['source']['url']['bucash'] = "https://github.com/BitcoinUnlimited/BitcoinUnlimited/archive/bucash#{node['bitcoin']['source']['version']['bucash']}.tar.gz" -default['bitcoin']['source']['url']['abc'] = "https://github.com/Bitcoin-ABC/bitcoin-abc/archive/v#{node['bitcoin']['source']['version']['abc']}.tar.gz" -default['bitcoin']['source']['checksum']['core'] = '5c7d93f15579e37aa2d1dc79e8f5ac675f59045fceddf604ae0f1550eb03bf96' -default['bitcoin']['source']['checksum']['unlimited'] = '50e9f948ef27d583cd411bf0925da40ee55a515ce3c7745404f6aa1de6503c06' -default['bitcoin']['source']['checksum']['bucash'] = '329f2bbe508d3dddb62fda284f33b42e346ef9ba1e1eb09924d592c98d7adc23' -default['bitcoin']['source']['checksum']['abc'] = '5a26a8ae8c1cdb4769e4277335733782a6b9bce97af54e1bffeac489c68f3975' +default['bitcoin']['source']['checksum']['core'] = '9c1ee651d3b157baccc3388be28b8cf3bfcefcd2493b943725ad6040ca6b146b' default['bitcoin']['source']['dependencies']['debian'] = %w( build-essential libtool autoconf pkg-config libssl-dev libevent-dev libboost-system-dev libboost-filesystem-dev libboost-chrono-dev diff --git a/metadata.rb b/metadata.rb index 320c75d..48fe31c 100644 --- a/metadata.rb +++ b/metadata.rb @@ -6,10 +6,9 @@ source_url 'https://github.com/infertux/chef-bitcoin' issues_url 'https://github.com/infertux/chef-bitcoin/issues' -version '1.8.0' -chef_version '>= 13.3' +version '2.0.0' +chef_version '>= 18' -supports 'debian' -supports 'ubuntu' -supports 'centos' +supports 'debian', '>= 11.0' supports 'freebsd' +supports 'ubuntu', '>= 22.04' diff --git a/templates/default/bitcoin.conf.erb b/templates/default/bitcoin.conf.erb index 99c1fe0..a15a3e8 100644 --- a/templates/default/bitcoin.conf.erb +++ b/templates/default/bitcoin.conf.erb @@ -2,12 +2,8 @@ server=1 checkblocks=<%= node['bitcoin']['checkblocks'] %> rpcbind=127.0.0.1 rpcallowip=127.0.0.1 -txindex=1 # needed for ElectrumX server +txindex=1 # needed for ElectrumX/Fulcrum server par=-1 -<% if %w(abc core xt).include?(node['bitcoin']['variant']) %> -sendfreetransactions=1 -mempoolreplacement=0 # no RBF -<% end %> dbcache=500 # set if you have 4+ GiB RAM #maxconnections=50 # set to limit bandwidth usage #prune=20000 # set if you have low disk space (in MB) diff --git a/test/integration/default/bats/bitcoin_installed.bats b/test/integration/default/bats/bitcoin_installed.bats deleted file mode 100644 index 6b254bf..0000000 --- a/test/integration/default/bats/bitcoin_installed.bats +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bats - -@test "bitcoind binary is found in PATH" { - run which bitcoind - [ "$status" -eq 0 ] -} - -@test "bitcoin-cli binary is found in PATH" { - run which bitcoin-cli - [ "$status" -eq 0 ] -} diff --git a/test/integration/default/bitcoin_spec.rb b/test/integration/default/bitcoin_spec.rb new file mode 100644 index 0000000..9b5eb2e --- /dev/null +++ b/test/integration/default/bitcoin_spec.rb @@ -0,0 +1,4 @@ +describe command('sudo -u bitcoin -- bitcoin-cli -version') do + its('exit_status') { should eq 0 } + its('stdout') { should include "Bitcoin Core RPC client" } +end