[DEV] add basic bdd creation

This commit is contained in:
Edouard DUPIN 2016-10-24 22:53:24 +02:00
parent 7af54c4f13
commit 13d109f081
3 changed files with 37 additions and 7 deletions

30
bdd.sql
View File

@ -10,6 +10,36 @@
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- Structure de la table `BUILD_list`
--
CREATE TABLE IF NOT EXISTS `BUILD_list` (
`id` int(11) NOT NULL,
`time` int(11) NOT NULL,
`id-group` int(32) NOT NULL,
`sha1` varchar(512) NOT NULL,
`tag` varchar(512) NOT NULL,
`status` enum('UNKNOW','START','ERROR','OK') NOT NULL DEFAULT 'UNKNOW'
) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
--
-- Structure de la table `BUILD_snapshot`
--
CREATE TABLE IF NOT EXISTS `BUILD_snapshot` (
`id-build` varchar(256) NOT NULL,
`id-group` int(11) NOT NULL DEFAULT '0',
`Linux` enum('UNKNOW','START','ERROR','OK') NOT NULL DEFAULT 'UNKNOW',
`Windows` enum('UNKNOW','START','ERROR','OK') NOT NULL DEFAULT 'UNKNOW',
`MacOs` enum('UNKNOW','START','ERROR','OK') NOT NULL DEFAULT 'UNKNOW',
`IOs` enum('UNKNOW','START','ERROR','OK') NOT NULL DEFAULT 'UNKNOW',
`Android` enum('UNKNOW','START','ERROR','OK') NOT NULL DEFAULT 'UNKNOW'
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
-- Structure de la table `CI_group`
--

View File

@ -115,7 +115,7 @@ if ($idGroup <= -1) {
if ($result == TRUE) {
echo("[OK] registered done (new entry)");
} else {
echo("[ERROR] Can not register in db ... (snapshot)");
echo("[ERROR] Can not register in db ... (snapshot 1)");
}
} else {
// try to update the curent values:
@ -126,7 +126,7 @@ if ($idGroup <= -1) {
if ($result == TRUE) {
echo("[OK] registered done (update)");
} else {
echo("[ERROR] Can not register in db ... (snapshot)");
echo("[ERROR] Can not register in db ... (snapshot 2)");
}
}
}

View File

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python2
##
## @author Edouard DUPIN
##
@ -42,7 +42,7 @@ if args.status not in ['START', 'OK', 'ERROR']:
args.status = 'ERROR'
if args.test == True:
args.url = 'http://127.0.0.1/build/inject.php'
args.url = 'http://atria-soft.com/ci/build/inject'
args.repo = 'HeeroYui/test'
args.sha1 = ''
args.branch = 'master'
@ -102,10 +102,10 @@ data = urllib.urlencode({'REPO':args.repo,
req = urllib2.Request(args.url, data)
response = urllib2.urlopen(req)
#print response.geturl()
#print response.info()
#print(response.geturl())
#print(response.info())
return_data = response.read()
print return_data
print(return_data)
if return_data[:7] == "[ERROR]":
exit(-1)