lib/evrone/ci/router.rb in evrone-ci-router-0.2.0.pre4 vs lib/evrone/ci/router.rb in evrone-ci-router-0.2.0.pre5
- old
+ new
@@ -68,30 +68,25 @@
end
include Helper::Logger
include Helper::Config
- attr_reader :build, :path_prefix, :repo_dir, :travis
+ attr_reader :build, :travis
- def initialize(build, path_prefix)
+ def initialize(build)
@build = build
- @path_prefix = Pathname.new(path_prefix).expand_path
- @repo_dir = @path_prefix.join(config.repo_dir_name)
- .join(build.message.name)
@travis = nil
end
def perform
log_build do
update_build_status do
- create_repo_dir &&
- fetch_repo &&
- assign_commit_info &&
- load_travis &&
+ load_travis &&
create_and_delivery_build_matrix
end
end
+ build.release
end
def create_and_delivery_build_matrix
matrix = BuildMatrix.new travis
build.jobs_count = matrix.travises.size
@@ -105,25 +100,11 @@
true
end
def load_travis
- @travis = Travis.from_file repo_dir.join(".travis.yml")
+ @travis = Travis.from_yaml build.message.travis
@travis
- end
-
- def create_repo_dir
- FileUtils.mkdir_p(repo_dir) unless repo_dir.directory?
- true
- end
-
- def fetch_repo
- scm.fetch == 0
- end
-
- def assign_commit_info
- build.commit_info = scm.commit_info
- true
end
def log_build
logger.tagged("BUILD #{build.message.id}") do
logger.info "starting build"