Sha256: 7f0133afe72fedbbd9670443895f3582ea5550534cd43fe32201080f26e425e8

Contents?: true

Size: 724 Bytes

Versions: 5

Compression:

Stored size: 724 Bytes

Contents

class SimpleBuild < Task
  
  
  def self.create_for_branch(project,branch)
    create_for_commit(project,branch.commit)
  end
  
  def self.create_for_commit(project,commit)
    build = SimpleBuildConf.new(project.slug).build
    command = "
    cd #{project.project_dir}
    if [ -d #{project.tmp_repo_dir} ]
    then
      rm -Rf #{project.tmp_repo_dir}
    fi
    git clone -s -n #{project.local_repo_dir} #{project.tmp_repo_dir}
    cd #{project.tmp_repo_dir}
    git checkout #{commit.id}
    echo 'building (#{commit.id})'
    #{build}
    "
      
    SimpleBuild.create(
      :name => "Simple build for #{commit.id}.sh",
      :code => command,
      :commit_sha1 => commit.id,
      :project => project)
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ginst-2009.12.8 lib/ginst/ginst_template/plugins/simple_build/app/models/simple_build.rb
ginst-2009.11.24 lib/ginst/ginst_template/plugins/simple_build/app/models/simple_build.rb
ginst-2009.11.23 lib/ginst/ginst_template/plugins/simple_build/app/models/simple_build.rb
ginst-2.0.1 lib/ginst/ginst_template/plugins/simple_build/app/models/simple_build.rb
ginst-2.0.0 lib/ginst/ginst_template/plugins/simple_build/app/models/simple_build.rb