Modification of some file to get good results from API, add Dockerfile to deploy, try to deploy in .drone.yml, try to add text/css type to css import because server cant load CSS, still not working
continuous-integration/drone/push Build was killed Details

master
dorian.hodin 2 years ago
parent 3ee2764220
commit 29afcbad3f

@ -8,11 +8,11 @@ trigger:
steps:
- name: coverage-image
- name: image-app
image: plugins/docker
settings:
dockerfile: ./Source/Tests/Dockerfile
context: Source/Tests
dockerfile: ./Source/Dockerfile
context: Source/
registry: hub.codefirst.iut.uca.fr
repo: hub.codefirst.iut.uca.fr/dorian.hodin/sae4.01_formulaire
username:
@ -20,17 +20,15 @@ steps:
password:
from_secret: SECRET_PASSWD
#conteneur deployment
- name: deploy-coverage
- name: deploy-app
image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dockerproxy-clientdrone:latest
environment:
IMAGENAME: hub.codefirst.iut.uca.fr/dorian.hodin/sae4.01_formulaire:latest
CONTAINERNAME: coverage-image
CONTAINERNAME: image-app
COMMAND: create
OVERWRITE: true
ADMINS: dorianhodin,alexislamande,baptistebaverel,johanlachenal
depends_on: [ coverage-image ]
depends_on: [ image-app ]
- name: setup_PHP_for_SonarQube
image: sonarsource/sonar-scanner-cli
@ -46,6 +44,5 @@ steps:
-Dsonar.language=php
-Dsonar.host.url=https://codefirst.iut.uca.fr/sonar
-Dsonar.php.coverage.reportPaths=coverage.xml
depends_on: [ deploy-coverage ]
depends_on: [ deploy-app ]

@ -26,3 +26,6 @@ RewriteRule ^deleteQuestion$ %{ENV:APP_ROOT}index.php?page=deleteQuestion [L]
RewriteRule ^deleteResponse$ %{ENV:APP_ROOT}index.php?page=deleteResponse [L]
RewriteRule ^deleteKeyword$ %{ENV:APP_ROOT}index.php?page=deleteKeyword [L]
RewriteRule ^deleteResponsesCandidate$ %{ENV:APP_ROOT}index.php?page=deleteResponsesCandidate [L]
AddType text/css *.css

@ -0,0 +1,10 @@
FROM php:8.1-apache
RUN apt-get update && apt-get install -y git
COPY . /var/www/html
WORKDIR /var/www/html/Config
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
RUN composer update && composer install
RUN a2enmod rewrite
RUN a2enmod actions
RUN AddType text/css *.css
RUN service apache2 restart

