Permalink
Browse files

cleanup

  • Loading branch information...
1 parent 0ba5a81 commit 7805b0d1e59527c679ad808e2c525e9c729988bc @svenfuchs svenfuchs committed Dec 29, 2012
Showing with 44 additions and 44 deletions.
  1. +1 −1 lib/travis/build.rb
  2. +6 −6 lib/travis/build/data.rb
  3. +1 −7 lib/travis/build/script/git.rb
  4. +2 −1 lib/travis/build/script/templates/header.sh
  5. +14 −16 play/build.sh
  6. +20 −13 play/compile.rb
View
@@ -7,7 +7,7 @@ module Build
autoload :Shell, 'travis/build/shell'
HOME_DIR = '~'
- BUILD_DIR = '~/builds'
+ BUILD_DIR = '~/build'
LOGS = {
build: '~/build.log',
@@ -76,13 +76,13 @@ def travis_env
{
TRAVIS_PULL_REQUEST: pull_request?,
TRAVIS_SECURE_ENV_VARS: secure_env_vars?,
- TRAVIS_BUILD_ID: source[:id],
- TRAVIS_BUILD_NUMBER: source[:number],
+ TRAVIS_BUILD_ID: build[:id],
+ TRAVIS_BUILD_NUMBER: build[:number],
TRAVIS_JOB_ID: job[:id],
TRAVIS_JOB_NUMBER: job[:number],
TRAVIS_BRANCH: job[:branch],
- TRAVIS_COMMIT_RANGE: job[:commit_range],
- TRAVIS_COMMIT: job[:commit]
+ TRAVIS_COMMIT: job[:commit],
+ TRAVIS_COMMIT_RANGE: job[:commit_range]
}
end
@@ -100,8 +100,8 @@ def job
config[:job] || {}
end
- def source
- config[:source] || {}
+ def build
+ config[:source] || config[:build] || {} # TODO standarize the payload on :build
end
def repository
@@ -5,7 +5,6 @@ module Git
def checkout
clone
rm_key
- chdir
fetch_ref if data.ref
git_checkout
submodules
@@ -16,18 +15,13 @@ def checkout
def clone
set 'GIT_ASKPASS', 'echo', :echo => false # this makes git interactive auth fail
- raw "rm -rf #{data.slug}"
- cmd "git clone --depth=100 --quiet #{data.source_url} #{data.slug}", assert: true, timeout: :git_clone
+ cmd "git clone --depth=100 --quiet #{data.source_url} .", assert: true, timeout: :git_clone
end
def rm_key
raw 'rm -f ~/.ssh/source_rsa'
end
- def chdir
- cd data.slug
- end
-
def fetch_ref
cmd "git fetch origin +#{data.ref}: ", assert: true, timeout: :git_fetch_ref
end
@@ -27,8 +27,9 @@ travis_timeout() {
wait $pid
}
+rm -rf <%= BUILD_DIR %>
mkdir -p <%= BUILD_DIR %>
-cd <%= BUILD_DIR %>
+cd <%= BUILD_DIR %>
<%= LOGS.map { |name, path| "touch #{path}; > #{path}" }.join("\n") %>
View
@@ -27,8 +27,9 @@ travis_timeout() {
wait $pid
}
-mkdir -p ~/builds
-cd ~/builds
+rm -rf ~/build
+mkdir -p ~/build
+cd ~/build
touch ~/build.log; > ~/build.log
touch ~/state.log; > ~/state.log
@@ -63,30 +64,27 @@ echo \#\!/usr/bin/env\ ruby'
chmod +x ~/travis_stream
- ~/travis_stream ~/build.log http://localhost:3000/logs/1 &
+ ~/travis_stream ~/build.log http://localhost:3000/jobs/1/logs &
travis_start 'export'
TRAVIS_PULL_REQUEST=false
TRAVIS_SECURE_ENV_VARS=false
TRAVIS_BUILD_ID=1
-TRAVIS_BUILD_NUMBER=
-TRAVIS_JOB_ID=
-TRAVIS_JOB_NUMBER=
-TRAVIS_BRANCH=
-TRAVIS_COMMIT_RANGE=
+TRAVIS_BUILD_NUMBER=1
+TRAVIS_JOB_ID=1
+TRAVIS_JOB_NUMBER=1.1
+TRAVIS_BRANCH=master
TRAVIS_COMMIT=a214c21
-TRAVIS_RUBY_VERSION=default
+TRAVIS_COMMIT_RANGE=abcdefg..a214c21
+TRAVIS_RUBY_VERSION=1.9.3
travis_end 'export'
travis_start 'checkout'
GIT_ASKPASS=echo
-rm -rf travis-ci/travis-support
-echo \$\ git\ clone\ --depth\=100\ --quiet\ http://github.com/travis-ci/travis-support.git\ travis-ci/travis-support >> ~/build.log 2>&1
-((git clone --depth=100 --quiet http://github.com/travis-ci/travis-support.git travis-ci/travis-support) >> ~/build.log 2>&1) &
+echo \$\ git\ clone\ --depth\=100\ --quiet\ http://github.com/travis-ci/travis-support.git\ . >> ~/build.log 2>&1
+((git clone --depth=100 --quiet http://github.com/travis-ci/travis-support.git .) >> ~/build.log 2>&1) &
travis_timeout 300
travis_assert
rm -f ~/.ssh/source_rsa
-echo \$\ cd\ travis-ci/travis-support >> ~/build.log 2>&1
-cd travis-ci/travis-support
echo \$\ git\ checkout\ -qf\ a214c21 >> ~/build.log 2>&1
(git checkout -qf a214c21) >> ~/build.log 2>&1
travis_assert
@@ -102,8 +100,8 @@ fi
travis_end 'checkout'
travis_start 'setup'
-echo \$\ rvm\ use\ default >> ~/build.log 2>&1
-(rvm use default) >> ~/build.log 2>&1
+echo \$\ rvm\ use\ 1.9.3 >> ~/build.log 2>&1
+(rvm use 1.9.3) >> ~/build.log 2>&1
travis_assert
if [[ -f Gemfile ]]; then
BUNDLE_GEMFILE=$pwd/Gemfile
View
@@ -5,27 +5,34 @@
config = {
urls: {
- logs: 'http://localhost:3000/logs/1',
- # state: 'http://requestb.in/12g6u3e1'
+ logs: 'http://localhost:3000/jobs/1/logs',
+ # state: 'http://localhost:3000/jobs/1/state', # not sure about this ...
},
repository: {
- source_url: 'http://github.com/travis-ci/travis-support.git',
- slug: 'travis-ci/travis-support'
+ source_url: 'http://github.com/travis-ci/travis-support.git'
},
source: {
- id: 1
+ id: 1,
+ number: 1
},
job: {
+ id: 1,
+ number: '1.1',
+ branch: 'master',
commit: 'a214c21',
+ commit_range: 'abcdefg..a214c21',
+ pull_request: false
},
- rvm: '1.9.3',
- # language: 'c',
- # services: ['redis'],
- # after_success: 'yo dawg',
- # after_failure: 'yo kaputt',
- # after_script: 'travis-artifacts upload shit'
- # jdk: 'jdk-foo'
- # script: 'bundle exec rspec'
+ config: {
+ rvm: '1.9.3',
+ # language: 'c',
+ # services: ['redis'],
+ # after_success: 'yo dawg',
+ # after_failure: 'yo kaputt',
+ # after_script: 'travis-artifacts upload shit'
+ # jdk: 'jdk-foo'
+ # script: 'bundle exec rspec'
+ }
}
script = Travis::Build.script(config)

0 comments on commit 7805b0d

Please sign in to comment.