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
RUN mkdir /app && cd /app && \
wget https://gitlab.mbb.univ-montp2.fr/jlopez/wicopa/-/archive/v0.4/wicopa-v0.4.tar.gz && \
tar -xf wicopa-v0.4.tar.gz && ln -s wicopa-v0.4 wicopa && \
cp wicopa/inc/conf/Conf.php.sample wicopa/inc/conf/Conf.php && \
wget https://gitlab.mbb.univ-montp2.fr/jlopez/wicopa/-/archive/v0.4.1/wicopa-v0.4.1.tar.gz && \
tar -xf wicopa-v0.4.1.tar.gz && ln -s wicopa-v0.4.1 wicopa
WORKDIR /app/wicopa
RUN cp inc/conf/Conf.php.sample inc/conf/Conf.php && \
chown -R apache:apache /app && \
sed -i "s#DB_NAME = ''#DB_NAME = 'wicopa'#" wicopa/inc/conf/Conf.php && \
sed -i "s#DB_HOSTNAME = ''#DB_HOSTNAME = 'wicopadb'#" wicopa/inc/conf/Conf.php && \
sed -i "s#DB_USERNAME = ''#DB_USERNAME = 'wicopauser'#" wicopa/inc/conf/Conf.php && \
sed -i "s#DB_PP = ''#DB_PP = 'w1c0Pa5s'#" wicopa/inc/conf/Conf.php && \
sed -i "s#'to_replace_with_your_admin_pass'#'450cb0c92db35549cb926efc391df2ceae4b48d1'#" 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'#" inc/conf/Conf.php && \
sed -i "s#DB_USERNAME = ''#DB_USERNAME = 'wicopauser'#" 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'#" inc/conf/Conf.php
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 && \
......
stages:
- build
- test
- deploy
image: docker:latest
image: tmaier/docker-compose
services:
- docker:dind
- docker:dind
variables:
DOCKER_DRIVER: overlay2
PrebuildJob:
buildJob:
stage: build
tags:
- bioco
only:
- master
script:
- 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
- cd wicopa
- wget -q http://web.mbb.univ-montp2.fr/download/wicopa.sql.gz
- gunzip -d wicopa.sql.gz
- pip install docker-compose
BuildJob:
stage: build
script:
- docker-compose --version
- docker info
- 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";
$description = NULL;
$author = 0;
$labels = array();
$tags = "";
if(isset($_POST['containerid'])) {
$id = $_POST['containerid'];
......@@ -75,7 +76,13 @@ if(isset($_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") {
$container->escape($db);
......
......@@ -9,70 +9,9 @@ $db = new DBquery();
$containers = $db->getContainers();
?>
<!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>
require_once "./inc/php/buildHeader.php";
?>
<div class="container-fluid">
......@@ -89,6 +28,7 @@ $containers = $db->getContainers();
<th>Name</th>
<th>Author</th>
<th>Labels</th>
<th>Tags</th>
<th>Date</th>
<th>Description</th>
<th>Action</th>
......@@ -154,6 +94,24 @@ $containers = $db->getContainers();
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->description . '</td>';
......
......@@ -175,7 +175,7 @@ class DBquery
$result = mysqli_query($this->dbh, $sql);
$results = array();
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);
}
return $results;
......
......@@ -5,13 +5,14 @@ var PREVIEW = "";
$( "#generateButton" ).click(function() {
if((SELECTED_PACKAGES["CRAN"].length > 0 || SELECTED_PACKAGES["Bioconductor"].length > 0 ) && document.getElementById("selectedR").value == 0) {
alert("Please choose R version");
}
else if(SELECTED_PACKAGES["Python"].length > 0 && document.getElementById("selectedPython").value == 0) {
var valid = true;
if(SELECTED_PACKAGES["Python"].length > 0 && document.getElementById("selectedPython").value == 0) {
alert("Please choose Python version");
valid = false;
}
else {
if(valid) {
var preview = generate_container();
$("#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){
}
}
?>
<!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>
require_once "./inc/php/buildHeader.php";
?>
<div class="container-fluid">
......@@ -283,8 +222,8 @@ foreach ($db->getAllActiveSectionParent() as $s){
<label for="selectedR" class="font-weight-bold">R version :</label>
<select class="custom-select" id="selectedR">
<option value="0" selected="selected">None</option>
<option value="3.5" >3.5</option>
<option value="0" >None</option>
<option value="3.5" selected="selected">3.5</option>
</select>
</div>
......@@ -428,6 +367,10 @@ foreach ($db->getAllActiveSectionParent() as $s){
</select>
</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>
......@@ -525,7 +468,7 @@ foreach ($db->getAllActiveSectionParent() as $s){
SELECTED_PACKAGES["Distribution"] = [];
document.getElementById("containDistributionPackages").innerHTML = '';
//document.getElementById("containDistributionPackages").innerHTML = '';
gestionPackageSelected();
}
......
......@@ -6,10 +6,12 @@
* Time: 10:10
*/
//include('../include/buildHeader.php');
require_once "./inc/php/buildHeader.php";
?>
<<<<<<< HEAD
=======
<!doctype html>
<html lang="en">
<head>
......@@ -62,6 +64,7 @@
</nav>
>>>>>>> f123b4be009adfbfca34a7889a496e1d4a6ec6ff
<div class="container-fluid">
......
......@@ -47,69 +47,9 @@ foreach ($grades as $grade) {
}
}
?>
<!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>
require_once "./inc/php/buildHeader.php";
?>
<div class="container-fluid">
......@@ -737,10 +677,13 @@ foreach ($grades as $grade) {
<!-- 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>
<<<<<<< HEAD
=======
<!-- local fallbaks -->
<!--script src="inc/js/jquery-latest.min.js" type="text/javascript"></script>
<script src="inc/js/bootstrap.min.js" type="text/javascript"></script-->
>>>>>>> f123b4be009adfbfca34a7889a496e1d4a6ec6ff
</body>
</html>
\ No newline at end of file
......@@ -18,6 +18,7 @@ class Container
var $description = "";
var $author = 0;
var $date = NULL;
var $tags = "";
/**
* Container constructor.
......@@ -25,7 +26,7 @@ class Container
* @param string $name
* @param int $type
*/
public function __construct($ID, $name, $value, $type, $visibility, $description, $author, $date)
public function __construct($ID, $name, $value, $type, $visibility, $description, $author, $date, $tags)
{
$this->ID = $ID;
$this->name = $name;
......@@ -35,29 +36,32 @@ class Container
$this->description = $description;
$this->author = $author;
$this->date = $date;
$this->tags = $tags;
}
public function escape(DBquery $db) {
$this->name = utf8_decode($db->escape($this->name));
$this->value = utf8_decode($db->escape($this->value));
$this->description = utf8_decode($db->escape($this->description));
$this->tags = utf8_decode($db->escape($this->tags));
}
public function escape2(DBquery $db) {
$this->name = utf8_encode($db->escape($this->name));
$this->value = utf8_encode($db->escape($this->value));
$this->description = utf8_encode($db->escape($this->description));
$this->tags = utf8_encode($db->escape($this->tags));
}
public function getInsert() {
return "INSERT INTO Container (name, value, type, visibility, description, author, date)
VALUES ('$this->name', '$this->value', '$this->type', '$this->visibility', '$this->description', '$this->author', '$this->date');";
return "INSERT INTO Container (name, value, type, visibility, description, author, date, tags)
VALUES ('$this->name', '$this->value', '$this->type', '$this->visibility', '$this->description', '$this->author', '$this->date', '$this->tags');";
}
public function getUpdate() {
return "UPDATE Container
SET name='$this->name', value='$this->value', type='$this->type',
visiblity='$this->visibility', description='$this->description', author='$this->author', date='$this->date'
visiblity='$this->visibility', description='$this->description', author='$this->author', date='$this->date', tags='$this->tags'
WHERE ID = '$this->ID';";
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment