Skip to content

Commit

Permalink
Add Deployment and Source (#172)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdelaossa authored Jun 18, 2024
1 parent 2cf31f9 commit 5abad7c
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/aptible/api/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class App < Resource
belongs_to :account
belongs_to :current_configuration
has_one :last_code_scan_result
has_one :current_deployment
embeds_one :current_image
embeds_one :last_operation
embeds_one :last_deploy_operation
Expand Down
25 changes: 25 additions & 0 deletions lib/aptible/api/deployment.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module Aptible
module Api
class Deployment < Resource
belongs_to :operation
belongs_to :app
belongs_to :configuration
belongs_to :image
belongs_to :source

field :id
field :status
field :docker_image
field :docker_repository_url
field :git_repository_url
field :git_ref
field :git_commit_sha
field :git_commit_url
field :git_commit_message
field :git_commit_timestamp

field :created_at, type: Time
field :updated_at, type: Time
end
end
end
2 changes: 2 additions & 0 deletions lib/aptible/api/resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def root_url
require 'aptible/api/container'
require 'aptible/api/database'
require 'aptible/api/database_image'
require 'aptible/api/deployment'
require 'aptible/api/disk'
require 'aptible/api/image'
require 'aptible/api/instance_layer_membership'
Expand All @@ -34,6 +35,7 @@ def root_url
require 'aptible/api/permission'
require 'aptible/api/release'
require 'aptible/api/service'
require 'aptible/api/source'
require 'aptible/api/vhost'
require 'aptible/api/ssh_portal_connection'
require 'aptible/api/stack'
Expand Down
16 changes: 16 additions & 0 deletions lib/aptible/api/source.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module Aptible
module Api
class Source < Resource
has_many :apps
has_many :deployments

field :id
field :organization_id
field :qualified_name
field :url

field :created_at, type: Time
field :updated_at, type: Time
end
end
end
2 changes: 1 addition & 1 deletion lib/aptible/api/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Aptible
module Api
VERSION = '1.5.4'.freeze
VERSION = '1.6.0'.freeze
end
end

0 comments on commit 5abad7c

Please sign in to comment.