deployed 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,54 @@
1
+ <div class="relative">
2
+ <button type="button" class="inline-flex items-center gap-x-1 text-sm font-semibold leading-6 text-slate-400" aria-expanded="false">
3
+ <span>Resources</span>
4
+ <svg class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
5
+ <path fill-rule="evenodd" d="M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z" clip-rule="evenodd" />
6
+ </svg>
7
+ </button>
8
+
9
+ <!--
10
+ Flyout menu, show/hide based on flyout menu state.
11
+
12
+ Entering: "transition ease-out duration-200"
13
+ From: "opacity-0 translate-y-1"
14
+ To: "opacity-100 translate-y-0"
15
+ Leaving: "transition ease-in duration-150"
16
+ From: "opacity-100 translate-y-0"
17
+ To: "opacity-0 translate-y-1"
18
+ -->
19
+ <div class="absolute z-10 mt-5 flex w-screen max-w-max left-[-225px] px-4">
20
+ <div class="w-screen max-w-md flex-auto overflow-hidden rounded-3xl bg-white text-sm leading-6 shadow-lg ring-1 ring-gray-900/5 lg:max-w-2xl">
21
+ <div class="grid grid-cols-1 gap-x-6 gap-y-1 p-4 lg:grid-cols-2">
22
+ <div class="group relative flex gap-x-6 rounded-lg p-4 hover:bg-gray-50">
23
+ <div class="mt-1 flex h-11 w-11 flex-none items-center justify-center rounded-lg bg-gray-50 group-hover:bg-white">
24
+ <svg class="h-6 w-6 text-gray-600 group-hover:text-indigo-600" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true">
25
+ <path stroke-linecap="round" stroke-linejoin="round" d="M10.5 6a7.5 7.5 0 107.5 7.5h-7.5V6z" />
26
+ <path stroke-linecap="round" stroke-linejoin="round" d="M13.5 10.5H21A7.5 7.5 0 0013.5 3v7.5z" />
27
+ </svg>
28
+ </div>
29
+ <div>
30
+ <a href="#" class="font-semibold text-gray-900">
31
+ Documentation
32
+ <span class="absolute inset-0"></span>
33
+ </a>
34
+ <p class="mt-1 text-gray-600">Check out our documentation</p>
35
+ </div>
36
+ </div>
37
+ <div class="group relative flex gap-x-6 rounded-lg p-4 hover:bg-gray-50">
38
+ <div class="mt-1 flex h-11 w-11 flex-none items-center justify-center rounded-lg bg-gray-50 group-hover:bg-white">
39
+ <svg class="h-6 w-6 text-gray-600 group-hover:text-indigo-600" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true">
40
+ <path stroke-linecap="round" stroke-linejoin="round" d="M13.5 16.875h3.375m0 0h3.375m-3.375 0V13.5m0 3.375v3.375M6 10.5h2.25a2.25 2.25 0 002.25-2.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v2.25A2.25 2.25 0 006 10.5zm0 9.75h2.25A2.25 2.25 0 0010.5 18v-2.25a2.25 2.25 0 00-2.25-2.25H6a2.25 2.25 0 00-2.25 2.25V18A2.25 2.25 0 006 20.25zm9.75-9.75H18a2.25 2.25 0 002.25-2.25V6A2.25 2.25 0 0018 3.75h-2.25A2.25 2.25 0 0013.5 6v2.25a2.25 2.25 0 002.25 2.25z" />
41
+ </svg>
42
+ </div>
43
+ <div>
44
+ <a href="#" class="font-semibold text-gray-900">
45
+ Our GitHub Repository
46
+ <span class="absolute inset-0"></span>
47
+ </a>
48
+ <p class="mt-1 text-gray-600">Ipsum Lorem</p>
49
+ </div>
50
+ </div>
51
+ </div>
52
+ </div>
53
+ </div>
54
+ </div>
@@ -0,0 +1,90 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Deployed: The Deployment Rails Engine</title>
5
+ <%= csrf_meta_tags %>
6
+ <%= csp_meta_tag %>
7
+ <meta name="viewport" content="width=device-width,initial-scale=1">
8
+ <%= stylesheet_link_tag "deployed/deployed", 'data-turbo-track': 'reload' %>
9
+ <%= javascript_include_tag "deployed/application", type: "module" %>
10
+ <script>
11
+ document.addEventListener('alpine:init', () => {
12
+ Alpine.store('process', {
13
+ running: false,
14
+ start() {
15
+ this.running = true
16
+ },
17
+ stop() {
18
+ this.running = false
19
+ },
20
+ abortInProgress: false,
21
+ startAbort() {
22
+ this.abortInProgress = true
23
+ },
24
+ resetAbort() {
25
+ this.abortInProgress = false
26
+ }
27
+ })
28
+
29
+ Alpine.store('ready', <%= !Deployed::Config.requires_init %>)
30
+ })
31
+ </script>
32
+ </head>
33
+ <body class="bg-slate-100">
34
+ <div class="fixed right-5 top-16" x-data x-cloak x-show="$store.process.running">
35
+ <span class="bg-yellow-400 px-4 py-1 rounded-full font-medium animate-pulse text-yellow-900">Process Running</span>
36
+ </div>
37
+ <div class="fixed right-5 top-16" x-data x-cloak x-show="!$store.ready">
38
+ <span class="bg-red-400 px-4 py-1 rounded-full font-medium text-red-900">Configuration Required</span>
39
+ </div>
40
+ <header class="bg-slate-900 fixed left-0 right-0">
41
+ <div class="px-8 py-2 max-w-5xl mx-auto flex justify-start items-center">
42
+ <div>
43
+ <h1 class="font-medium text-3xl font-bold flex">
44
+ <div class="text-slate-200 flex items-center space-x-2">
45
+ <div>
46
+ <div class="text-sm font-bold font-mono border border-slate-200 rounded-md px-4 py-2 border-b-4">
47
+ DEPLOYED
48
+ </div>
49
+ </div>
50
+ </div>
51
+ </h1>
52
+ </div>
53
+ <% if false %>
54
+ <div class="ml-4">
55
+ <%= render 'layouts/deployed/nav_menu' %>
56
+ </div>
57
+ <% end %>
58
+ </div>
59
+ </header>
60
+ <div class="h-screen flex flex-col pt-[56px]">
61
+ <div class="flex-1 overflow-y-auto">
62
+ <div class="p-8 max-w-5xl mx-auto">
63
+ <%= yield %>
64
+ </div>
65
+ </div>
66
+
67
+ <div id="deploy-output-container" class="relative flex flex-col bg-white shadow-md px-6 py-8 h-[200px] border-t border-slate-300">
68
+ <div id="resize-handle" class="bg-slate-200 hover:bg-slate-300 absolute top-0 left-0 right-0 w-full h-[12px]">
69
+ <div class="w-full flex justify-center absolute top-[-6px] opacity-50">
70
+ <%= deploy_output_resize_handler %>
71
+ </div>
72
+ </div>
73
+ <div id="scrollable-div" class="rounded-lg bg-slate-900 p-4 font-mono text-sm text-slate-400 overflow-scroll">
74
+ <div id="deploy-output">
75
+ <%= deploy_output_intro %>
76
+ <%= deploy_output_kamal_version %>
77
+ <%= deploy_output_missing_config %>
78
+
79
+ <div class="absolute right-[40px] top-[50px]" x-data x-show="$store.process.running">
80
+ <%= kamal_abort_button %>
81
+ </div>
82
+ </div>
83
+ <%= deploy_output_spinner %>
84
+ </div>
85
+ </div>
86
+ </div>
87
+
88
+ <%= turbo_frame_tag('deployed-init', src: setup_path, target: '_top') if Deployed::Config.requires_init %>
89
+ </body>
90
+ </html>
data/config/routes.rb ADDED
@@ -0,0 +1,9 @@
1
+ Deployed::Engine.routes.draw do
2
+ get 'setup', to: 'setup#new'
3
+ post 'setup', to: 'setup#create'
4
+ get 'config', to: 'config#show'
5
+ get 'git/uncommitted_check', to: 'git#uncommitted_check'
6
+ get 'execute', to: 'run#execute'
7
+ get 'cancel', to: 'run#cancel'
8
+ root to: 'welcome#index'
9
+ end
@@ -0,0 +1,5 @@
1
+ module Deployed
2
+ class Engine < ::Rails::Engine
3
+ isolate_namespace Deployed
4
+ end
5
+ end
@@ -0,0 +1,3 @@
1
+ module Deployed
2
+ VERSION = "0.1.0"
3
+ end
data/lib/deployed.rb ADDED
@@ -0,0 +1,18 @@
1
+ require 'deployed/version'
2
+ require 'deployed/engine'
3
+
4
+ module Deployed
5
+ DIRECTORY = '.deployed'
6
+
7
+ def self.setup!
8
+ # Ensure directory is set up
9
+ directory_path = Rails.root.join(DIRECTORY)
10
+
11
+ unless File.directory?(directory_path)
12
+ Dir.mkdir(directory_path)
13
+ end
14
+
15
+ # Ensure we read the config
16
+ Deployed::Config.init!
17
+ end
18
+ end
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :deployed do
3
+ # # Task goes here
4
+ # end
metadata ADDED
@@ -0,0 +1,116 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: deployed
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Simon Chiu
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2023-10-23 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: kamal
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: turbo-rails
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.5'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.5'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rails
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: 7.1.1
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: 7.1.1
55
+ description: Mountable Rails engine to manage Kamal commands
56
+ email:
57
+ - simon@furvur.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - MIT-LICENSE
63
+ - README.md
64
+ - Rakefile
65
+ - app/assets/config/deployed_manifest.js
66
+ - app/assets/javascripts/deployed/application.js
67
+ - app/assets/stylesheets/deployed/deployed.css
68
+ - app/assets/stylesheets/deployed/src/input.css
69
+ - app/controllers/deployed/application_controller.rb
70
+ - app/controllers/deployed/config_controller.rb
71
+ - app/controllers/deployed/git_controller.rb
72
+ - app/controllers/deployed/run_controller.rb
73
+ - app/controllers/deployed/setup_controller.rb
74
+ - app/controllers/deployed/welcome_controller.rb
75
+ - app/helpers/deployed/application_helper.rb
76
+ - app/helpers/deployed/log_output_helper.rb
77
+ - app/models/deployed/config.rb
78
+ - app/models/deployed/current_execution.rb
79
+ - app/views/deployed/git/uncommitted_check.html.erb
80
+ - app/views/deployed/setup/new.html.erb
81
+ - app/views/deployed/welcome/index.html.erb
82
+ - app/views/layouts/deployed/_nav_menu.html.erb
83
+ - app/views/layouts/deployed/application.html.erb
84
+ - config/routes.rb
85
+ - lib/deployed.rb
86
+ - lib/deployed/engine.rb
87
+ - lib/deployed/version.rb
88
+ - lib/tasks/kamal_rails_tasks.rake
89
+ homepage: https://github.com/geetfun/deployed
90
+ licenses:
91
+ - MIT
92
+ metadata:
93
+ allowed_push_host: https://rubygems.org
94
+ homepage_uri: https://github.com/geetfun/deployed
95
+ source_code_uri: https://github.com/geetfun/deployed
96
+ changelog_uri: https://github.com/geetfun/deployed
97
+ post_install_message:
98
+ rdoc_options: []
99
+ require_paths:
100
+ - lib
101
+ required_ruby_version: !ruby/object:Gem::Requirement
102
+ requirements:
103
+ - - ">="
104
+ - !ruby/object:Gem::Version
105
+ version: '0'
106
+ required_rubygems_version: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ requirements: []
112
+ rubygems_version: 3.4.20
113
+ signing_key:
114
+ specification_version: 4
115
+ summary: Mountable Rails engine to manage Kamal commands
116
+ test_files: []