Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

cleanup

  • Loading branch information...
commit 7805b0d1e59527c679ad808e2c525e9c729988bc 1 parent 0ba5a81
Sven Fuchs authored December 29, 2012
2  lib/travis/build.rb
@@ -7,7 +7,7 @@ module Build
7 7
     autoload :Shell,    'travis/build/shell'
8 8
 
9 9
     HOME_DIR  = '~'
10  
-    BUILD_DIR = '~/builds'
  10
+    BUILD_DIR = '~/build'
11 11
 
12 12
     LOGS = {
13 13
       build: '~/build.log',
12  lib/travis/build/data.rb
@@ -76,13 +76,13 @@ def travis_env
76 76
           {
77 77
             TRAVIS_PULL_REQUEST:    pull_request?,
78 78
             TRAVIS_SECURE_ENV_VARS: secure_env_vars?,
79  
-            TRAVIS_BUILD_ID:        source[:id],
80  
-            TRAVIS_BUILD_NUMBER:    source[:number],
  79
+            TRAVIS_BUILD_ID:        build[:id],
  80
+            TRAVIS_BUILD_NUMBER:    build[:number],
81 81
             TRAVIS_JOB_ID:          job[:id],
82 82
             TRAVIS_JOB_NUMBER:      job[:number],
83 83
             TRAVIS_BRANCH:          job[:branch],
84  
-            TRAVIS_COMMIT_RANGE:    job[:commit_range],
85  
-            TRAVIS_COMMIT:          job[:commit]
  84
+            TRAVIS_COMMIT:          job[:commit],
  85
+            TRAVIS_COMMIT_RANGE:    job[:commit_range]
86 86
           }
87 87
         end
88 88
 
@@ -100,8 +100,8 @@ def job
100 100
           config[:job] || {}
101 101
         end
102 102
 
103  
-        def source
104  
-          config[:source] || {}
  103
+        def build
  104
+          config[:source] || config[:build] || {} # TODO standarize the payload on :build
105 105
         end
106 106
 
107 107
         def repository
8  lib/travis/build/script/git.rb
@@ -5,7 +5,6 @@ module Git
5 5
         def checkout
6 6
           clone
7 7
           rm_key
8  
-          chdir
9 8
           fetch_ref if data.ref
10 9
           git_checkout
11 10
           submodules
@@ -16,18 +15,13 @@ def checkout
16 15
 
17 16
           def clone
18 17
             set 'GIT_ASKPASS', 'echo', :echo => false # this makes git interactive auth fail
19  
-            raw "rm -rf #{data.slug}"
20  
-            cmd "git clone --depth=100 --quiet #{data.source_url} #{data.slug}", assert: true, timeout: :git_clone
  18
+            cmd "git clone --depth=100 --quiet #{data.source_url} .", assert: true, timeout: :git_clone
21 19
           end
22 20
 
23 21
           def rm_key
24 22
             raw 'rm -f ~/.ssh/source_rsa'
25 23
           end
26 24
 
27  
-          def chdir
28  
-            cd data.slug
29  
-          end
30  
-
31 25
           def fetch_ref
32 26
             cmd "git fetch origin +#{data.ref}: ", assert: true, timeout: :git_fetch_ref
33 27
           end
3  lib/travis/build/script/templates/header.sh
@@ -27,8 +27,9 @@ travis_timeout() {
27 27
   wait $pid
28 28
 }
29 29
 
  30
+rm -rf   <%= BUILD_DIR %>
30 31
 mkdir -p <%= BUILD_DIR %>
31  
-cd <%= BUILD_DIR %>
  32
+cd       <%= BUILD_DIR %>
32 33
 
33 34
 <%= LOGS.map { |name, path| "touch #{path}; > #{path}" }.join("\n") %>
34 35
 
30  play/build.sh
@@ -27,8 +27,9 @@ travis_timeout() {
27 27
   wait $pid
28 28
 }
29 29
 
30  
-mkdir -p ~/builds
31  
-cd ~/builds
  30
+rm -rf   ~/build
  31
+mkdir -p ~/build
  32
+cd       ~/build
32 33
 
33 34
 touch ~/build.log; > ~/build.log
34 35
 touch ~/state.log; > ~/state.log
@@ -63,30 +64,27 @@ echo \#\!/usr/bin/env\ ruby'
63 64
 chmod +x ~/travis_stream
64 65
 
65 66
 
66  
-  ~/travis_stream ~/build.log http://localhost:3000/logs/1 &
  67
+  ~/travis_stream ~/build.log http://localhost:3000/jobs/1/logs &
67 68
 travis_start 'export'
68 69
 TRAVIS_PULL_REQUEST=false
69 70
 TRAVIS_SECURE_ENV_VARS=false
70 71
 TRAVIS_BUILD_ID=1
71  
-TRAVIS_BUILD_NUMBER=
72  
-TRAVIS_JOB_ID=
73  
-TRAVIS_JOB_NUMBER=
74  
-TRAVIS_BRANCH=
75  
-TRAVIS_COMMIT_RANGE=
  72
+TRAVIS_BUILD_NUMBER=1
  73
+TRAVIS_JOB_ID=1
  74
+TRAVIS_JOB_NUMBER=1.1
  75
+TRAVIS_BRANCH=master
76 76
 TRAVIS_COMMIT=a214c21
77  
-TRAVIS_RUBY_VERSION=default
  77
+TRAVIS_COMMIT_RANGE=abcdefg..a214c21
  78
+TRAVIS_RUBY_VERSION=1.9.3
78 79
 travis_end 'export'
79 80
 
80 81
 travis_start 'checkout'
81 82
 GIT_ASKPASS=echo
82  
-rm -rf travis-ci/travis-support
83  
-echo \$\ git\ clone\ --depth\=100\ --quiet\ http://github.com/travis-ci/travis-support.git\ travis-ci/travis-support >> ~/build.log 2>&1
84  
-((git clone --depth=100 --quiet http://github.com/travis-ci/travis-support.git travis-ci/travis-support) >> ~/build.log 2>&1) &
  83
+echo \$\ git\ clone\ --depth\=100\ --quiet\ http://github.com/travis-ci/travis-support.git\ . >> ~/build.log 2>&1
  84
+((git clone --depth=100 --quiet http://github.com/travis-ci/travis-support.git .) >> ~/build.log 2>&1) &
85 85
 travis_timeout 300
86 86
 travis_assert
87 87
 rm -f ~/.ssh/source_rsa
88  
-echo \$\ cd\ travis-ci/travis-support >> ~/build.log 2>&1
89  
-cd travis-ci/travis-support
90 88
 echo \$\ git\ checkout\ -qf\ a214c21 >> ~/build.log 2>&1
91 89
 (git checkout -qf a214c21) >> ~/build.log 2>&1
92 90
 travis_assert
@@ -102,8 +100,8 @@ fi
102 100
 travis_end 'checkout'
103 101
 
104 102
 travis_start 'setup'
105  
-echo \$\ rvm\ use\ default >> ~/build.log 2>&1
106  
-(rvm use default) >> ~/build.log 2>&1
  103
+echo \$\ rvm\ use\ 1.9.3 >> ~/build.log 2>&1
  104
+(rvm use 1.9.3) >> ~/build.log 2>&1
107 105
 travis_assert
108 106
 if [[ -f Gemfile ]]; then
109 107
   BUNDLE_GEMFILE=$pwd/Gemfile
33  play/compile.rb
@@ -5,27 +5,34 @@
5 5
 
6 6
 config = {
7 7
   urls: {
8  
-    logs:  'http://localhost:3000/logs/1',
9  
-    # state: 'http://requestb.in/12g6u3e1'
  8
+    logs:  'http://localhost:3000/jobs/1/logs',
  9
+    # state:  'http://localhost:3000/jobs/1/state', # not sure about this ...
10 10
   },
11 11
   repository: {
12  
-    source_url: 'http://github.com/travis-ci/travis-support.git',
13  
-    slug: 'travis-ci/travis-support'
  12
+    source_url: 'http://github.com/travis-ci/travis-support.git'
14 13
   },
15 14
   source: {
16  
-    id: 1
  15
+    id: 1,
  16
+    number: 1
17 17
   },
18 18
   job: {
  19
+    id: 1,
  20
+    number: '1.1',
  21
+    branch: 'master',
19 22
     commit: 'a214c21',
  23
+    commit_range: 'abcdefg..a214c21',
  24
+    pull_request: false
20 25
   },
21  
-  rvm: '1.9.3',
22  
-  # language: 'c',
23  
-  # services: ['redis'],
24  
-  # after_success: 'yo dawg',
25  
-  # after_failure: 'yo kaputt',
26  
-  # after_script: 'travis-artifacts upload shit'
27  
-  # jdk: 'jdk-foo'
28  
-  # script: 'bundle exec rspec'
  26
+  config: {
  27
+    rvm: '1.9.3',
  28
+    # language: 'c',
  29
+    # services: ['redis'],
  30
+    # after_success: 'yo dawg',
  31
+    # after_failure: 'yo kaputt',
  32
+    # after_script: 'travis-artifacts upload shit'
  33
+    # jdk: 'jdk-foo'
  34
+    # script: 'bundle exec rspec'
  35
+  }
29 36
 }
30 37
 
31 38
 script = Travis::Build.script(config)

0 notes on commit 7805b0d

Please sign in to comment.
Something went wrong with that request. Please try again.