nixenvironment 0.0.8
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.
- checksums.yaml +7 -0
- data/.gitignore +16 -0
- data/Gemfile +3 -0
- data/LICENSE.txt +22 -0
- data/README.md +34 -0
- data/Rakefile +1 -0
- data/bin/nixenvironment +303 -0
- data/gemify.sh +41 -0
- data/lib/nixenvironment.rb +2 -0
- data/lib/nixenvironment/config.rb +12 -0
- data/lib/nixenvironment/version.rb +3 -0
- data/nixenvironment.gemspec +24 -0
- metadata +114 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: cb46f15cc9b3336e295e430809edbe5094502733
|
4
|
+
data.tar.gz: cfd5f3224cb1f4700d87778cf9e4871f5cd34276
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 43064f58d004c8498a7adf8ab12a40b576b2d15e07be2c52fca0d2e834c55ff6dd639d8c9b0bf02483562f5d827aab5e2b4a69af0a2b4517d35cac3631c3a28d
|
7
|
+
data.tar.gz: 2859e5496959b3064ff010fb9fcffd224a1378aa9d75723be1ffdca01526a999c00d0b2ff60717f03b977f5f5d95e89aeaf75e500fc1428d6d1b552c25a2e128
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 Karen Arzumanian
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
# Nixenvironment
|
2
|
+
|
3
|
+
Nixenvironment installs, updates and manages inner NIX environment stuff to make build and deploy for NIX projects, etc.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
$ gem install nixenvironment
|
8
|
+
|
9
|
+
## Usage
|
10
|
+
|
11
|
+
COMMANDS:
|
12
|
+
|
13
|
+
build Build project for selected configuration and make signed/resigned ipa
|
14
|
+
clean Remove temp files and clean all targets for xcode project
|
15
|
+
deploy Deploy build to mds
|
16
|
+
help Display global or [command] help documentation
|
17
|
+
update Install or update ninbas and other environment stuff
|
18
|
+
|
19
|
+
GLOBAL OPTIONS:
|
20
|
+
|
21
|
+
-h, --help
|
22
|
+
Display help documentation
|
23
|
+
|
24
|
+
-v, --version
|
25
|
+
Display version information
|
26
|
+
|
27
|
+
-t, --trace
|
28
|
+
Display backtrace when an error occurs
|
29
|
+
|
30
|
+
## TODO:
|
31
|
+
|
32
|
+
1. Move project adjuster to this gem.
|
33
|
+
2. Implement bunch ipa making and deployment.
|
34
|
+
3. Implement next commands: |test|, |code_duplication_report|, |tag|, |svn_tag_from_jenkins|, |clean_working_copy|, etc.
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
data/bin/nixenvironment
ADDED
@@ -0,0 +1,303 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'nixenvironment'
|
5
|
+
require 'commander/import'
|
6
|
+
require 'yaml'
|
7
|
+
|
8
|
+
include Nixenvironment
|
9
|
+
|
10
|
+
# :name is optional, otherwise uses the basename of this executable
|
11
|
+
program :name, 'nixenvironment'
|
12
|
+
program :version, VERSION
|
13
|
+
program :description, 'NIX projects build and deploy utility'
|
14
|
+
|
15
|
+
command :update do |c|
|
16
|
+
c.syntax = 'nixenvironment update'
|
17
|
+
c.description = 'Install or update ninbas and other environment stuff'
|
18
|
+
c.option '--ninbas NAME', String, 'Select ninbas branch, tag or revision to clone'
|
19
|
+
c.action do |args, options|
|
20
|
+
update(options.ninbas)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
command :build do |c|
|
25
|
+
c.syntax = 'nixenvironment build [options]'
|
26
|
+
c.description = 'Build project for selected configuration and make signed/resigned ipa'
|
27
|
+
c.option '--config NAME', String, 'Select configuration'
|
28
|
+
c.option '--ipa NAME', String, 'Select sign'
|
29
|
+
c.action do |args, options|
|
30
|
+
options.default :config => 'Debug', :ipa => 'ipa'
|
31
|
+
read_config
|
32
|
+
build_settings = setup(options.config)
|
33
|
+
prebuild(build_settings)
|
34
|
+
build(options.config, options.ipa)
|
35
|
+
revert_info_plist
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
command :deploy do |c|
|
40
|
+
c.syntax = 'nixenvironment deploy'
|
41
|
+
c.description = 'Deploy build to mds'
|
42
|
+
c.action do |args, options|
|
43
|
+
read_config
|
44
|
+
deploy
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
command :clean do |c|
|
49
|
+
c.syntax = 'nixenvironment clean'
|
50
|
+
c.description = 'Remove temp files and clean all targets for xcode project'
|
51
|
+
c.action do |args, options|
|
52
|
+
clean
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
def update(ninbas)
|
57
|
+
root_working_directory = Dir.pwd
|
58
|
+
target_directory = File.join(Dir.home, NIXENV_ROOT)
|
59
|
+
|
60
|
+
begin
|
61
|
+
Dir.mkdir(target_directory) unless Dir.exist?(target_directory)
|
62
|
+
Dir.chdir(target_directory)
|
63
|
+
|
64
|
+
REPO_LIST.each do |repo_name, repo_url|
|
65
|
+
unless Dir.exist?(repo_name)
|
66
|
+
clone_success = system("git clone #{repo_url} --recursive")
|
67
|
+
|
68
|
+
unless clone_success
|
69
|
+
p("Authentication failed for #{repo_name} project!")
|
70
|
+
next
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
Dir.chdir(repo_name)
|
75
|
+
|
76
|
+
if repo_name == BUILD_SCRIPTS
|
77
|
+
if ninbas
|
78
|
+
#TODO: rework me please!
|
79
|
+
system("git checkout #{ninbas}")
|
80
|
+
Dir.chdir('..')
|
81
|
+
next
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
system("git fetch -t")
|
86
|
+
tags = IO.popen('git tag').readlines
|
87
|
+
tags.map! { |tag| tag = tag.strip }
|
88
|
+
|
89
|
+
if tags.size > 0
|
90
|
+
p("Checkout newest #{repo_name} tag...")
|
91
|
+
system("git checkout #{tags.last}")
|
92
|
+
end
|
93
|
+
#TODO: hadle tags.size == 0
|
94
|
+
|
95
|
+
p("Checkout #{repo_name} #{tags.last} tag success!")
|
96
|
+
|
97
|
+
Dir.chdir('..')
|
98
|
+
end
|
99
|
+
rescue
|
100
|
+
@error_message = "#{$!}"
|
101
|
+
ensure
|
102
|
+
p(@error_message) if @error_message
|
103
|
+
Dir.chdir(root_working_directory)
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
def read_config
|
108
|
+
begin
|
109
|
+
@config = YAML.load(File.read('Config'))
|
110
|
+
rescue
|
111
|
+
abort('Config file processing error!')
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
115
|
+
def working_copy_is_clean?
|
116
|
+
is_clean = system("
|
117
|
+
LAST_REVISION_FILE=\"_last_revision.sh\"
|
118
|
+
|
119
|
+
source ${LAST_REVISION_FILE}
|
120
|
+
|
121
|
+
if [ ${WORKING_COPY_IS_CLEAN} -eq 1 ]; then
|
122
|
+
echo \"Working copy is clean. Continuing...\"
|
123
|
+
else
|
124
|
+
echo \"error: working copy must not have local modifications.\" 1>&2
|
125
|
+
echo \"You must add following files and folders to .gitignore:\"
|
126
|
+
echo \"$(git status --porcelain)\"
|
127
|
+
exit 1
|
128
|
+
fi")
|
129
|
+
|
130
|
+
return is_clean
|
131
|
+
end
|
132
|
+
|
133
|
+
def setup(config)
|
134
|
+
cmd_output = nil
|
135
|
+
|
136
|
+
if @config['PROJECT_TO_BUILD'] and @config['PROJECT_TO_BUILD'].length > 0
|
137
|
+
cmd_output = %x[ xcodebuild -project #{@config['PROJECT_TO_BUILD']}\
|
138
|
+
-target #{@config['PROJECT_TARGET_TO_BUILD']}\
|
139
|
+
-configuration #{config}\
|
140
|
+
-sdk #{@config['SDK']}\
|
141
|
+
-showBuildSettings ]
|
142
|
+
elsif @config['WORKSPACE_TO_BUILD'] and @config['WORKSPACE_TO_BUILD'].length > 0
|
143
|
+
cmd_output = %x[ xcodebuild -workspace #{@config['WORKSPACE_TO_BUILD']}\
|
144
|
+
-scheme #{@config['WORKSPACE_SCHEME_TO_BUILD']}\
|
145
|
+
-configuration #{config}\
|
146
|
+
-sdk #{@config['SDK']}\
|
147
|
+
-showBuildSettings ]
|
148
|
+
end
|
149
|
+
|
150
|
+
#TODO: handle if cmd_output still nil
|
151
|
+
|
152
|
+
env_vars_list = cmd_output.split(/\n/).reject(&:empty?)
|
153
|
+
|
154
|
+
build_settings = Hash.new
|
155
|
+
|
156
|
+
if env_vars_list and env_vars_list.length > 0
|
157
|
+
build_settings_to_strip = Hash[env_vars_list.map { |it| it.split('=', 2) }]
|
158
|
+
build_settings_to_strip.each do |key, value|
|
159
|
+
if key and value
|
160
|
+
stripped_key = key.strip
|
161
|
+
stripped_value = value.strip
|
162
|
+
build_settings[stripped_key] = stripped_value
|
163
|
+
end
|
164
|
+
end
|
165
|
+
end
|
166
|
+
|
167
|
+
return build_settings
|
168
|
+
end
|
169
|
+
|
170
|
+
def prebuild(build_settings)
|
171
|
+
save_revision_script_path = File.join(BUILD_SCRIPTS_PATH, 'SaveRevision.sh')
|
172
|
+
save_build_env_vars_script_path = File.join(BUILD_SCRIPTS_PATH, 'SaveBuildEnvVars.sh')
|
173
|
+
tag_icons_script_path = File.join(BUILD_SCRIPTS_PATH, 'XcodeIconTagger/tagIcons.sh')
|
174
|
+
update_build_number_script_path = File.join(BUILD_SCRIPTS_PATH, 'UpdateBuildNumber.sh')
|
175
|
+
update_revision_number_script_path = File.join(BUILD_SCRIPTS_PATH, 'UpdateRevisionNumber.sh')
|
176
|
+
|
177
|
+
icon_path = @config['ICONS_PATH']
|
178
|
+
|
179
|
+
system("#{save_revision_script_path}")
|
180
|
+
|
181
|
+
abort unless working_copy_is_clean?
|
182
|
+
|
183
|
+
# TODO: rewrite SaveBuildEnvVars.sh
|
184
|
+
#system("#{save_build_env_vars_script_path}")
|
185
|
+
|
186
|
+
system("
|
187
|
+
echo \"#!/bin/sh\
|
188
|
+
### AUTOGENERATED BY SaveBuildEnvVars.sh; DO NOT EDIT ###
|
189
|
+
PROJECT=\"#{build_settings['PROJECT']}\"
|
190
|
+
BUILT_PRODUCTS_DIR=\"#{build_settings['BUILT_PRODUCTS_DIR']}\"
|
191
|
+
OBJECTS_NORMAL_DIR=\"#{build_settings['OBJECT_FILE_DIR_normal']}\"
|
192
|
+
EXECUTABLE_NAME=\"#{build_settings['EXECUTABLE_NAME']}\"
|
193
|
+
APP_PRODUCT=\"#{build_settings['BUILT_PRODUCTS_DIR']}/#{build_settings['EXECUTABLE_NAME']}.app\"
|
194
|
+
APP_DSYM=\"#{build_settings['BUILT_PRODUCTS_DIR']}/#{build_settings['EXECUTABLE_NAME']}.app.dSYM\"
|
195
|
+
APP_INFOPLIST_FILE=\"#{@config['INFOPLIST_PATH']}\"
|
196
|
+
EMBEDDED_PROFILE=\"#{build_settings['BUILT_PRODUCTS_DIR']}/#{build_settings['EXECUTABLE_NAME']}.app/#{build_settings['EMBEDDED_PROFILE_NAME']}\"
|
197
|
+
TARGET_NAME=\"#{build_settings['TARGET_NAME']}\"
|
198
|
+
CONFIGURATION=\"#{build_settings['CONFIGURATION']}\"
|
199
|
+
SDK_NAME=\"#{build_settings['SDK_NAME']}\"
|
200
|
+
RESIGNED_BUNDLE_ID=\"#{build_settings['RESIGNED_BUNDLE_ID']}\"
|
201
|
+
RESIGNED_BUNDLE_NAME=\"#{build_settings['RESIGNED_BUNDLE_NAME']}\"
|
202
|
+
RESIGNED_ENTITLEMENTS_PATH=\"#{build_settings['RESIGNED_ENTITLEMENTS_PATH']}\"\" > _last_build_vars.sh
|
203
|
+
")
|
204
|
+
|
205
|
+
# TODO: rewrite tagIcons.sh
|
206
|
+
# system("#{tag_icons_script_path} #{icon_path}")
|
207
|
+
|
208
|
+
# Implement all modify things in one script
|
209
|
+
system("#{update_build_number_script_path}")
|
210
|
+
system("#{update_revision_number_script_path}")
|
211
|
+
end
|
212
|
+
|
213
|
+
def build(config, ipa)
|
214
|
+
build_script_path = File.join(BUILD_SCRIPTS_PATH, 'Build.py')
|
215
|
+
|
216
|
+
system("#{build_script_path} --project \"#{@config['PROJECT_TO_BUILD']}\"\
|
217
|
+
--target \"#{@config['PROJECT_TARGET_TO_BUILD']}\"\
|
218
|
+
--workspace \"#{@config['WORKSPACE_TO_BUILD']}\"\
|
219
|
+
--scheme \"#{@config['WORKSPACE_SCHEME_TO_BUILD']}\"\
|
220
|
+
--configuration \"#{config}\"\
|
221
|
+
--sdk \"#{@config['SDK']}\"\
|
222
|
+
--env-var-prefix \"#{@config['ENV_VAR_PREFIX']}\"")
|
223
|
+
|
224
|
+
case ipa
|
225
|
+
# create .ipa file from last built app product
|
226
|
+
when 'ipa'
|
227
|
+
make_script_path = File.join(BUILD_SCRIPTS_PATH, 'MakeIPA.sh')
|
228
|
+
# resign last built app product with iPhone Developer profile and package it into .ipa file
|
229
|
+
when 'resigned_ipa_for_device'
|
230
|
+
make_script_path = File.join(BUILD_SCRIPTS_PATH, 'MakeResignedIPAForDevice.sh')
|
231
|
+
# resign last built app product with iPhone Distribution AdHoc profile and package it into .ipa file
|
232
|
+
when 'resigned_ipa_for_adhoc_distribution'
|
233
|
+
make_script_path = File.join(BUILD_SCRIPTS_PATH, 'MakeResignedIPAForAdHocDistribution.sh')
|
234
|
+
# resign last built app product with Appstore distribution profile and package it into .ipa file
|
235
|
+
when 'resigned_ipa_for_appstore'
|
236
|
+
make_script_path = File.join(BUILD_SCRIPTS_PATH, 'MakeResignedIPAForAppstore.sh')
|
237
|
+
else
|
238
|
+
p("Error: Unknown ipa '#{ipa}'!")
|
239
|
+
end
|
240
|
+
|
241
|
+
system("#{make_script_path}") if defined? make_script_path
|
242
|
+
end
|
243
|
+
|
244
|
+
def revert_info_plist
|
245
|
+
p('Reverting Info.plist ...')
|
246
|
+
system("git checkout #{@config['INFOPLIST_PATH']}")
|
247
|
+
p('Done.')
|
248
|
+
end
|
249
|
+
|
250
|
+
# deploys built artifacts to given server
|
251
|
+
def deploy
|
252
|
+
deploy_script_path = File.join(BUILD_SCRIPTS_PATH, 'Deploy.sh')
|
253
|
+
|
254
|
+
deploy_host = @config['DEPLOY_HOST'].nil? || @config['DEPLOY_HOST'].empty? ? ENV['DEPLOY_HOST'] : @config['DEPLOY_HOST']
|
255
|
+
deploy_path = @config['DEPLOY_PATH'].nil? || @config['DEPLOY_PATH'].empty? ? ENV['DEPLOY_PATH'] : @config['DEPLOY_PATH']
|
256
|
+
deploy_username = @config['DEPLOY_USERNAME'].nil? || @config['DEPLOY_USERNAME'].empty? ? ENV['DEPLOY_USERNAME'] : @config['DEPLOY_USERNAME']
|
257
|
+
deploy_password = @config['DEPLOY_PASSWORD'].nil? || @config['DEPLOY_PASSWORD'].empty? ? ENV['DEPLOY_PASSWORD'] : @config['DEPLOY_PASSWORD']
|
258
|
+
|
259
|
+
system("#{deploy_script_path} #{deploy_host}\
|
260
|
+
#{deploy_path}\
|
261
|
+
#{deploy_username}\
|
262
|
+
#{deploy_password}")
|
263
|
+
end
|
264
|
+
|
265
|
+
def clean
|
266
|
+
remove_temporary_files_script_path = File.join(BUILD_SCRIPTS_PATH, 'RemoveTemporaryFiles.sh')
|
267
|
+
|
268
|
+
system("#{remove_temporary_files_script_path}")
|
269
|
+
system('rm -rf test-results/')
|
270
|
+
system("find . -name \"*.pyc\" -exec rm -rf {} \;")
|
271
|
+
system('xcodebuild -alltargets clean')
|
272
|
+
end
|
273
|
+
|
274
|
+
# # build unit tests and run them in simulator
|
275
|
+
# def test
|
276
|
+
# ${BUILD_SCRIPTS_PATH}Build.py --project "${PROJECT_TO_BUILD}" --target "${PROJECT_TARGET_TO_TEST}" --workspace "${WORKSPACE_TO_BUILD}" --scheme "${WORKSPACE_SCHEME_TO_TEST}" --configuration "Release" --sdk "${SDK_FOR_TESTS}" --env-var-prefix "${ENV_VAR_PREFIX}"
|
277
|
+
# ${BUILD_SCRIPTS_PATH}RunTests.sh
|
278
|
+
# ${BUILD_SCRIPTS_PATH}GenerateCodeCoverageReport.sh "${EXCLUDE_PATTERN_FOR_CODE_COVERAGE}" coverage.xml
|
279
|
+
# end
|
280
|
+
#
|
281
|
+
# # generates code duplication report
|
282
|
+
# def code_duplication_report
|
283
|
+
# ${BUILD_SCRIPTS_PATH}GenerateCodeDuplicationReport.sh "${EXCLUDE_PATTERN_FOR_CODE_DUPLICATION}" duplication.xml
|
284
|
+
# end
|
285
|
+
#
|
286
|
+
# # make SVN/git/mercurial tag, SCM_USERNAME and SCM_PASSWORD must be defined on calling this target
|
287
|
+
# def tag
|
288
|
+
# ${BUILD_SCRIPTS_PATH}MakeTag.sh "${SCM_USERNAME}" "${SCM_PASSWORD}"
|
289
|
+
# end
|
290
|
+
#
|
291
|
+
# # Jenkins stores SVN credentials locally in XML, so this target gets and uses them on making tag by finding the first credential in local credential storage
|
292
|
+
# # additional |echo| is needed in order to add newline, otherwise base64 encoding doesn't work
|
293
|
+
# # ATTENTION: if this script picks up wrong credentials, then you should manually edit subversion.credentials file on Jenkins in order to remove the wrong credential
|
294
|
+
# def svn_tag_from_jenkins:
|
295
|
+
# SCM_USERNAME="$(shell xpath ../subversion.credentials \(//userName\)[1]/text\(\))"\
|
296
|
+
# SCM_PASSWORD="$(shell echo $$(xpath ../subversion.credentials \(//password\)[1]/text\(\) 2>/dev/null && echo) | openssl base64 -d)"
|
297
|
+
#
|
298
|
+
# tag
|
299
|
+
# end
|
300
|
+
#
|
301
|
+
# def clean_working_copy
|
302
|
+
# ${BUILD_SCRIPTS_PATH}CleanWorkingCopy.sh
|
303
|
+
# end
|
data/gemify.sh
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
# Scriptacular - gemify.sh
|
3
|
+
# Create a Ruby gem and push it to rubygems.org
|
4
|
+
# Copyright 2013 Christopher Simpkins
|
5
|
+
# MIT License
|
6
|
+
|
7
|
+
# Enter your gem name below (do not enter version number)
|
8
|
+
# or pass it as the first argument to the shell script
|
9
|
+
GEM_NAME="nixenvironment"
|
10
|
+
|
11
|
+
# Don't touch these
|
12
|
+
GEMSPEC_SUFFIX=".gemspec"
|
13
|
+
GEM_BUILD_CMD="gem build"
|
14
|
+
GEM_PUSH_CMD="gem push"
|
15
|
+
|
16
|
+
# if there is an argument to the script, define the gem name with it
|
17
|
+
if [ $# -eq 1 ]; then
|
18
|
+
GEM_NAME=$1
|
19
|
+
elif [ $# -gt 1 ]; then
|
20
|
+
echo "You entered too many arguments. Please specify the name of your gem as the argument to the script." >&2
|
21
|
+
exit 1
|
22
|
+
fi
|
23
|
+
|
24
|
+
# if the gem name has not been defined, print error message and exit
|
25
|
+
if [ -z "$GEM_NAME" ]; then
|
26
|
+
echo "You did not enter a gem name. Please include it as an argument to the script or hard code it as a variable in the script." >&2
|
27
|
+
exit 1
|
28
|
+
fi
|
29
|
+
|
30
|
+
# run the gem build and parse for the gem release filename
|
31
|
+
GEM_BUILD_NAME=$($GEM_BUILD_CMD "$GEM_NAME$GEMSPEC_SUFFIX" | awk '/File/ {print $2}' -)
|
32
|
+
|
33
|
+
# if the build failed (i.e. no file name obtained above), print error message and exit
|
34
|
+
if [ -z "$GEM_BUILD_NAME" ]; then
|
35
|
+
echo "The gem build failed. Please confirm the gem name and try again." >&2
|
36
|
+
exit 1
|
37
|
+
fi
|
38
|
+
|
39
|
+
# if above succeeded, then push to rubygems.org using the gem that was compiled
|
40
|
+
$GEM_PUSH_CMD $GEM_BUILD_NAME
|
41
|
+
exit 0
|
@@ -0,0 +1,12 @@
|
|
1
|
+
module Nixenvironment
|
2
|
+
NIXENV_ROOT = '.nixenvironment'
|
3
|
+
BUILD_SCRIPTS = 'ninbas'
|
4
|
+
|
5
|
+
BUILD_SCRIPTS_PATH = File.join(Dir.home, NIXENV_ROOT, BUILD_SCRIPTS)
|
6
|
+
|
7
|
+
REPO_LIST = {
|
8
|
+
BUILD_SCRIPTS => 'https://bitbucket.org/nixsolutions/ninbas.git',
|
9
|
+
# 'nixipl' : 'https://bitbucket.org/nixsolutions/nixipl.git',
|
10
|
+
# 'nocl' : 'https://bitbucket.org/nixsolutions/nocl.git'
|
11
|
+
}
|
12
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'nixenvironment/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'nixenvironment'
|
8
|
+
spec.version = Nixenvironment::VERSION
|
9
|
+
spec.authors = ['Karen Arzumanian']
|
10
|
+
spec.email = ['karen.arzumanyan@nixsolutions.com', 'antaresxxi@mail.ru']
|
11
|
+
spec.summary = 'NIX projects build and deploy utility'
|
12
|
+
spec.description = 'Installs, updates and manages inner environment stuff to make build and deploy for NIX projects.'
|
13
|
+
spec.homepage = 'https://rubygems.org/gems/nixenvironment'
|
14
|
+
spec.license = 'MIT'
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.executables = ['nixenvironment']
|
18
|
+
spec.require_paths = ['lib']
|
19
|
+
|
20
|
+
spec.add_dependency 'bundler', '~> 1.7'
|
21
|
+
spec.add_dependency 'rake', '~> 10.0'
|
22
|
+
spec.add_dependency 'cocoapods', '~> 0.34'
|
23
|
+
spec.add_dependency 'commander', '~> 4.2'
|
24
|
+
end
|
metadata
ADDED
@@ -0,0 +1,114 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: nixenvironment
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.8
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Karen Arzumanian
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-11-06 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.7'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.7'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: cocoapods
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0.34'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0.34'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: commander
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '4.2'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '4.2'
|
69
|
+
description: Installs, updates and manages inner environment stuff to make build and
|
70
|
+
deploy for NIX projects.
|
71
|
+
email:
|
72
|
+
- karen.arzumanyan@nixsolutions.com
|
73
|
+
- antaresxxi@mail.ru
|
74
|
+
executables:
|
75
|
+
- nixenvironment
|
76
|
+
extensions: []
|
77
|
+
extra_rdoc_files: []
|
78
|
+
files:
|
79
|
+
- ".gitignore"
|
80
|
+
- Gemfile
|
81
|
+
- LICENSE.txt
|
82
|
+
- README.md
|
83
|
+
- Rakefile
|
84
|
+
- bin/nixenvironment
|
85
|
+
- gemify.sh
|
86
|
+
- lib/nixenvironment.rb
|
87
|
+
- lib/nixenvironment/config.rb
|
88
|
+
- lib/nixenvironment/version.rb
|
89
|
+
- nixenvironment.gemspec
|
90
|
+
homepage: https://rubygems.org/gems/nixenvironment
|
91
|
+
licenses:
|
92
|
+
- MIT
|
93
|
+
metadata: {}
|
94
|
+
post_install_message:
|
95
|
+
rdoc_options: []
|
96
|
+
require_paths:
|
97
|
+
- lib
|
98
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - ">="
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: '0'
|
103
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
104
|
+
requirements:
|
105
|
+
- - ">="
|
106
|
+
- !ruby/object:Gem::Version
|
107
|
+
version: '0'
|
108
|
+
requirements: []
|
109
|
+
rubyforge_project:
|
110
|
+
rubygems_version: 2.2.2
|
111
|
+
signing_key:
|
112
|
+
specification_version: 4
|
113
|
+
summary: NIX projects build and deploy utility
|
114
|
+
test_files: []
|