Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 8 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1
ruby-version: 3.4.1
- name: Install dependencies
run: bundle install
- name: Run linter
Expand All @@ -21,22 +21,19 @@ jobs:
release_created: ${{ steps.release-please.outputs.release_created }}
version: ${{ steps.release-please.outputs.version }}
steps:
- uses: krystal/release-please-manifest-action@v1
- uses: googleapis/release-please-action@v4
id: release-please
with:
app-id: ${{ vars.RELEASE_PLEASE_GITHUB_APP_ID }}
private-key: ${{ secrets.RELEASE_PLEASE_GITHUB_APP_PRIVATE_KEY }}

release:
runs-on: ubuntu-latest
needs: [lint, release-please]
if: needs.release-please.outputs.release_created
if: ${{ needs.release-please.outputs.release_created }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Ruby
uses: actions/setup-ruby@v1
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1
ruby-version: 3.4.1
- name: Export version from tag name
run: echo "${{ needs.release-please.outputs.version }}" > VERSION
- name: Build Gem
Expand All @@ -48,7 +45,7 @@ jobs:
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:rubygems_api_key: ${RUBYGEMS_API_KEY}\n" > $HOME/.gem/credentials
env:
RUBYGEMS_API_KEY: ${{secrets.KRYSTAL_RUBYGEMS_API_KEY}}
RUBYGEMS_API_KEY: ${{secrets.RUBYGEMS_API_KEY}}
- name: Publish to RubyGems
run: |
gem push *.gem
File renamed without changes.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,13 @@ Waiting for deployment capacity......

The CLI client in particular is a bit experimental, and not yet finished. Any
pull-requests to improve it would be greatly welcomed.

## Release

This project uses [Google's release-please](https://github.com/googleapis/release-please) action which automates CHANGELOG generation, the creation of GitHub releases, and version bumps.

**Commit messages are important!**

`release-please` assumes that you are following the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification.
This means that your commit messages should be structured in a way that release-please can determine the type of change that has been made.
Please refer to the ["How should I write my commits"](https://github.com/googleapis/release-please?tab=readme-ov-file#how-should-i-write-my-commits) documentation.
19 changes: 15 additions & 4 deletions lib/deploy/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
require 'deploy/cli/websocket_client'
require 'deploy/cli/deployment_progress_output'

OptionsStruct = Struct.new(:config_file, :project)
OptionsStruct = Struct.new(:config_file, :project, :config_files_deployment)

# rubocop:disable Metrics/ClassLength
# rubocop:disable Metrics/AbcSize
Expand All @@ -25,7 +25,7 @@ class << self
def invoke(args)
@options = OptionsStruct.new

parser = OptionParser.new do |opts|
parser = OptionParser.new do |opts| # rubocop:disable Metrics/BlockLength
opts.banner = 'Usage: deployhq [options] command'
opts.separator ''
opts.separator 'Commands:'
Expand All @@ -45,6 +45,11 @@ def invoke(args)
@options.project = project_permalink
end

@options.config_files_deployment = false
opts.on('--config-files', 'Config files deployment') do |_config_files_deployment|
@options.config_files_deployment = true
end

opts.on_tail('-v', '--version', 'Shows Version') do
puts Deploy::VERSION
exit
Expand Down Expand Up @@ -127,8 +132,14 @@ def deploy
end
end

latest_revision = @project.latest_revision(parent.preferred_branch)
deployment = @project.deploy(parent.identifier, parent.last_revision, latest_revision)
if @options.config_files_deployment
$stdout.print "\nStarting config files deployment\n"
deployment = @project.config_files_deployment(parent.identifier)
else
$stdout.print "\nStarting deployment\n"
latest_revision = @project.latest_revision(parent.preferred_branch)
deployment = @project.deploy(parent.identifier, parent.last_revision, latest_revision)
end

$stdout.print 'Waiting for an available deployment slot...'
DeploymentProgressOutput.new(deployment).monitor
Expand Down
2 changes: 1 addition & 1 deletion lib/deploy/cli/websocket_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def authenticate
end

def request_subscriptions
subscriptions.each do |_key, subscription|
subscriptions.each_value do |subscription|
send('Subscribe', exchange: subscription.exchange, routing_key: subscription.routing_key)
end
end
Expand Down
7 changes: 6 additions & 1 deletion lib/deploy/resources/project.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,17 @@ def latest_revision(branch = '')
end

# Create a deployment in this project (and queue it to run)
def deploy(server, start_revision, end_revision)
def deploy(server, start_revision, end_revision, config_files_only: false)
run_deployment(server, start_revision, end_revision) do |d|
d.mode = 'queue'
d.config_files_deployment = '1' if config_files_only
end
end

def config_files_deployment(server)
deploy(server, nil, nil, config_files_only: true)
end

# Create a deployment preview
def preview(server, start_revision, end_revision)
run_deployment(server, start_revision, end_revision) do |d|
Expand Down
File renamed without changes.
Loading