Sha256: 0c2caee78a173c330751c6ca240d762347c89d7bc5d0e59f88027f2c732c941b

Contents?: true

Size: 1.87 KB

Versions: 31

Compression:

Stored size: 1.87 KB

Contents

require 'yaml'
require 'rake_circle_ci'
require 'rake_github'
require 'rake_ssh'
require 'rspec/core/rake_task'

task :default => :spec

RSpec::Core::RakeTask.new(:spec)

RakeSSH.define_key_tasks(
    namespace: :deploy_key,
    path: 'config/secrets/ci/',
    comment: 'maintainers@infrablocks.io'
)

RakeCircleCI.define_project_tasks(
    namespace: :circle_ci,
    project_slug: 'github/infrablocks/ruby_gpg2'
) 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.ssh_keys = [
      {
          hostname: "github.com",
          private_key: File.read('config/secrets/ci/ssh.private')
      }
  ]
end

RakeGithub.define_repository_tasks(
    namespace: :github,
    repository: 'infrablocks/ruby_gpg2',
) do |t|
  github_config =
      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')
      }
  ]
end

namespace :pipeline do
  task :prepare => [
      :'circle_ci:project:follow',
      :'circle_ci:env_vars:ensure',
      :'circle_ci:ssh_keys:ensure',
      :'github:deploy_keys:ensure'
  ]
end

namespace :version do
  desc "Bump version for specified type (pre, major, minor, patch)"
  task :bump, [:type] do |_, args|
    bump_version_for(args.type)
  end
end

desc "Release gem"
task :release do
  sh "gem release --tag --push"
end

def bump_version_for(version_type)
  sh "gem bump --version #{version_type} " +
      "&& bundle install " +
      "&& export LAST_MESSAGE=\"$(git log -1 --pretty=%B)\" " +
      "&& git commit -a --amend -m \"${LAST_MESSAGE} [ci skip]\""
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
ruby_gpg2-0.4.0 Rakefile
ruby_gpg2-0.3.0.pre.2 Rakefile
ruby_gpg2-0.3.0.pre.1 Rakefile
ruby_gpg2-0.2.0 Rakefile
ruby_gpg2-0.1.0.pre.27 Rakefile
ruby_gpg2-0.1.0.pre.26 Rakefile
ruby_gpg2-0.1.0.pre.25 Rakefile
ruby_gpg2-0.1.0.pre.24 Rakefile
ruby_gpg2-0.1.0.pre.23 Rakefile
ruby_gpg2-0.1.0.pre.22 Rakefile
ruby_gpg2-0.1.0.pre.21 Rakefile
ruby_gpg2-0.1.0.pre.20 Rakefile
ruby_gpg2-0.1.0.pre.19 Rakefile
ruby_gpg2-0.1.0.pre.18 Rakefile
ruby_gpg2-0.1.0.pre.17 Rakefile
ruby_gpg2-0.1.0.pre.16 Rakefile
ruby_gpg2-0.1.0.pre.15 Rakefile
ruby_gpg2-0.1.0.pre.14 Rakefile
ruby_gpg2-0.1.0.pre.13 Rakefile
ruby_gpg2-0.1.0.pre.12 Rakefile