Commit 13623661 authored by Jacob Vosmaer's avatar Jacob Vosmaer 💬

Make gdk a gem

parent aba04480
......@@ -44,3 +44,4 @@
/.gitlab-shell-bundle
/.gitlab-bundle
/gdk
/*.gem
# GitLab Development Kit cheat sheet
./gdk run # Start everything
./gdk run db # Start enough to run tests
./gdk run app # Start GitLab, need './run db'
gdk run # Start everything
gdk run db # Start enough to run tests
gdk run app # Start GitLab, needs 'gdk run db'
./gdk install gitlab_repo=https://my-fork # Install everything
./gdk update # Pull application changes from Git
./gdk reconfigure # Delete and regenerate all config files created by GDK
gdk install gitlab_repo=https://my-fork # Install everything
gdk update # Pull application changes from Git
gdk reconfigure # Delete and regenerate all config files created by GDK
# Development admin account: root / 5iveL!fe
#!/usr/bin/env ruby
require 'fileutils'
def main
case ARGV.first
when 'init'
system(*%W(git clone -b gdk-cli https://gitlab.com/gitlab-org/gitlab-development-kit.git))
else
$gdk_root = find_root(Dir.pwd)
if $gdk_root.nil?
puts "Could not find GDK_ROOT in the current directory or any of its parents."
return false
end
puts "(in #{$gdk_root})"
load(File.join($gdk_root, 'lib/gdk.rb'))
GDK::main
end
end
def find_root(current)
if File.exist?(File.join(current, 'GDK_ROOT'))
File.realpath(current)
elsif File.realpath(current) == '/'
nil
else
find_root(File.join(current, '..'))
end
end
exit(main)
GDK_ROOT = ENV.delete('GDK_ROOT').to_s
PROGNAME = ENV.delete('GDK_INVOKED').to_s
def main
case ARGV.shift
when 'run'
system('./run', *ARGV, chdir: GDK_ROOT)
when 'install'
system('make', *ARGV, chdir: GDK_ROOT)
when 'update'
system('make', 'update', chdir: GDK_ROOT)
when 'reconfigure'
system('make', 'clean-config', 'all', chdir: GDK_ROOT)
when 'help'
puts File.read(File.join(GDK_ROOT, 'HELP')).gsub(/^\.\/gdk/, PROGNAME)
true
else
puts "Usage: #{PROGNAME} run|install|update|reconfigure|help [ARGS...]"
false
end
end
exit main
# coding: utf-8
Gem::Specification.new do |spec|
spec.name = "gitlab-development-kit"
spec.version = '0.1.0'
spec.authors = ["Jacob Vosmaer"]
spec.email = ["jacob@gitlab.com"]
spec.summary = %q{CLI for GitLab Development Kit}
spec.description = %q{CLI for GitLab Development Kit.}
spec.homepage = "https://gitlab.com/gitlab-org/gitlab-development-kit"
spec.license = "MIT"
spec.files = []
spec.executables = ['gdk']
end
module GDK
PROGNAME = 'gdk'
def self.main
case ARGV.shift
when 'run'
system('./run', *ARGV, chdir: $gdk_root)
when 'install'
system('make', *ARGV, chdir: $gdk_root)
when 'update'
system('make', 'update', chdir: $gdk_root)
when 'reconfigure'
system('make', 'clean-config', 'all', chdir: $gdk_root)
when 'help'
puts File.read(File.join($gdk_root, 'HELP'))
true
else
puts "Usage: #{PROGNAME} run|init|install|update|reconfigure|help [ARGS...]"
false
end
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment