Commit f729653e authored by jlopez's avatar jlopez
Browse files
parents 5a157f16 8e4e2233
Pipeline #205 passed with stage
in 43 seconds
...@@ -5,15 +5,18 @@ RUN apk --update add php-apache2 php7-session php7-mysqli && rm -f /var/cache/ap ...@@ -5,15 +5,18 @@ RUN apk --update add php-apache2 php7-session php7-mysqli && rm -f /var/cache/ap
RUN mkdir /app && cd /app && \ RUN mkdir /app && cd /app && \
wget https://gitlab.mbb.univ-montp2.fr/jlopez/wicopa/-/archive/v0.4/wicopa-v0.4.tar.gz && \ wget https://gitlab.mbb.univ-montp2.fr/jlopez/wicopa/-/archive/v0.4.1/wicopa-v0.4.1.tar.gz && \
tar -xf wicopa-v0.4.tar.gz && ln -s wicopa-v0.4 wicopa && \ tar -xf wicopa-v0.4.1.tar.gz && ln -s wicopa-v0.4.1 wicopa
cp wicopa/inc/conf/Conf.php.sample wicopa/inc/conf/Conf.php && \
WORKDIR /app/wicopa
RUN cp inc/conf/Conf.php.sample inc/conf/Conf.php && \
chown -R apache:apache /app && \ chown -R apache:apache /app && \
sed -i "s#DB_NAME = ''#DB_NAME = 'wicopa'#" wicopa/inc/conf/Conf.php && \ sed -i "s#DB_NAME = ''#DB_NAME = 'wicopa'#" inc/conf/Conf.php && \
sed -i "s#DB_HOSTNAME = ''#DB_HOSTNAME = 'wicopadb'#" wicopa/inc/conf/Conf.php && \ sed -i "s#DB_HOSTNAME = ''#DB_HOSTNAME = 'wicopadb'#" inc/conf/Conf.php && \
sed -i "s#DB_USERNAME = ''#DB_USERNAME = 'wicopauser'#" wicopa/inc/conf/Conf.php && \ sed -i "s#DB_USERNAME = ''#DB_USERNAME = 'wicopauser'#" inc/conf/Conf.php && \
sed -i "s#DB_PP = ''#DB_PP = 'w1c0Pa5s'#" wicopa/inc/conf/Conf.php && \ sed -i "s#DB_PP = ''#DB_PP = 'w1c0Pa5s'#" inc/conf/Conf.php && \
sed -i "s#'to_replace_with_your_admin_pass'#'450cb0c92db35549cb926efc391df2ceae4b48d1'#" wicopa/inc/conf/Conf.php sed -i "s#'to_replace_with_your_admin_pass'#'450cb0c92db35549cb926efc391df2ceae4b48d1'#" inc/conf/Conf.php
RUN sed -i 's/^#ServerName .*/ServerName localhost:80/g' /etc/apache2/httpd.conf && \ RUN sed -i 's/^#ServerName .*/ServerName localhost:80/g' /etc/apache2/httpd.conf && \
sed -i 's#/var/www/localhost/htdocs#/app/wicopa#g' /etc/apache2/httpd.conf && \ sed -i 's#/var/www/localhost/htdocs#/app/wicopa#g' /etc/apache2/httpd.conf && \
......
stages: stages:
- build - build
- test
- deploy
image: docker:latest
image: tmaier/docker-compose
services: services:
- docker:dind - docker:dind
variables:
DOCKER_DRIVER: overlay2
PrebuildJob: buildJob:
stage: build stage: build
tags: tags:
- bioco - bioco
only:
- master
script: script:
- apk update - apk update
- apk add --no-cache py-pip python-dev libffi-dev openssl-dev gcc libc-dev make wget gzip git net-tools - apk add --no-cache wget gzip git net-tools
- git clone https://gitlab.mbb.univ-montp2.fr/jlopez/wicopa.git - git clone https://gitlab.mbb.univ-montp2.fr/jlopez/wicopa.git
- cd wicopa - cd wicopa
- wget -q http://web.mbb.univ-montp2.fr/download/wicopa.sql.gz - wget -q http://web.mbb.univ-montp2.fr/download/wicopa.sql.gz
- gunzip -d wicopa.sql.gz - gunzip -d wicopa.sql.gz
- pip install docker-compose
BuildJob:
stage: build
script:
- docker-compose --version
- docker info
- docker-compose build - docker-compose build
TestJob:
stage: test
script:
- docker info
RunDeployment:
stage: deploy
tags:
- bioco
script:
- docker-compose up
- netstat -naptu |grep -E "80|3306"
- wget http://127.0.0.1:8000
- cat index.*
<?php
/**
* Created by PhpStorm.
* User: jimmy
* Date: 01/02/19
* Time: 13:55
*/
class Tool
{
}
\ No newline at end of file
...@@ -38,6 +38,7 @@ $visibility = "public"; ...@@ -38,6 +38,7 @@ $visibility = "public";
$description = NULL; $description = NULL;
$author = 0; $author = 0;
$labels = array(); $labels = array();
$tags = "";
if(isset($_POST['containerid'])) { if(isset($_POST['containerid'])) {
$id = $_POST['containerid']; $id = $_POST['containerid'];
...@@ -75,7 +76,13 @@ if(isset($_POST['labels'])) { ...@@ -75,7 +76,13 @@ if(isset($_POST['labels'])) {
$labels = $_POST['labels']; $labels = $_POST['labels'];
} }
$container = new Container($id, $name, $value, $type, $visibility, $description, $author, $today); if(isset($_POST['tags'])) {
$tags = $_POST['tags'];
$tags = preg_replace("/[\n\r]/","",$tags);
$tags = preg_replace(array('/\s{2,}/', '/[\t\n]/'), ' ', $tags);
}
$container = new Container($id, $name, $value, $type, $visibility, $description, $author, $today, $tags);
if($action == "create") { if($action == "create") {
$container->escape($db); $container->escape($db);
......
...@@ -9,70 +9,9 @@ $db = new DBquery(); ...@@ -9,70 +9,9 @@ $db = new DBquery();
$containers = $db->getContainers(); $containers = $db->getContainers();
?> require_once "./inc/php/buildHeader.php";
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.19/css/jquery.dataTables.min.css" crossorigin="anonymous">
<!-- local fallbacks -->
<!--link rel="stylesheet" href="./inc/css/bootstrap.min.css">
<link rel="stylesheet" href="./inc/css/jquery.dataTables.min.css"-->
<link rel="stylesheet" href="./inc/css/style.css">
<script src="./inc/js/jscolor.js"></script>
<title>wicopa</title>
</head>
<body>
<nav class="navbar navbar-expand-md navbar-dark navbar-custom p-1">
<a class="navbar-brand" href="#">WICOPA</a>
<div class="collapse navbar-collapse justify-content-between" id="navbar">
<div class="navbar-nav">
<?php
echo ' <a class="nav-item nav-link" href="./index.php"> Home </a>';
echo ' <a class="nav-item nav-link active" href="./container.php"> Containers </a>';
if(isset($_SESSION['username']) && !empty($_SESSION['username']))
{
if(isset($_SESSION['manage']) && !empty($_SESSION['manage']))
{
echo ' <a class="nav-item nav-link" href="./manage.php"> Manage </a>';
}
}
?>
</div>
<div class="navbar-nav">
<?php
if(isset($_SESSION['username']) && !empty($_SESSION['username']))
{
echo '<a class="nav-item btn btn-primary " href="./action/action_logout.php"> Logout ('.$_SESSION['username'].') </a>';
}
else
{
echo '<a class="nav-item btn btn-primary" href="./login.php"> Login </a>';
}
?>
</div>
</nav>
?>
<div class="container-fluid"> <div class="container-fluid">
...@@ -89,6 +28,7 @@ $containers = $db->getContainers(); ...@@ -89,6 +28,7 @@ $containers = $db->getContainers();
<th>Name</th> <th>Name</th>
<th>Author</th> <th>Author</th>
<th>Labels</th> <th>Labels</th>
<th>Tags</th>
<th>Date</th> <th>Date</th>
<th>Description</th> <th>Description</th>
<th>Action</th> <th>Action</th>
...@@ -154,6 +94,24 @@ $containers = $db->getContainers(); ...@@ -154,6 +94,24 @@ $containers = $db->getContainers();
echo '</td>'; echo '</td>';
$tags = explode( ' ', $container->tags );
$index = 0;
echo '<td>';
foreach ($tags as $tag) {
echo '<span class="badge" style="background:#'."30336b".'; color:#FFFFFF">'.$tag.'</span>';
/*if($index == 3) {
echo '<br/>';
$index = 0;
} else {
$index++;
} */
}
echo '</td>';
echo '<td>' . $container->date . '</td>'; echo '<td>' . $container->date . '</td>';
echo '<td>' . $container->description . '</td>'; echo '<td>' . $container->description . '</td>';
......
...@@ -175,7 +175,7 @@ class DBquery ...@@ -175,7 +175,7 @@ class DBquery
$result = mysqli_query($this->dbh, $sql); $result = mysqli_query($this->dbh, $sql);
$results = array(); $results = array();
while($row = mysqli_fetch_assoc($result)){ while($row = mysqli_fetch_assoc($result)){
$cnt = new Container($row['ID'], $row['name'], $row['value'], $row['type'], $row['visibility'], $row['description'], $row['author'], $row['date']); $cnt = new Container($row['ID'], $row['name'], $row['value'], $row['type'], $row['visibility'], $row['description'], $row['author'], $row['date'], $row['tags']);
array_push($results, $cnt); array_push($results, $cnt);
} }
return $results; return $results;
......
...@@ -5,13 +5,14 @@ var PREVIEW = ""; ...@@ -5,13 +5,14 @@ var PREVIEW = "";
$( "#generateButton" ).click(function() { $( "#generateButton" ).click(function() {
if((SELECTED_PACKAGES["CRAN"].length > 0 || SELECTED_PACKAGES["Bioconductor"].length > 0 ) && document.getElementById("selectedR").value == 0) { var valid = true;
alert("Please choose R version");
} if(SELECTED_PACKAGES["Python"].length > 0 && document.getElementById("selectedPython").value == 0) {
else if(SELECTED_PACKAGES["Python"].length > 0 && document.getElementById("selectedPython").value == 0) {
alert("Please choose Python version"); alert("Please choose Python version");
valid = false;
} }
else {
if(valid) {
var preview = generate_container(); var preview = generate_container();
$("#containerPreview").text(PREVIEW); $("#containerPreview").text(PREVIEW);
} }
......
<?php
echo '
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.19/css/jquery.dataTables.min.css" crossorigin="anonymous">
<!-- local fallbacks -->
<!--link rel="stylesheet" href="./inc/css/bootstrap.min.css">
<link rel="stylesheet" href="./inc/css/jquery.dataTables.min.css"-->
<link rel="stylesheet" href="./inc/css/style.css">
<script src="./inc/js/jscolor.js"></script>
<title>wicopa</title>
</head>
<body>
<nav class="navbar navbar-expand-md navbar-dark navbar-custom p-1">
<a class="navbar-brand" href="#">WICOPA</a>
<div class="collapse navbar-collapse justify-content-between" id="navbar">
<div class="navbar-nav">
';
echo ' <a class="nav-item nav-link" href="./index.php"> Home </a>';
echo ' <a class="nav-item nav-link" href="./container.php"> Containers </a>';
if(isset($_SESSION['username']) && !empty($_SESSION['username']))
{
if(isset($_SESSION['manage']) && !empty($_SESSION['manage']))
{
echo ' <a class="nav-item nav-link" href="./manage.php"> Manage </a>';
// echo ' <a class="nav-item nav-link" href="./config.php"> Configs </a>';
}
}
echo '
</div>
<div class="navbar-nav">
';
if(isset($_SESSION['username']) && !empty($_SESSION['username']))
{
echo '<a class="nav-item btn btn-primary " href="./action/action_logout.php"> Logout ('.$_SESSION['username'].') </a>';
}
else
{
echo '<a class="nav-item btn btn-primary" href="./login.php"> Login </a>';
}
echo '</div>
</nav>
';
...@@ -43,70 +43,9 @@ foreach ($db->getAllActiveSectionParent() as $s){ ...@@ -43,70 +43,9 @@ foreach ($db->getAllActiveSectionParent() as $s){
} }
} }
?> require_once "./inc/php/buildHeader.php";
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.19/css/jquery.dataTables.min.css" crossorigin="anonymous">
<!-- local fallbacks -->
<!--link rel="stylesheet" href="./inc/css/bootstrap.min.css">
<link rel="stylesheet" href="./inc/css/jquery.dataTables.min.css" crossorigin="anonymous"-->
<link rel="stylesheet" href="./inc/css/style.css">
<title>wicopa</title>
</head>
<body>
<nav class="navbar navbar-expand-md navbar-dark navbar-custom p-1">
<a class="navbar-brand" href="#">WICOPA</a>
<div class="collapse navbar-collapse justify-content-between" id="navbar">
<div class="navbar-nav">
<?php
echo ' <a class="nav-item nav-link active" href="./index.php"> Home </a>';
echo ' <a class="nav-item nav-link" href="./container.php"> Containers </a>';
if(isset($_SESSION['username']) && !empty($_SESSION['username']))
{
if(isset($_SESSION['manage']) && !empty($_SESSION['manage']))
{
echo ' <a class="nav-item nav-link" href="./manage.php"> Manage </a>';
}
}
?>
</div>
<div class="navbar-nav">
<?php
if(isset($_SESSION['username']) && !empty($_SESSION['username']))
{
echo '<a class="nav-item btn btn-primary " href="./action/action_logout.php"> Logout ('.$_SESSION['username'].') </a>';
}
else
{
echo '<a class="nav-item btn btn-primary" href="./login.php"> Login </a>';
}
?>
</div>
</nav>
?>
<div class="container-fluid"> <div class="container-fluid">
...@@ -283,8 +222,8 @@ foreach ($db->getAllActiveSectionParent() as $s){ ...@@ -283,8 +222,8 @@ foreach ($db->getAllActiveSectionParent() as $s){
<label for="selectedR" class="font-weight-bold">R version :</label> <label for="selectedR" class="font-weight-bold">R version :</label>
<select class="custom-select" id="selectedR"> <select class="custom-select" id="selectedR">
<option value="0" selected="selected">None</option> <option value="0" >None</option>
<option value="3.5" >3.5</option> <option value="3.5" selected="selected">3.5</option>
</select> </select>
</div> </div>
...@@ -428,6 +367,10 @@ foreach ($db->getAllActiveSectionParent() as $s){ ...@@ -428,6 +367,10 @@ foreach ($db->getAllActiveSectionParent() as $s){
</select> </select>
</div> </div>
<div class="form-group">
<label for="tagsContainer">Tags :</label>
<textarea class="form-control" rows="5" id="tagsContainer" maxlength="500" name ="tags"></textarea>
</div>
</div> </div>
...@@ -525,7 +468,7 @@ foreach ($db->getAllActiveSectionParent() as $s){ ...@@ -525,7 +468,7 @@ foreach ($db->getAllActiveSectionParent() as $s){
SELECTED_PACKAGES["Distribution"] = []; SELECTED_PACKAGES["Distribution"] = [];
document.getElementById("containDistributionPackages").innerHTML = ''; //document.getElementById("containDistributionPackages").innerHTML = '';
gestionPackageSelected(); gestionPackageSelected();
} }
......
...@@ -6,10 +6,12 @@ ...@@ -6,10 +6,12 @@
* Time: 10:10 * Time: 10:10
*/ */
//include('../include/buildHeader.php'); require_once "./inc/php/buildHeader.php";
?> ?>
<<<<<<< HEAD
=======
<!doctype html> <!doctype html>
<html lang="en"> <html lang="en">
<head> <head>
...@@ -62,6 +64,7 @@ ...@@ -62,6 +64,7 @@
</nav> </nav>
>>>>>>> f123b4be009adfbfca34a7889a496e1d4a6ec6ff
<div class="container-fluid"> <div class="container-fluid">
......
...@@ -47,69 +47,9 @@ foreach ($grades as $grade) { ...@@ -47,69 +47,9 @@ foreach ($grades as $grade) {
} }
} }
?> require_once "./inc/php/buildHeader.php";
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.19/css/jquery.dataTables.min.css" crossorigin="anonymous">
<!-- local fallbacks -->
<!--link rel="stylesheet" href="./inc/css/bootstrap.min.css">
<link rel="stylesheet" href="./inc/css/jquery.dataTables.min.css"-->
<link rel="stylesheet" href="./inc/css/style.css">
<script src="./inc/js/jscolor.js"></script>
<title>wicopa</title>
</head>
<body>
<nav class="navbar navbar-expand-md navbar-dark navbar-custom p-1">
<a class="navbar-brand" href="#">WICOPA</a>
<div class="collapse navbar-collapse justify-content-between" id="navbar">
<div class="navbar-nav">
<?php
echo ' <a class="nav-item nav-link" href="./index.php"> Home </a>';
echo ' <a class="nav-item nav-link" href="./container.php"> Containers </a>';
if(isset($_SESSION['username']) && !empty($_SESSION['username']))
{
if(isset($_SESSION['manage']) && !empty($_SESSION['manage']))
{
echo ' <a class="nav-item nav-link active" href="./manage.php"> Manage </a>';
}
}
?>
</div>
<div class="navbar-nav">
<?php
if(isset($_SESSION['username']) && !empty($_SESSION['username']))
{
echo '<a class="nav-item btn btn-primary " href="./action/action_logout.php"> Logout ('.$_SESSION['username'].') </a>';
}
else
{
echo '<a class="nav-item btn btn-primary" href="./login.php"> Login </a>';
}
?>
</div>
</nav>
?>
<div class="container-fluid"> <div class="container-fluid">
...@@ -737,10 +677,13 @@ foreach ($grades as $grade) { ...@@ -737,10 +677,13 @@ foreach ($grades as $grade) {
<!-- Latest compiled and minified JavaScript --> <!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<<<<<<< HEAD
=======
<!-- local fallbaks --> <!-- local fallbaks -->
<!--script src="inc/js/jquery-latest.min.js" type="text/javascript"></script> <!--script src="inc/js/jquery-latest.min.js" type="text/javascript"></script>
<script src="inc/js/bootstrap.min.js" type="text/javascript"></script--> <script src="inc/js/bootstrap.min.js" type="text/javascript"></script-->
>>>>>>> f123b4be009adfbfca34a7889a496e1d4a6ec6ff
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -18,6 +18,7 @@ class Container ...@@ -18,6 +18,7 @@ class Container
var $description = ""; var $description = "";
var $author = 0; var $author = 0;
var $date = NULL; var $date = NULL;
var $tags = "";