From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1Qs11x-0004Ve-8H for garchives@archives.gentoo.org; Fri, 12 Aug 2011 23:20:45 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B77FC21C492; Fri, 12 Aug 2011 23:18:02 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 7588921C490 for ; Fri, 12 Aug 2011 23:18:02 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 0BC401B4022 for ; Fri, 12 Aug 2011 23:18:02 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 5DF9E80043 for ; Fri, 12 Aug 2011 23:18:01 +0000 (UTC) From: "Liam McLoughlin" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Liam McLoughlin" Message-ID: <20aaffd05379b748bb7455bdbbee2d92a13c370a.hexxeh@gentoo> Subject: [gentoo-commits] proj/gentoaster:master commit in: / X-VCS-Repository: proj/gentoaster X-VCS-Files: README install.php X-VCS-Directories: / X-VCS-Committer: hexxeh X-VCS-Committer-Name: Liam McLoughlin X-VCS-Revision: 20aaffd05379b748bb7455bdbbee2d92a13c370a Date: Fri, 12 Aug 2011 23:18:01 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: c17d4f5c3908e9d3c5bd2f81ca9108e7 Message-ID: <20110812231801.ORV270x6LTBJ2jFrdpkuXrp_7crI4TIj_fUN2QIzrKo@z> commit: 20aaffd05379b748bb7455bdbbee2d92a13c370a Author: Liam McLoughlin hexxeh net> AuthorDate: Thu Aug 11 20:19:05 2011 +0000 Commit: Liam McLoughlin hexxeh net> CommitDate: Thu Aug 11 20:19:05 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/gentoaster.gi= t;a=3Dcommit;h=3D20aaffd0 Added basic installer script and updated README appropriately --- README | 14 +++++++---- install.php | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++++= ++++++ 2 files changed, 83 insertions(+), 5 deletions(-) diff --git a/README b/README index ddf981e..7a06bf4 100644 --- a/README +++ b/README @@ -4,7 +4,7 @@ =20 Foreword =3D=3D=3D=3D=3D=3D=3D -Right now I'm developing this on Ubuntu/Debian, so the following instruc= tions are for those platforms. This will eventually run on Gentoo, of cou= rse. +Right now I'm developing this on Ubuntu/Debian, so the following instruc= tions are for those platforms. If you install the appropriate prerequisit= es, it will work on Gentoo too, of course. =20 =20 Prerequisites @@ -39,16 +39,18 @@ Installation =20 cd /usr/share git clone http://git.overlays.gentoo.org/gitroot/proj/gentoaster.git - +Configure settings in config.php and web/config.php as appropriate +Run php5 install.php as root +Configure a webserver of your choice to server the web folder on the add= ress you specified =20 Running =3D=3D=3D=3D=3D=3D=3D =20 -There's no init script for the daemon yet, so simply run as follows: +The installer will start the daemon for you automatically, but if you ne= ed to do this yourself later, run the following as root: =20 -sudo php5 /usr/share/gentoaster/daemon.php & +/etc/init.d/gentoaster start =20 -Note the use of sudo, the daemon MUST be ran as root for it to work, oth= erwise all builds will fail. +The daemon MUST be ran as root for it to work, otherwise all builds will= fail. =20 Now that the daemon is running, you can try a build, using the sample cl= ient: =20 @@ -65,3 +67,5 @@ php5 /usr/share/gentoaster/status.php Where is the hash returned by client.php (for example 6085= 655f187a8442f82c43ebf98e5fdb) =20 If the build is still running, you'll get a progress percentage. If it's= finished, the return code and result message will be shown. + +If you've setup a webserver, you can also use the WebUI at the address y= ou've configured diff --git a/install.php b/install.php new file mode 100644 index 0000000..8bb3515 --- /dev/null +++ b/install.php @@ -0,0 +1,74 @@ + 0) { + $mysqlPassword =3D " -p ".escapeshellarg(MYSQL_PASSWORD)." "; + } else { + $mysqlPassword =3D " "; + } + =20 + // Drop any existing database here + system('echo "DROP DATABASE IF EXISTS '.$mysqlDatabase.';" | mysql = -u '.$mysqlUsername.$mysqlPassword); + =20 + // Create a new database + system('echo "CREATE DATABASE '.$mysqlDatabase.';" | mysql -u '.$my= sqlUsername.$mysqlPassword); + =20 + // Import the database dump into that database + system('mysql -u '.$mysqlUsername.$mysqlPassword.$mysqlDatabase.' <= gentoaster.sql'); + } else { + die("SQL file not found, check GENTOASTER_PATH\n"); + } + =20 + // Add the initscript for the daemon + echo "Adding initscript symlink\n"; + system("rm -f /etc/init.d/gentoaster"); + system("ln -s ".GENTOASTER_PATH."/gentoaster /etc/init.d/gentoaster"= ); + system("chmod +x ".GENTOASTER_PATH."/gentoaster"); + =20 + echo "Starting Gentoaster daemon\n"; + exec("/etc/init.d/gentoaster start"); + =20 + echo "If you didn't see any errors, the install was successful\n"; + echo "Try visiting the site at ".GENTOASTER_URL." to make sure every= thing works\n"; \ No newline at end of file