source: trunk/build/run-bitten.sh @ 2015

Last change on this file since 2015 was 2015, checked in by sam, 8 years ago

build: shorter machine descriptions in build logs.

  • Property svn:executable set to *
File size: 3.6 KB
Line 
1#!/bin/sh
2
3conffile="`mktemp 2>/dev/null`"
4if [ "$conffile" = "" ]; then
5    conffile="`mktemp -q /tmp/lol-bitten-XXXXXX`"
6fi
7url="http://lol.zoy.org/builds"
8
9append() {
10    echo "$*" >> "$conffile"
11}
12
13#
14# Check for command line
15#
16
17if [ "$#" != 2 ]; then
18    echo "Usage: $0 <username> <password>"
19    exit 1
20fi
21
22#
23# Operating system information
24#
25
26append "[os]"
27append "name = `uname -srmo 2>/dev/null || uname -srm`"
28append "version = 0"
29family="`uname -s | tr A-Z a-z`"
30case "$family" in
31  mingw*) family="windows" ;;
32  darwin*) family="osx" ;;
33esac
34append "family = $family"
35# This random token prevents HTTP conflicts when several instances
36# are run from the same machine.
37append "token = $$$RANDOM"
38append ""
39
40#
41# Hardware information
42#
43
44append "[machine]"
45name="`uname -n | tr A-Z a-z | sed 's/[.].*//'`"
46case "$name" in
47  d*e*s*o*v*) name="putois" ;;
48esac
49append "name = $name"
50processor="`uname -m`"
51case "$processor" in
52  x86_64) processor="amd64" ;;
53  i*86) processor="i386" ;;
54esac
55# Windows defines a lot of crazy shit, try to make sense of it
56case "$PROCESSOR_ARCHITECTURE" in
57  amd64|AMD64) processor="amd64" ;;
58  x86|X86) processor="i386" ;;
59esac
60case "$PROCESSOR_ARCHITEW6432" in
61  amd64|AMD64) processor="amd64" ;;
62  x86|X86) processor="i386" ;;
63esac
64append "processor = $processor"
65append ""
66
67#
68# Authentication information
69#
70
71append "[authentication]"
72append "username = $1"
73append "password = $2"
74append ""
75
76#
77# Visual Studio configuration
78#
79
80# FIXME: we also need to check for the Visual Studio SDK
81append "[msvc]"
82if [ -n "$VS100COMNTOOLS" ]; then
83    append "version = 10"
84elif [ -n "$VS110COMNTOOLS" ]; then
85    append "version = 11"
86elif [ -n "$VS90COMNTOOLS" ]; then
87    append "version = 9"
88fi
89append ""
90
91#
92# Xbox development kit
93#
94
95append "[xdk]"
96if [ -n "$XEDK" ]; then
97    # FIXME: we don't know how to check the version
98    append "version = 2.0.20675.0"
99fi
100append ""
101
102#
103# PS3 development kit
104#
105
106append "[ps3sdk]"
107# Try to "detect" the SNC compiler on Windows
108if [ -n "$SN_PS3_PATH" ]; then
109    append "version = 410"
110fi
111# The setup is easier to detect on Linux
112if [ -f "$CELLSDK/version-SDK" ]; then
113    append "version = $(cat "$CELLSDK/version-SDK")"
114fi
115append ""
116
117#
118# mingw32 / mingw-w64
119#
120
121append "[mingw64]"
122if x86_64-w64-mingw32-g++ --version >/dev/null 2>&1; then
123    append "version = $(x86_64-w64-mingw32-g++ --version | sed -ne 's/.*g++ *([^)]*) *//p')"
124fi
125append ""
126
127append "[mingw32]"
128if i686-w64-mingw32-g++ --version >/dev/null 2>&1; then
129    append "version = $(i686-w64-mingw32-g++ --version | sed -ne 's/.*g++ *([^)]*) *//p')"
130fi
131append ""
132
133#
134# Android NDK
135#
136
137append "[ndk]"
138if [ "$family" != "windows" ]; then
139    if [ -f "$ANDROID_NDK_ROOT/RELEASE.TXT" ]; then
140        append "version = $(cat "$ANDROID_NDK_ROOT/RELEASE.TXT")"
141    fi
142fi
143append ""
144
145#
146# Google NaCl SDK
147#
148
149append "[pepper]"
150if [ "$family" != "windows" ]; then
151    if [ -d "$NACL_SDK_ROOT" ]; then
152        pepper_version=0
153        for dir in "$NACL_SDK_ROOT/pepper_"*; do
154            new_version="$(echo "$dir" | sed 's/.*_//')"
155            if [ "$new_version" -gt "$pepper_version" ]; then
156                pepper_version="$new_version"
157            fi
158        done
159        if [ "$pepper_version" != 0 ]; then
160            append "version = $pepper_version"
161        fi
162    fi
163fi
164append ""
165
166#
167# Raspberry Pi cross-compiler
168#
169
170append "[raspi]"
171if [ "$family" != "windows" ]; then
172    if [ -d "$RASPI_SDK_ROOT/tools" ]; then
173        append "version = 0"
174    fi
175fi
176append ""
177
178#
179# Show what we just did here
180#
181
182cat "$conffile"
183
184#
185# Launch everything
186#
187
188while : ; do
189    bitten-slave "$url" -f "$conffile" --name "$name"
190    sleep 10
191done
192
193rm -f "$conffile"
194
Note: See TracBrowser for help on using the repository browser.