@ -23,14 +23,14 @@ class FactoryQuestion extends Factory
$questions = [];
if ($results[0] != null) {
for ($i = 0; $i < count($results[0]); $i++) {
if (strcmp($results[0][$i]['type'], "BusinessClass\TextQuestion") == 0) {
$questions[] = new TextQuestion($results[0][$i]['id'], $results[0][$i]['content']);
if (strcmp($results[0][$i]->type, "BusinessClass/TextQuestion") == 0) {
$questions[] = new TextQuestion($results[0][$i]->id, $results[0][$i]->content);
} else {
$possiblesResponses = $results[1][$i];
$content = $results[0][$i]['content'];
$content = $results[0][$i]->content;
$categories = $results[2][$i];
$id = $results[0][$i]['id'];
$questions[] = new $results[0][$i]['type']($possiblesResponses, $content, $categories, $id);
$id = $results[0][$i]->id;
$questions[] = new $results[0][$i]->type($possiblesResponses, $content, $categories, $id);
}
}
}

@ -51,6 +51,7 @@ class ModelAdmin
throw new Exception('GetForm failed');
}
$form = json_decode($res->getBody());
echo $form;
if (!empty($form)) {
$res = $this->client->request(
'POST',

@ -99,10 +99,9 @@ class ModelCandidate
return "PAS DE FORMULAIRE\n";
}
$title = $form[0]['title'];
$description = $form[0]['description'];
$res = $this->client->request('GET', 'https://codefirst.iut.uca.fr/containers/Temoignages-deploy_api_form/getAllQuestions?
idForm='.$form[0]['id']
$title = $form[0]->title;
$description = $form[0]->description;
$res = $this->client->request('GET', 'https://codefirst.iut.uca.fr/containers/Temoignages-deploy_api_form/getAllQuestions?idForm='.$form[0]->id
);
if ($res->getStatusCode()!=200){
throw new Exception('GetAllQuestion failed');

@ -11,8 +11,8 @@
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.5.0/font/bootstrap-icons.css" rel="stylesheet" />
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" rel="stylesheet" />
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" />
<link href="Views/css/styles.css" rel="stylesheet" />
<link href="Views/css/stylesForm.css" rel="stylesheet" />
<link rel="stylesheet" type="text/css" href="Views/CSS/styles.css" />
<link rel="stylesheet" type="text/css" href="Views/CSS/stylesForm.css" />
<link href="<?php echo $poppins; ?>" rel="stylesheet">
<link rel="shortcut icon" href="<?php echo $icon; ?>" type="image/x-icon">
<link rel="icon" href="<?php echo $icon; ?>" type="image/x-icon">

@ -5,7 +5,7 @@
global $googleApis, $googleStatic, $poppins, $icon, $logoUCA;
?>
<meta charset="UTF-8">
<link rel="stylesheet" href="Views/CSS/base.css" />
<link rel="stylesheet" type="text/css" href="Views/CSS/base.css" />
<link rel="preconnect" href="<?php echo $googleApis; ?>">
<link rel="preconnect" href="<?php echo $googleStatic; ?>" crossorigin>
<link href="<?php echo $poppins; ?>" rel="stylesheet">

@ -13,8 +13,8 @@
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.5.0/font/bootstrap-icons.css" rel="stylesheet" />
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" rel="stylesheet" />
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" />
<link href="Views/css/styles.css" rel="stylesheet" />
<link href="Views/css/stylesForm.css" rel="stylesheet" />
<link type="text/css" href="Views/css/styles.css" rel="stylesheet" />
<link type="text/css" href="Views/css/stylesForm.css" rel="stylesheet" />
<link href="<?php echo $poppins; ?>" rel="stylesheet">
<link rel="shortcut icon" href="<?php echo $icon; ?>" type="image/x-icon">
<link rel="icon" href="<?php echo $icon; ?>" type="image/x-icon">

@ -1,8 +1,8 @@
<html lang="fr">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="Views/CSS/common.css">
<link rel="stylesheet" href="node_modules/bootstrap/dist/css/bootstrap.min.css">
<link type="text/css" rel="stylesheet" href="Views/CSS/common.css">
<link type="text/css" rel="stylesheet" href="node_modules/bootstrap/dist/css/bootstrap.min.css">
<title>Error Page</title>
<body class="d-flex flex-column align-items-center">
<h1>

@ -5,14 +5,14 @@
global $googleApis, $googleStatic, $poppins, $icon, $logoUCA;
?>
<meta charset="UTF-8">
<link rel="stylesheet" href="Views/CSS/styles.css" />
<link rel="stylesheet" href="Views/CSS/stylesForm.css" />
<link type="text/css" rel="stylesheet" href="Views/CSS/styles.css" />
<link type="text/css" rel="stylesheet" href="Views/CSS/stylesForm.css" />
<link rel="preconnect" href="<?php echo $googleApis; ?>">
<link rel="preconnect" href="<?php echo $googleStatic; ?>" crossorigin>
<link href="<?php echo $poppins; ?>" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.5.0/font/bootstrap-icons.css" rel="stylesheet" />
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" rel="stylesheet" />
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" />
<link type="text/css" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.5.0/font/bootstrap-icons.css" rel="stylesheet" />
<link type="text/css" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" rel="stylesheet" />
<link type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" />
<title>Formulaire de témoignage</title>
<link rel="shortcut icon" href="<?php echo $icon; ?>" type="image/x-icon">
<link rel="icon" href="<?php echo $icon; ?>" type="image/x-icon">

@ -11,8 +11,8 @@
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.5.0/font/bootstrap-icons.css" rel="stylesheet" />
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" rel="stylesheet" />
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" />
<link href="Views/css/styles.css" rel="stylesheet" />
<link href="Views/css/stylesForm.css" rel="stylesheet" />
<link type="text/css" href="Views/css/styles.css" rel="stylesheet" />
<link type="text/css" href="Views/css/stylesForm.css" rel="stylesheet" />
<link href="<?php echo $poppins; ?>" rel="stylesheet">
<link rel="shortcut icon" href="<?php echo $icon; ?>" type="image/x-icon">
<link rel="icon" href="<?php echo $icon; ?>" type="image/x-icon">

@ -5,7 +5,7 @@
global $googleApis, $googleStatic, $poppins, $icon, $logoUCA;
?>
<meta charset="UTF-8">
<link rel="stylesheet" href="Views/CSS/base.css" />
<link type="text/css" rel="stylesheet" href="Views/CSS/base.css" />
<link rel="preconnect" href="<?php echo $googleApis; ?>">
<link rel="preconnect" href="<?php echo $googleStatic; ?>" crossorigin>
<link href="<?php echo $poppins; ?>" rel="stylesheet">

@ -5,7 +5,7 @@
global $googleApis, $googleStatic, $poppins, $icon, $logoUCA;
?>
<meta charset="UTF-8">
<link rel="stylesheet" href="Views/CSS/base.css" />
<link type="text/css" rel="stylesheet" href="Views/CSS/base.css" />
<link rel="preconnect" href="<?php echo $googleApis; ?>">
<link rel="preconnect" href="<?php echo $googleStatic; ?>" crossorigin>
<link href="<?php echo $poppins; ?>" rel="stylesheet">

@ -5,8 +5,8 @@
global $googleApis, $googleStatic, $poppins, $icon, $logoUCA;
?>
<meta charset="UTF-8">
<link rel="stylesheet" href="Views/CSS/styles.css" />
<link rel="stylesheet" href="Views/CSS/stylesForm.css" />
<link type="text/css" rel="stylesheet" href="Views/CSS/styles.css" />
<link type="text/css" rel="stylesheet" href="Views/CSS/stylesForm.css" />
<link rel="preconnect" href="<?php echo $googleApis; ?>">
<link rel="preconnect" href="<?php echo $googleStatic; ?>" crossorigin>
<link href="<?php echo $poppins; ?>" rel="stylesheet">

@ -1,4 +1,4 @@
var currentTab = 0;
let currentTab = 0;
document.addEventListener("DOMContentLoaded", function(event) {

Loading…
Cancel
Save