fanforce-app-factory 2.0.0.rc19 → 2.0.0.rc20
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fanforce/app_factory/cli/lib/bitbucket.rb +17 -14
- data/lib/fanforce/app_factory/cli/lib/bundler.rb +1 -1
- data/lib/fanforce/app_factory/cli/lib/utils.rb +1 -1
- data/lib/fanforce/app_factory/cli/scripts/setup.rb +1 -1
- data/lib/fanforce/app_factory/cli/scripts/update.rb +8 -5
- data/lib/fanforce/app_factory/cli_single_app.rb +6 -5
- data/lib/fanforce/app_factory/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 17ece4c5cc5a95c54cdff33adbdcefebee46719a
|
4
|
+
data.tar.gz: 288e641f3a7e4c34d61907a18d24f05586c2a4ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 24dc4476764b83874f53756b9bd22a9fc67a27c10dd5a5cf049c643db6def68fa20424d8b27cb7cd0922f8554bd44da5ee33cebe270742dbd3816372d72ea92f
|
7
|
+
data.tar.gz: c41a43a975a592b0aafb330d65916451652caa13b0db3ddc5281a2df3dd1cd58f6dca214ded1f593e1e12ecf20636bd84b05f268519ab1da85fd8396691a64ab
|
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'bitbucket_rest_api'
|
2
2
|
require 'rest_client'
|
3
|
+
require 'open3'
|
3
4
|
|
4
5
|
class Fanforce::AppFactory::CLI::Bitbucket
|
5
6
|
include Fanforce::AppFactory::CLI::Utils
|
@@ -45,22 +46,24 @@ class Fanforce::AppFactory::CLI::Bitbucket
|
|
45
46
|
end
|
46
47
|
|
47
48
|
def setup_git_remote(repo_name)
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
puts "#{'Created '.format(:green,:bold)}" + 'git remote for bitbucket'
|
57
|
-
end
|
49
|
+
Dir.chdir(app.dir) do
|
50
|
+
if console_command('git remote').split(/\r?\n/).include?('bitbucket')
|
51
|
+
log "#{'Found '.format(:green,:bold)}" + 'git remote for bitbucket'
|
52
|
+
else
|
53
|
+
console_command("git remote add bitbucket git@bitbucket.org:#{config[:bitbucket][:user]}/#{repo_name}.git")
|
54
|
+
console_command('git fetch bitbucket')
|
55
|
+
log "#{'Created '.format(:green,:bold)}" + 'git remote for bitbucket'
|
56
|
+
end
|
58
57
|
|
59
|
-
|
60
|
-
|
58
|
+
upstream_error = Open3.popen3('git rev-parse --abbrev-ref master@{upstream}')[2].gets.to_s
|
59
|
+
if upstream_error.include?('fatal')
|
60
|
+
console_command('git branch -u bitbucket/master')
|
61
|
+
log "#{'Connected '.format(:green,:bold)}" + 'upstream to bitbucket/master'
|
62
|
+
end
|
61
63
|
|
62
|
-
|
63
|
-
|
64
|
+
log "#{'Pushing '.format(:green,:bold)}" + "latest commit to #{config[:bitbucket][:user]}..."
|
65
|
+
console_command('git push bitbucket --all', true)
|
66
|
+
end
|
64
67
|
end
|
65
68
|
|
66
69
|
def create_repo(repo_name)
|
@@ -9,7 +9,7 @@ module Fanforce::AppFactory::CLI::Utils
|
|
9
9
|
|
10
10
|
@@config = nil
|
11
11
|
|
12
|
-
def console_command(command, print_now=
|
12
|
+
def console_command(command, print_now=false)
|
13
13
|
output = []
|
14
14
|
PTY.spawn(command) do |stdin, stdout, pid|
|
15
15
|
stdin.each { |line| output << line; print line if print_now }
|
@@ -13,7 +13,7 @@ class Fanforce::AppFactory::CLI::Scripts
|
|
13
13
|
def setup(type=:all)
|
14
14
|
app = Fanforce::CLI::App.new(Fanforce::CLI::DIR)
|
15
15
|
type = type.to_s.downcase.to_sym
|
16
|
-
error 'Unknown setup type', :setup if ![:all,:bundler,:pow,:git,:env,:uranium].include?(type)
|
16
|
+
error 'Unknown setup type', :setup if ![:all,:bundler,:pow,:git,:bitbucket,:env,:uranium].include?(type)
|
17
17
|
|
18
18
|
if !File.exists?("#{app.dir}/config.ru")
|
19
19
|
error "This does not seem to be a valid app directory since it's missing config.ru"
|
@@ -132,17 +132,20 @@ class Fanforce::AppFactory::CLI::Scripts
|
|
132
132
|
end
|
133
133
|
end
|
134
134
|
|
135
|
-
def install_factory_gem_locally(version,
|
136
|
-
return if !
|
135
|
+
def install_factory_gem_locally(version, local_gem_path)
|
136
|
+
return if !local_gem_path
|
137
137
|
gem_filepath = nil
|
138
|
-
Dir.chdir(
|
138
|
+
Dir.chdir(local_gem_path) do
|
139
139
|
system 'git add -A'
|
140
140
|
system 'rake build'
|
141
|
-
Dir.glob("#{
|
141
|
+
Dir.glob("#{local_gem_path}/pkg/*.gem").each do |file|
|
142
142
|
break gem_filepath = file if file.include?(version)
|
143
143
|
end
|
144
144
|
end
|
145
|
-
|
145
|
+
Dir.chdir(Fanforce::CLI::DIR) do
|
146
|
+
log "INSTALLING #{gem_filepath}..."
|
147
|
+
system "gem install #{gem_filepath}"
|
148
|
+
end
|
146
149
|
end
|
147
150
|
|
148
151
|
end
|
@@ -15,11 +15,12 @@ class Fanforce::AppFactory::CLI::Scripts
|
|
15
15
|
|
16
16
|
Fanforce::CLI.register(self, :setup,
|
17
17
|
['*all/TYPE', 'Setup bundle, pow, git, and env variables'],
|
18
|
-
['bundler',
|
19
|
-
['pow',
|
20
|
-
['git',
|
21
|
-
['
|
22
|
-
['
|
18
|
+
['bundler', 'Ensure bundler is installed then run bundle'],
|
19
|
+
['pow', 'Ensure pow domains are setup correctly'],
|
20
|
+
['git', 'Ensure git repository is initialized'],
|
21
|
+
['bitbucket', 'Setup remote repository on bitbucket'],
|
22
|
+
['env', 'Create ENV variables from local .env folder'],
|
23
|
+
['uranium', 'Register config.json with uranium and add environ']
|
23
24
|
) { require_relative 'cli/scripts/setup' }
|
24
25
|
|
25
26
|
########################################################################################################################
|