From e20d09d65b0b9a4dc020cb6ca703862218ab7e8d Mon Sep 17 00:00:00 2001 From: Phil Helm Date: Fri, 10 Jul 2026 09:17:12 +0100 Subject: [PATCH] migrate pipeline from circleci to github actions --- .circleci/config.yml | 183 ------------------ {.circleci => .github}/gpg.private.enc | Bin .github/workflows/main.yaml | 149 ++++++++++++++ .github/workflows/pr.yaml | 66 +++++++ Gemfile.lock | 43 ++-- README.md | 8 +- Rakefile | 88 +++++---- config/secrets/ci/ssh.private | Bin 3269 -> 0 bytes config/secrets/ci/ssh.public | Bin 773 -> 0 bytes config/secrets/circle_ci/config.yaml | Bin 120 -> 0 bytes ruby_terraform.gemspec | 3 +- scripts/ci/common/configure-asdf.sh | 18 -- scripts/ci/common/configure-git.sh | 8 - scripts/ci/common/configure-rubygems.sh | 16 -- .../ci/common/install-asdf-dependencies.sh | 12 -- scripts/ci/common/install-asdf.sh | 19 -- scripts/ci/common/install-git-crypt.sh | 8 - scripts/ci/common/install-gpg-key.sh | 19 -- scripts/ci/common/install-slack-deps.sh | 8 - scripts/ci/steps/build.sh | 12 -- scripts/ci/steps/merge-pull-request.sh | 16 -- scripts/ci/steps/prerelease.sh | 16 -- scripts/ci/steps/release.sh | 19 -- scripts/ci/steps/test.sh | 12 -- 24 files changed, 286 insertions(+), 437 deletions(-) delete mode 100644 .circleci/config.yml rename {.circleci => .github}/gpg.private.enc (100%) create mode 100644 .github/workflows/main.yaml create mode 100644 .github/workflows/pr.yaml delete mode 100644 config/secrets/ci/ssh.private delete mode 100644 config/secrets/ci/ssh.public delete mode 100644 config/secrets/circle_ci/config.yaml delete mode 100755 scripts/ci/common/configure-asdf.sh delete mode 100755 scripts/ci/common/configure-git.sh delete mode 100755 scripts/ci/common/configure-rubygems.sh delete mode 100755 scripts/ci/common/install-asdf-dependencies.sh delete mode 100755 scripts/ci/common/install-asdf.sh delete mode 100755 scripts/ci/common/install-git-crypt.sh delete mode 100755 scripts/ci/common/install-gpg-key.sh delete mode 100755 scripts/ci/common/install-slack-deps.sh delete mode 100755 scripts/ci/steps/build.sh delete mode 100755 scripts/ci/steps/merge-pull-request.sh delete mode 100755 scripts/ci/steps/prerelease.sh delete mode 100755 scripts/ci/steps/release.sh delete mode 100755 scripts/ci/steps/test.sh diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 2817a92f..00000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,183 +0,0 @@ -version: 2.1 - -orbs: - slack: circleci/slack@4.13.2 - -base_container: &base_container - image: buildpack-deps:bookworm - -build_container: &build_container - resource_class: arm.medium - docker: - - <<: *base_container - -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-slack-deps.sh - - restore_cache: - keys: - - asdf-dependencies-{{ arch }}-v2-{{ checksum ".tool-versions" }} - - asdf-dependencies-{{ arch }}-v2- - - run: ./scripts/ci/common/install-asdf.sh - - run: ./scripts/ci/common/configure-asdf.sh - - run: ./scripts/ci/common/install-asdf-dependencies.sh - - save_cache: - key: asdf-dependencies-{{ arch }}-v2-{{ checksum ".tool-versions" }} - paths: - - ~/.asdf - - configure_secrets_tools: - steps: - - run: ./scripts/ci/common/install-git-crypt.sh - - run: ./scripts/ci/common/install-gpg-key.sh - - run: ./scripts/ci/common/configure-git.sh - - configure_release_tools: - steps: - - add_ssh_keys: - fingerprints: - - "SHA256:llKoU4DFV189TLH/gucs4eytL2Z1KN7jRN4NmDesD8g" - - run: ./scripts/ci/common/configure-rubygems.sh - - configure_tools: - steps: - - configure_build_tools - - configure_secrets_tools - - configure_release_tools - -jobs: - build: - <<: *build_container - steps: - - checkout - - configure_tools - - run: ./scripts/ci/steps/build.sh - - notify - - test: - <<: *build_container - steps: - - checkout - - configure_tools - - run: ./scripts/ci/steps/test.sh - - notify - - prerelease: - <<: *build_container - steps: - - checkout - - configure_tools - - run: ./scripts/ci/steps/prerelease.sh - - notify - - release: - <<: *build_container - steps: - - checkout - - configure_tools - - run: ./scripts/ci/steps/release.sh - - notify - - merge_pull_request: - <<: *build_container - steps: - - checkout - - configure_tools - - run: ./scripts/ci/steps/merge-pull-request.sh - - notify - -workflows: - version: 2 - pipeline: - jobs: - - 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 - - slack/on-hold: - <<: *only_main - <<: *slack_context - requires: - - prerelease - channel: release - template: SLACK_ON_HOLD_NOTIFICATION - - hold: - <<: *only_main - type: approval - requires: - - prerelease - - slack/on-hold - - release: - <<: *only_main - <<: *slack_context - requires: - - hold diff --git a/.circleci/gpg.private.enc b/.github/gpg.private.enc similarity index 100% rename from .circleci/gpg.private.enc rename to .github/gpg.private.enc diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml new file mode 100644 index 00000000..a0ba4798 --- /dev/null +++ b/.github/workflows/main.yaml @@ -0,0 +1,149 @@ +name: Main +on: + push: + branches: + - main + +permissions: + contents: read + +# Every run publishes to RubyGems; serialise so close-together merges cannot +# race on version numbers. queue: max keeps every queued run (the default +# keeps only the newest pending), so a slow release approval delays later +# prereleases instead of cancelling them. +concurrency: + group: main + cancel-in-progress: false + queue: max + +jobs: + skip-ci-check: + runs-on: ubuntu-latest + outputs: + should_skip_ci: ${{ steps.skip_ci_check.outputs.should_skip_ci }} + steps: + - id: skip_ci_check + env: + HEAD_COMMIT_MESSAGE: ${{ github.event.head_commit.message }} + run: | + if [[ "$HEAD_COMMIT_MESSAGE" == *"[no ci]"* ]] \ + || [[ "$HEAD_COMMIT_MESSAGE" == *"[skip ci]"* ]] \ + || [[ "$HEAD_COMMIT_MESSAGE" == *"[ci skip]"* ]]; then + echo "should_skip_ci=true" >> "$GITHUB_OUTPUT" + else + echo "should_skip_ci=false" >> "$GITHUB_OUTPUT" + fi + + check: + needs: [skip-ci-check] + if: needs.skip-ci-check.outputs.should_skip_ci != 'true' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install tools + uses: infrablocks/github-actions/asdf_install@v1 + - name: Check + run: ./go library:check + - name: Notify Slack + if: always() + continue-on-error: true + run: ./go "slack:notify[${{ job.status }}]" + env: + SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} + + test: + needs: [skip-ci-check] + if: needs.skip-ci-check.outputs.should_skip_ci != 'true' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install tools + uses: infrablocks/github-actions/asdf_install@v1 + - name: Test + run: ./go test:unit + - name: Notify Slack + if: always() + continue-on-error: true + run: ./go "slack:notify[${{ job.status }}]" + env: + SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} + + prerelease: + needs: [check, test] + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + - name: Install tools + uses: infrablocks/github-actions/asdf_install@v1 + - name: Install secrets tools + run: sudo apt-get update && sudo apt-get install -y git-crypt gnupg + - name: Unlock git-crypt + run: ./go git_crypt:unlock_with_encrypted_gpg_key + env: + ENCRYPTION_PASSPHRASE: ${{ secrets.ENCRYPTION_PASSPHRASE }} + - name: Configure RubyGems credentials + run: | + mkdir -p ~/.gem + cp config/secrets/rubygems/credentials ~/.gem/credentials + chmod 0600 ~/.gem/credentials + - name: Set CI git author + run: ./go repository:set_ci_author + - name: Prerelease + run: ./go "version:bump[pre]" && ./go release + - name: Push release commit + run: git push && git push --tags + - name: Notify Slack of release hold + continue-on-error: true + run: ./go "slack:notify[success,on_hold]" + env: + SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} + - name: Notify Slack + if: always() + continue-on-error: true + run: ./go "slack:notify[${{ job.status }}]" + env: + SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} + + release: + needs: [prerelease] + runs-on: ubuntu-latest + environment: release + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + with: + ref: main + - name: Pull latest main + # Approval can land long after the run starts; release publishes main + # as of approval time, not the tested SHA — parity with the old + # release.sh, which also pulled. prerelease.sh never pulled, so the + # prerelease job deliberately has no pull. + run: git pull + - name: Install tools + uses: infrablocks/github-actions/asdf_install@v1 + - name: Install secrets tools + run: sudo apt-get update && sudo apt-get install -y git-crypt gnupg + - name: Unlock git-crypt + run: ./go git_crypt:unlock_with_encrypted_gpg_key + env: + ENCRYPTION_PASSPHRASE: ${{ secrets.ENCRYPTION_PASSPHRASE }} + - name: Configure RubyGems credentials + run: | + mkdir -p ~/.gem + cp config/secrets/rubygems/credentials ~/.gem/credentials + chmod 0600 ~/.gem/credentials + - name: Set CI git author + run: ./go repository:set_ci_author + - name: Release + run: ./go "version:bump[patch]" && ./go documentation:update && ./go release + - name: Push release commit + run: git push && git push --tags + - name: Notify Slack + if: always() + continue-on-error: true + run: ./go "slack:notify[${{ job.status }}]" + env: + SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml new file mode 100644 index 00000000..f251e124 --- /dev/null +++ b/.github/workflows/pr.yaml @@ -0,0 +1,66 @@ +name: Pull Request +on: + pull_request: + +permissions: + contents: read + +jobs: + check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install tools + uses: infrablocks/github-actions/asdf_install@v1 + - name: Check + run: ./go library:check + - name: Notify Slack + if: always() + continue-on-error: true + run: ./go "slack:notify[${{ job.status }}]" + env: + SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} + + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install tools + uses: infrablocks/github-actions/asdf_install@v1 + - name: Test + run: ./go test:unit + - name: Notify Slack + if: always() + continue-on-error: true + run: ./go "slack:notify[${{ job.status }}]" + env: + SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} + + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install tools + uses: infrablocks/github-actions/asdf_install@v1 + - name: Build + run: ./go library:build + - name: Notify Slack + if: always() + continue-on-error: true + run: ./go "slack:notify[${{ job.status }}]" + env: + SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} + + merge-pull-request: + needs: [check, test, build] + runs-on: ubuntu-latest + if: github.actor == 'dependabot[bot]' + permissions: + contents: write + pull-requests: write + steps: + - name: Merge pull request + run: gh pr merge --merge "$PR_URL" + env: + PR_URL: ${{ github.event.pull_request.html_url }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/Gemfile.lock b/Gemfile.lock index cc057a8a..f68a7acf 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -8,33 +8,34 @@ PATH GEM remote: https://rubygems.org/ specs: - activesupport (7.2.3.1) + activesupport (8.1.3) base64 - benchmark (>= 0.3) bigdecimal concurrent-ruby (~> 1.0, >= 1.3.1) connection_pool (>= 2.2.5) drb i18n (>= 1.6, < 2) + json logger (>= 1.4.2) - minitest (>= 5.1, < 6) + minitest (>= 5.1) securerandom (>= 0.3) tzinfo (~> 2.0, >= 2.0.5) + uri (>= 0.13.1) addressable (2.9.0) public_suffix (>= 2.0.2, < 8.0) ast (2.4.3) base64 (0.3.0) - benchmark (0.5.0) bigdecimal (4.1.2) childprocess (5.0.0) coderay (1.1.3) colored2 (3.1.2) concurrent-ruby (1.3.7) - connection_pool (2.5.5) + connection_pool (3.0.2) diff-lcs (1.6.2) docile (1.4.0) drb (2.2.3) - excon (0.111.0) + excon (1.5.0) + logger faker (3.6.1) i18n (>= 1.8.11, < 2) faraday (2.14.3) @@ -43,10 +44,10 @@ GEM logger faraday-net_http (3.4.4) net-http (~> 0.5) - ffi (1.17.3) - ffi (1.17.3-arm64-darwin) - ffi (1.17.3-x86_64-darwin) - ffi (1.17.3-x86_64-linux-gnu) + ffi (1.17.4) + ffi (1.17.4-arm64-darwin) + ffi (1.17.4-x86_64-darwin) + ffi (1.17.4-x86_64-linux-gnu) formatador (1.2.3) reline gem-release (2.2.4) @@ -88,7 +89,9 @@ GEM logger (1.7.0) lumberjack (1.4.2) method_source (1.1.0) - minitest (5.27.0) + minitest (6.0.6) + drb (~> 2.0) + prism (~> 1.5) nenv (0.3.0) net-http (0.9.1) uri (>= 0.11.1) @@ -108,15 +111,10 @@ GEM coderay (~> 1.1) method_source (~> 1.0) reline (>= 0.6.0) - public_suffix (6.0.2) + public_suffix (7.0.5) racc (1.8.1) rainbow (3.1.1) rake (13.4.2) - rake_circle_ci (0.13.0) - colored2 (~> 3.1) - excon (~> 0.72) - rake_factory (~> 0.33) - sshkey (~> 2.0) rake_factory (0.33.0) activesupport (>= 4) rake (~> 13.0) @@ -124,8 +122,9 @@ GEM colored2 (~> 3.1) git (~> 1.13, >= 1.13.2) rake_factory (~> 0.33) - rake_git_crypt (0.2.0) + rake_git_crypt (0.4.0) colored2 (~> 3.1) + lino (~> 4.1) rake_factory (~> 0.33) ruby_git_crypt (~> 0.1) ruby_gpg2 (~> 0.12) @@ -138,10 +137,9 @@ GEM rake_gpg (0.20.0) rake_factory (~> 0.33) ruby_gpg2 (~> 0.12) - rake_ssh (0.12.0) - colored2 (~> 3.1) + rake_slack (0.3.0) + excon (>= 0.72, < 2.0) rake_factory (~> 0.33) - sshkey (~> 2.0) rb-fsevent (0.11.2) rb-inotify (0.11.1) ffi (~> 1.0) @@ -227,12 +225,11 @@ DEPENDENCIES guard guard-rspec rake - rake_circle_ci rake_git rake_git_crypt rake_github rake_gpg - rake_ssh + rake_slack rspec rubocop rubocop-rake diff --git a/README.md b/README.md index 66f9fd78..b6f165b2 100644 --- a/README.md +++ b/README.md @@ -348,16 +348,16 @@ To check for code linting / formatting issues without fixing: You can also run `bin/console` for an interactive prompt that will allow you to experiment. -### Managing CircleCI keys +### Managing CI keys -To encrypt a GPG key for use by CircleCI: +To encrypt a GPG key for use by CI: ```bash openssl aes-256-cbc \ -e \ -md sha1 \ -in ./config/secrets/ci/gpg.private \ - -out ./.circleci/gpg.private.enc \ + -out ./.github/gpg.private.enc \ -k "" ``` @@ -367,7 +367,7 @@ To check decryption is working correctly: openssl aes-256-cbc \ -d \ -md sha1 \ - -in ./.circleci/gpg.private.enc \ + -in ./.github/gpg.private.enc \ -k "" ``` diff --git a/Rakefile b/Rakefile index 0866c073..9a8090a8 100644 --- a/Rakefile +++ b/Rakefile @@ -1,11 +1,10 @@ # frozen_string_literal: true -require 'rake_circle_ci' require 'rake_git' require 'rake_git_crypt' require 'rake_github' require 'rake_gpg' -require 'rake_ssh' +require 'rake_slack' require 'rspec/core/rake_task' require 'rubocop/rake_task' require 'securerandom' @@ -60,13 +59,6 @@ namespace :encryption do end namespace :keys do - namespace :deploy do - RakeSSH.define_key_tasks( - path: 'config/secrets/ci/', - comment: 'maintainers@infrablocks.io' - ) - end - namespace :gpg do RakeGPG.define_generate_key_task( output_directory: 'config/secrets/ci', @@ -92,7 +84,6 @@ namespace :secrets do desc 'Generate all generatable secrets.' task generate: %w[ encryption:passphrase:generate - keys:deploy:generate keys:gpg:generate ] @@ -121,6 +112,11 @@ namespace :library do desc 'Attempt to automatically fix issues with the library' task fix: [:'rubocop:autocorrect_all'] + + desc 'Build the library' + task :build do + sh 'gem build ruby_terraform.gemspec' + end end namespace :documentation do @@ -146,28 +142,6 @@ namespace :test do RSpec::Core::RakeTask.new(:unit) end -RakeCircleCI.define_project_tasks( - namespace: :circle_ci, - project_slug: 'github/infrablocks/ruby_terraform' -) do |t| - circle_ci_config = - YAML.load_file('config/secrets/circle_ci/config.yaml') - - t.api_token = circle_ci_config['circle_ci_api_token'] - t.environment_variables = { - ENCRYPTION_PASSPHRASE: - File.read('config/secrets/ci/encryption.passphrase') - .chomp - } - t.checkout_keys = [] - t.ssh_keys = [ - { - hostname: 'github.com', - private_key: File.read('config/secrets/ci/ssh.private') - } - ] -end - RakeGithub.define_repository_tasks( namespace: :github, repository: 'infrablocks/ruby_terraform' @@ -176,21 +150,51 @@ RakeGithub.define_repository_tasks( YAML.load_file('config/secrets/github/config.yaml') t.access_token = github_config['github_personal_access_token'] - t.deploy_keys = [ - { - title: 'CircleCI', - public_key: File.read('config/secrets/ci/ssh.public') - } + # Actions store only: nothing in pr.yaml unlocks git-crypt, so dependabot + # runs never need the passphrase. + t.secrets = [ + { name: 'ENCRYPTION_PASSPHRASE', + value: File.read('config/secrets/ci/encryption.passphrase').chomp } + ] + t.environments = [ + { name: 'release', + reviewers: [{ team: 'maintainers' }] } ] end +namespace :slack do + RakeSlack.define_notification_tasks do |t| + t.bot_token = ENV.fetch('SLACK_BOT_TOKEN', nil) + t.routing_rules = [ + { when: { type: 'on_hold' }, + channel: 'C038EDCRSQJ', format: :on_hold }, # release + { when: { actor: 'dependabot[bot]', outcome: 'success' }, + channel: 'C03N711HVDG', format: :success }, # builds-dependabot + { when: { actor: 'dependabot[bot]' }, + channel: 'C03N711HVDG', format: :failure }, # builds-dependabot + { when: { outcome: 'success' }, + channel: 'C023XUE76GH', format: :success }, # builds + # Failures go to builds, not team-dev (org default), to keep noise + # out of a popular channel while this pipeline beds in. + { when: {}, + channel: 'C023XUE76GH', format: :failure } # builds + ] + end +end + +namespace :repository do + desc 'Set the git author for CI' + task :set_ci_author do + sh 'git config --global user.name "InfraBlocks CI"' + sh 'git config --global user.email "ci@infrablocks.io"' + end +end + namespace :pipeline do - desc 'Prepare CircleCI Pipeline' + desc 'Prepare GitHub Actions pipeline' task prepare: %i[ - circle_ci:env_vars:ensure - circle_ci:checkout_keys:ensure - circle_ci:ssh_keys:ensure - github:deploy_keys:ensure + github:secrets:ensure + github:environments:ensure ] end diff --git a/config/secrets/ci/ssh.private b/config/secrets/ci/ssh.private deleted file mode 100644 index 7729c8bc39b0fe19db8577280046f2da649584b0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3269 zcmV;$3_9}wM@dveQdv+`0OCW`OMzl1v~r7!E~xM)aHVkRBTw!Zlc7WD%Pl!&f3?*T zOSXnYYX1NZOjpV;InfR^RQR%4WhH5dwPyFtR0(d-mKs!iWw0%%>Fm)fnx&z3ZssVA z{BAYW9$9xN2>X5Cn=gIc?6L7KVuTjGW4H_{3x6Xpj9;V)`*WI$htdQ)HqGx5v0$&g1xvS(x`{76D%6-7Be(_LTE+d4Cyi(;qU zP>5H;D*ex3R)6@XeJc_)Q#XeEG05mxEeKoSwelbasiWr zjG;_)w&6RF_#77y(o{7nd&tQC>FTGcjBQ^PqHb-}?+weRtD~H^Eh<^0*Mj+FX{(dl){fk17(bg}~jmKL`tZ&a9ewD^R>K4tN_TA(sU%S>% za;AbU3~%8A#z{KOzn=?i-kd1QpvYWReK-f1Fm~Sz|;ZK<&@c?i;W$z{(;s1XaYGbY#DE@?+hC&6MdNM#%z=DVD zqtSyL>?NVPmfV<#y`8qhBh2LsDv!^OzuEE185Y7E<96vqNoYp3lx7L*)RA1<03kCvWd6%G@Fq|VR z>TjsIuYgPTZskOT0eCs%1B!<)iPH>h#4t(Wrrbf&o%$;-B5$2j=YYVp(KyOXy4ot< z_IA_^0Br2E@W}K%Y(39#yO4e&zi>(`8!Izw?0+M|)|K!Q=ar*o^od$)=ev&jB!Voe zbYMzqJe@QQ%rfe~>Rl+I9(m-PvLZnS->;wYT~_nHD5LzYD9?WHk4J#7V%YhB-Qqy~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OxWu-_=g^(?QT5QA?bpr{E4ALMmqyENPTb=HF2U!Tz0?+Kjtx{Ji|hs*AD zz;(^$udKO3Ty0l@UWmG{V-1pM0r34o{KRDgLr=1svQN9H6G<*u#TvgRxNtV>N~ZYfwl85Zs_gCLSmp73s9T%e_K18XXx+c+Oj!AI;GULDdRBSKQt=vn5q3 zrY{g41fqZbsICebS?ru~KXvvj2)WZR>+b0|@Pn^Oo`ZLy8MYk~b7M@SdX zh+x}-U(O&T{{=He&UA^75*u_Pedwdmg3)V*itJux_RotT{RJgG3opi*3(!AQ&nMMB z#eJxo+qkYJ2p!Pd6Ox^5C^&_OVgg1r`S`X^Zeqq(L|hFVw6^;rnUK5i(!5$AFORT4 z5cmGx1Ba^XDgX1hbXC5%D<(0$GF1y9QWJqK=udDH;?xij(746-8Cd~}(_eH)@ux7u zHz`^9)!;{l=Gm7K-Pn#_nL!nXaJ9{wTbqCQ2 z&2ngvFL%?7fkrVslC1UwXYwLp0>51Px*u{S3Yys2pWx8^A#M2ISu2IPsSX6LdqX(B z_fDUjl+;T&}Ib2e<=8B@TGilH=@Ay_k<vD>ZfKX0|gXe&%wJFYpCnW@c&%H**!S` diff --git a/ruby_terraform.gemspec b/ruby_terraform.gemspec index 863e1312..64a631a2 100644 --- a/ruby_terraform.gemspec +++ b/ruby_terraform.gemspec @@ -47,12 +47,11 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'guard' spec.add_development_dependency 'guard-rspec' spec.add_development_dependency 'rake' - spec.add_development_dependency 'rake_circle_ci' spec.add_development_dependency 'rake_git' spec.add_development_dependency 'rake_git_crypt' spec.add_development_dependency 'rake_github' spec.add_development_dependency 'rake_gpg' - spec.add_development_dependency 'rake_ssh' + spec.add_development_dependency 'rake_slack' spec.add_development_dependency 'rspec' spec.add_development_dependency 'rubocop' spec.add_development_dependency 'rubocop-rake' diff --git a/scripts/ci/common/configure-asdf.sh b/scripts/ci/common/configure-asdf.sh deleted file mode 100755 index b71847a5..00000000 --- a/scripts/ci/common/configure-asdf.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env bash - -[ -n "$DEBUG" ] && set -x -set -e -set -o pipefail - -function ensure-asdf-plugin() { - local name="$1" - local repo="$2" - - if ! asdf plugin list | grep -q "$name"; then - asdf plugin add "$name" "$repo" - fi -} - -ensure-asdf-plugin "ruby" "https://github.com/asdf-vm/asdf-ruby.git" -ensure-asdf-plugin "java" "https://github.com/halcyon/asdf-java.git" -ensure-asdf-plugin "golang" "https://github.com/asdf-community/asdf-golang.git" diff --git a/scripts/ci/common/configure-git.sh b/scripts/ci/common/configure-git.sh deleted file mode 100755 index cb11b108..00000000 --- a/scripts/ci/common/configure-git.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash - -[ -n "$DEBUG" ] && set -x -set -e -set -o pipefail - -git config --global user.email "circleci@infrablocks.io" -git config --global user.name "Circle CI" diff --git a/scripts/ci/common/configure-rubygems.sh b/scripts/ci/common/configure-rubygems.sh deleted file mode 100755 index 53ba65ad..00000000 --- a/scripts/ci/common/configure-rubygems.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/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 - -mkdir -p ~/.gem -cp config/secrets/rubygems/credentials ~/.gem/credentials -chmod 0600 ~/.gem/credentials diff --git a/scripts/ci/common/install-asdf-dependencies.sh b/scripts/ci/common/install-asdf-dependencies.sh deleted file mode 100755 index cb01457f..00000000 --- a/scripts/ci/common/install-asdf-dependencies.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/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" - -asdf install diff --git a/scripts/ci/common/install-asdf.sh b/scripts/ci/common/install-asdf.sh deleted file mode 100755 index 8c1ce8bc..00000000 --- a/scripts/ci/common/install-asdf.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env bash - -[ -n "$DEBUG" ] && set -x -set -e -set -o pipefail - -apt-get update -apt-get install -y --no-install-recommends \ - ca-certificates \ - curl \ - git - -if [ ! -f "$HOME/.asdf/asdf.sh" ]; then - echo "Installing asdf..." - git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.12.0 -fi - -# shellcheck disable=SC2016 -echo '. "$HOME/.asdf/asdf.sh"' >> "$BASH_ENV" diff --git a/scripts/ci/common/install-git-crypt.sh b/scripts/ci/common/install-git-crypt.sh deleted file mode 100755 index 236276d4..00000000 --- a/scripts/ci/common/install-git-crypt.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash - -[ -n "$DEBUG" ] && set -x -set -e -set -o pipefail - -apt-get update -apt-get install -y --no-install-recommends git ssh git-crypt diff --git a/scripts/ci/common/install-gpg-key.sh b/scripts/ci/common/install-gpg-key.sh deleted file mode 100755 index 52d10c23..00000000 --- a/scripts/ci/common/install-gpg-key.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/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" - -set +e -openssl version -openssl aes-256-cbc \ - -d \ - -md sha1 \ - -in ./.circleci/gpg.private.enc \ - -k "${ENCRYPTION_PASSPHRASE}" | gpg --import - -set -e diff --git a/scripts/ci/common/install-slack-deps.sh b/scripts/ci/common/install-slack-deps.sh deleted file mode 100755 index 70abb6b0..00000000 --- a/scripts/ci/common/install-slack-deps.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash - -[ -n "$DEBUG" ] && set -x -set -e -set -o pipefail - -apt-get update -apt-get install -y --no-install-recommends curl jq diff --git a/scripts/ci/steps/build.sh b/scripts/ci/steps/build.sh deleted file mode 100755 index d89621c8..00000000 --- a/scripts/ci/steps/build.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/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" - -./go library:check diff --git a/scripts/ci/steps/merge-pull-request.sh b/scripts/ci/steps/merge-pull-request.sh deleted file mode 100755 index 63be3b17..00000000 --- a/scripts/ci/steps/merge-pull-request.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/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]"] diff --git a/scripts/ci/steps/prerelease.sh b/scripts/ci/steps/prerelease.sh deleted file mode 100755 index c31cf414..00000000 --- a/scripts/ci/steps/prerelease.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/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" - -./go version:bump[pre] -./go release - -git status -git push diff --git a/scripts/ci/steps/release.sh b/scripts/ci/steps/release.sh deleted file mode 100755 index 96b160f7..00000000 --- a/scripts/ci/steps/release.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/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 pull - -./go version:bump[patch] -./go documentation:update -./go release - -git status -git push diff --git a/scripts/ci/steps/test.sh b/scripts/ci/steps/test.sh deleted file mode 100755 index 0f1716ae..00000000 --- a/scripts/ci/steps/test.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/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" - -./go test:unit