Compare commits
No commits in common. "c9b3757027cd2354277da54290cfb8751478a04e" and "7007922739448098457e57a5fe7fdf3f3730f21d" have entirely different histories.
c9b3757027
...
7007922739
45
.drone.yml
45
.drone.yml
|
|
@ -1,45 +0,0 @@
|
||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
type: docker
|
|
||||||
name: default
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: install
|
|
||||||
image: composer
|
|
||||||
volumes:
|
|
||||||
- name: composer-cache
|
|
||||||
path: /tmp/cache
|
|
||||||
environment:
|
|
||||||
COMPOSER_CACHE_DIR: /tmp/cache
|
|
||||||
commands:
|
|
||||||
- composer install --no-progress --no-interaction --no-dev --optimize-autoloader
|
|
||||||
|
|
||||||
- name: unit tests
|
|
||||||
image: php:7.4
|
|
||||||
commands:
|
|
||||||
- vendor/bin/phpunit -c phpunit.xml
|
|
||||||
|
|
||||||
- name: build image
|
|
||||||
image: docker
|
|
||||||
volumes:
|
|
||||||
- name: dockersock
|
|
||||||
path: /var/run/docker.sock
|
|
||||||
commands:
|
|
||||||
- docker build -t notecat:latest .
|
|
||||||
|
|
||||||
- name: deploy on testing
|
|
||||||
image: docker/compose
|
|
||||||
volumes:
|
|
||||||
- name: dockersock
|
|
||||||
path: /var/run/docker.sock
|
|
||||||
commands:
|
|
||||||
- docker-compose -f docker/docker-compose.testing.yml up --build --detach
|
|
||||||
|
|
||||||
volumes:
|
|
||||||
- name: composer-cache
|
|
||||||
host:
|
|
||||||
path: /tmp/drone/composer-cache
|
|
||||||
|
|
||||||
- name: dockersock
|
|
||||||
host:
|
|
||||||
path: /var/run/docker.sock
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
/tmp/
|
|
||||||
|
|
||||||
# Editors
|
|
||||||
.vscode
|
|
||||||
.idea
|
|
||||||
|
|
||||||
# PHP
|
|
||||||
/vendor/
|
|
||||||
/coverage/
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
FROM php:7.4-apache
|
|
||||||
|
|
||||||
WORKDIR /var/www
|
|
||||||
|
|
||||||
RUN sed -ri -e 's!/var/www/html!/var/www/public!g' /etc/apache2/sites-available/*.conf
|
|
||||||
|
|
||||||
COPY vendor/ /var/www/vendor/
|
|
||||||
COPY public/ /var/www/public/
|
|
||||||
COPY src/ /var/www/src/
|
|
||||||
35
Makefile
35
Makefile
|
|
@ -1,35 +0,0 @@
|
||||||
### Variables
|
|
||||||
DOCKER_COMPOSE_CMD := docker-compose -f docker/docker-compose.local.yml
|
|
||||||
COMPOSER := composer
|
|
||||||
PHPUNIT := vendor/bin/phpunit
|
|
||||||
|
|
||||||
.PHONY: build up down logs install test phpunit open_coverage
|
|
||||||
|
|
||||||
|
|
||||||
### Container management
|
|
||||||
build:
|
|
||||||
${DOCKER_COMPOSE_CMD} build
|
|
||||||
|
|
||||||
up:
|
|
||||||
${DOCKER_COMPOSE_CMD} up --build --detach
|
|
||||||
|
|
||||||
down:
|
|
||||||
${DOCKER_COMPOSE_CMD} down
|
|
||||||
|
|
||||||
logs:
|
|
||||||
${DOCKER_COMPOSE_CMD} logs -f || true
|
|
||||||
|
|
||||||
|
|
||||||
### Dependency management
|
|
||||||
install:
|
|
||||||
${COMPOSER} install
|
|
||||||
|
|
||||||
|
|
||||||
### Test suites
|
|
||||||
test: phpunit
|
|
||||||
|
|
||||||
phpunit:
|
|
||||||
${PHPUNIT} -c phpunit.xml
|
|
||||||
|
|
||||||
open_coverage:
|
|
||||||
${BROWSER} coverage/index.html
|
|
||||||
|
|
@ -1,27 +0,0 @@
|
||||||
{
|
|
||||||
"name": "binarydiv/notecat",
|
|
||||||
"description": "Note taking app. Like Notepad, but meow!",
|
|
||||||
"type": "project",
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "binaryDiv",
|
|
||||||
"email": "binarydiv@gmail.com"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"require": {
|
|
||||||
"php": "^7.4"
|
|
||||||
},
|
|
||||||
"require-dev": {
|
|
||||||
"phpunit/phpunit": "^9"
|
|
||||||
},
|
|
||||||
"autoload": {
|
|
||||||
"psr-4": {
|
|
||||||
"NoteCat\\": "src/"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"autoload-dev": {
|
|
||||||
"psr-4": {
|
|
||||||
"Tests\\Unit\\": "tests/unit/"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,10 +0,0 @@
|
||||||
version: '3'
|
|
||||||
|
|
||||||
services:
|
|
||||||
web:
|
|
||||||
build: ..
|
|
||||||
restart: always
|
|
||||||
ports:
|
|
||||||
- 8080:80
|
|
||||||
volumes:
|
|
||||||
- ../:/var/www/
|
|
||||||
|
|
@ -1,17 +0,0 @@
|
||||||
version: '3'
|
|
||||||
|
|
||||||
services:
|
|
||||||
web:
|
|
||||||
build: ..
|
|
||||||
restart: always
|
|
||||||
networks:
|
|
||||||
- traefik
|
|
||||||
labels:
|
|
||||||
- traefik.enable=true
|
|
||||||
- traefik.http.routers.notecat.rule=Host(`notecat.dev.0xbd.space`)
|
|
||||||
- traefik.http.routers.notecat.tls=true
|
|
||||||
- traefik.http.routers.notecat.tls.certresolver=letsencrypt
|
|
||||||
|
|
||||||
networks:
|
|
||||||
traefik:
|
|
||||||
external: true
|
|
||||||
28
phpunit.xml
28
phpunit.xml
|
|
@ -1,28 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.2/phpunit.xsd"
|
|
||||||
bootstrap="vendor/autoload.php"
|
|
||||||
executionOrder="depends,defects"
|
|
||||||
forceCoversAnnotation="true"
|
|
||||||
beStrictAboutCoversAnnotation="true"
|
|
||||||
beStrictAboutOutputDuringTests="true"
|
|
||||||
beStrictAboutTodoAnnotatedTests="true"
|
|
||||||
verbose="true">
|
|
||||||
|
|
||||||
<testsuites>
|
|
||||||
<testsuite name="unit-tests">
|
|
||||||
<directory suffix="Test.php">tests/unit</directory>
|
|
||||||
</testsuite>
|
|
||||||
</testsuites>
|
|
||||||
|
|
||||||
<filter>
|
|
||||||
<whitelist processUncoveredFilesFromWhitelist="true">
|
|
||||||
<directory suffix=".php">src</directory>
|
|
||||||
</whitelist>
|
|
||||||
</filter>
|
|
||||||
|
|
||||||
<logging>
|
|
||||||
<log type="coverage-html" target="coverage/" lowUpperBound="60" highLowerBound="100"/>
|
|
||||||
<log type="coverage-text" target="php://stdout" showUncoveredFiles="false"/>
|
|
||||||
</logging>
|
|
||||||
</phpunit>
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
<?php
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
require_once __DIR__ . '/../vendor/autoload.php';
|
|
||||||
|
|
||||||
use NoteCat\HelloWorld;
|
|
||||||
|
|
||||||
$hello = new HelloWorld();
|
|
||||||
echo '<b>' . $hello->getHello() . "</b>\n";
|
|
||||||
|
|
@ -1,12 +0,0 @@
|
||||||
<?php
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace NoteCat;
|
|
||||||
|
|
||||||
class HelloWorld
|
|
||||||
{
|
|
||||||
public function getHello(): string
|
|
||||||
{
|
|
||||||
return 'Hello world! :3';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,19 +0,0 @@
|
||||||
<?php
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace Tests\Unit;
|
|
||||||
|
|
||||||
use NoteCat\HelloWorld;
|
|
||||||
use PHPUnit\Framework\TestCase;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @covers NoteCat\HelloWorld
|
|
||||||
*/
|
|
||||||
final class HelloWorldTest extends TestCase
|
|
||||||
{
|
|
||||||
public function testGetHello(): void
|
|
||||||
{
|
|
||||||
$hello = new HelloWorld();
|
|
||||||
$this->assertSame('Hello Drone! :3', $hello->getHello());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue