Commit 5e0c9d62 authored by Emma's avatar Emma 🦉

Improved CI

parent 918c840f
image: php:7.1
stages:
- build-assets
- test
cache:
paths:
- vendor/
.build-assets: &build-assets
stage: build-assets
image: node:8
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- node_modules/
before_script:
- npm install
artifacts:
name: "$CI_JOB_NAME"
paths:
- public/build/
before_script:
- apt-get update -yqq
- apt-get install -yqq git libmcrypt-dev libpq-dev libcurl4-gnutls-dev libicu-dev libvpx-dev libjpeg-dev libpng-dev libxpm-dev zlib1g-dev libfreetype6-dev libxml2-dev libexpat1-dev libbz2-dev libgmp3-dev libldap2-dev unixodbc-dev libsqlite3-dev libaspell-dev libsnmp-dev libpcre3-dev libtidy-dev
- docker-php-ext-install mbstring mcrypt pdo_pgsql curl json intl gd xml zip bz2 opcache
- pecl install apcu
- docker-php-ext-enable apcu
- curl -sS https://getcomposer.org/installer | php
- php composer.phar install -n
- bin/console doctrine:migrations:migrate -nq
- bin/console doctrine:fixtures:load -n
services:
- postgres:9.6-alpine
build-assets:dev:
<<: *build-assets
script:
- npm run build-dev
variables:
APP_ENV: test
APP_SECRET: foo
DATABASE_URL: "pgsql://postmill@postgres/postmill?serverVersion=9.6"
POSTGRES_USER: postmill
POSTGRES_PASSWORD: ""
SITE_NAME: Postmill
SYMFONY_DEPRECATIONS_HELPER: disabled
build-assets:prod:
<<: *build-assets
script:
- npm run build-prod
test:
.php-test: &php-test
stage: test
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- vendor/
dependencies:
- build-assets:prod
services:
- postgres:9.4-alpine
variables:
APP_ENABLE_WEBHOOKS: 1
APP_ENV: test
APP_LOCALE: en
APP_SECRET: foo
DATABASE_URL: "pgsql://postmill@postgres/postmill?serverVersion=9.4"
NO_REPLY_ADDRESS: "no-reply@example.com"
POSTGRES_USER: postmill
POSTGRES_PASSWORD: ""
SITE_NAME: Postmill
SYMFONY_DEPRECATIONS_HELPER: disabled
before_script:
- apt-get update -yqq
- apt-get install -yqq git libpq-dev libcurl4-gnutls-dev libicu-dev
libvpx-dev libjpeg-dev libpng-dev libxpm-dev zlib1g-dev
libfreetype6-dev libxml2-dev libexpat1-dev libbz2-dev libgmp3-dev
libldap2-dev unixodbc-dev libsqlite3-dev libaspell-dev libsnmp-dev
libpcre3-dev libtidy-dev
- docker-php-ext-install mbstring pdo_pgsql curl json intl gd xml zip
bz2 opcache
- pecl install apcu
- docker-php-ext-enable apcu
- curl -sS https://getcomposer.org/installer | php
- php composer.phar install -n
- bin/console doctrine:migrations:migrate -nq
- bin/console doctrine:fixtures:load -n
script:
- bin/phpunit --coverage-text --colors=never
- find {config,public,src,tests} -type f -name '*.php' -print0 |
xargs -0 -n1 -P4 php -l -n | (! grep -v "No syntax errors detected" )
- bin/phpunit
- bin/console doctrine:mapping:info -q
- bin/console lint:yaml config
- bin/console lint:twig templates
- bin/console lint:yaml translations
- bin/console security:check
- php composer.phar validate --strict
test:7.1:
<<: *php-test
image: php:7.1
test:7.2:
<<: *php-test
image: php:7.2
......@@ -10,7 +10,6 @@ by an alien logo are purely coincidental.
* PHP >= 7.1 with the APCu, curl, gd, mbstring, PDO_PGSQL and xml extensions.
* PostgreSQL >= 9.4
* [Composer](https://getcomposer.org/)
* [Node.js](https://nodejs.org/en/) (>= 8.x preferred)
Postmill should be able to run under any Unix environment. It has been tested to
work under Linux, macOS, and Windows 10's Linux subsystem. Running directly on
......@@ -20,12 +19,12 @@ Windows may work, but is unsupported.
Clone the repository somewhere and navigate there with the command line.
### Building frontend assets
### Retrieving frontend assets
1. Run `npm install`.
2. Run `npm run build-dev`. The `public/build/` directory should now contain
some files.
Download [the pre-built assets][assets] and unzip them into the `public/build`
folder such that this contains a large amount of files. Alternatively, you may
install Node and compile your own assets with `npm run build-dev`/`npm run
build-prod`.
### Setting up the backend
......@@ -91,3 +90,4 @@ details.
[issues]: https://gitlab.com/edgyemma/Postmill/issues
[matrix]: https://matrix.to/#/#postmill:matrix.org
[support]: https://community.postmill.xyz/f/Support
[assets]: https://gitlab.com/edgyemma/Postmill/-/jobs/artifacts/master/download?job=build-assets%3Aprod
......@@ -33,6 +33,7 @@
"sabberworm/php-css-parser": "^8.1",
"sebastian/diff": "^3.0",
"sensio/framework-extra-bundle": "^5.1",
"sensiolabs/security-checker": "^4.1",
"symfony/asset": "^4.0",
"symfony/cache": "^4.0",
"symfony/expression-language": "^4.0",
......@@ -85,7 +86,8 @@
"cache:clear": "symfony-cmd",
"assets:install --symlink --relative %PUBLIC_DIR%": "symfony-cmd",
"fos:js-routing:dump --target=public/js/routing.js": "symfony-cmd",
"bazinga:js-translation:dump public/js --merge-domains --format=js": "symfony-cmd"
"bazinga:js-translation:dump public/js --merge-domains --format=js": "symfony-cmd",
"security-checker security:check": "script"
},
"post-install-cmd": [
"@auto-scripts"
......
......@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "aaae105189a925093efd1f2e7c0379ff",
"content-hash": "7a6796b440c01101a31d9b916bdabee8",
"packages": [
{
"name": "composer/ca-bundle",
......@@ -3360,6 +3360,51 @@
],
"time": "2018-05-12T09:37:42+00:00"
},
{
"name": "sensiolabs/security-checker",
"version": "v4.1.8",
"source": {
"type": "git",
"url": "https://github.com/sensiolabs/security-checker.git",
"reference": "dc270d5fec418cc6ac983671dba5d80ffaffb142"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sensiolabs/security-checker/zipball/dc270d5fec418cc6ac983671dba5d80ffaffb142",
"reference": "dc270d5fec418cc6ac983671dba5d80ffaffb142",
"shasum": ""
},
"require": {
"composer/ca-bundle": "^1.0",
"symfony/console": "~2.7|~3.0|~4.0"
},
"bin": [
"security-checker"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.1-dev"
}
},
"autoload": {
"psr-0": {
"SensioLabs\\Security": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien.potencier@gmail.com"
}
],
"description": "A security checker for your composer.lock",
"time": "2018-02-28T22:10:01+00:00"
},
{
"name": "swiftmailer/swiftmailer",
"version": "v6.1.3",
......
services:
SensioLabs\Security\SecurityChecker:
public: false
SensioLabs\Security\Command\SecurityCheckerCommand:
arguments: ['@SensioLabs\Security\SecurityChecker']
public: false
tags:
- { name: console.command, command: 'security:check' }
......@@ -2,5 +2,3 @@ framework:
test: ~
session:
storage_id: session.storage.mock_file
assets:
json_manifest_path: ~
Getting started
===
This document will take you through the steps necessary to set up your own,
local Postmill instance. If you want to run a live site, there are other
necessary steps to take that are not mentioned here.
## Requirements
* PHP >= 7.1 with the APCu, curl, gd, mbstring, PDO_PGSQL and xml extensions.
* PostgreSQL >= 9.4
* [Composer](https://getcomposer.org/)
* [Node.js](https://nodejs.org/en/) (optional; keep reading)
## Cloning the git repository
Clone the git repository somewhere and navigate there.
~~~
$ git clone https://gitlab.com/edgyemma/Postmill.git
$ cd Postmill
~~~
## Frontend assets
To quickly get started, you can [download the latest frontend assets][assets]
and unpack them inside Postmill's root folder. The `public/build` directory
should now contain some files.
[assets]: https://gitlab.com/edgyemma/Postmill/-/jobs/artifacts/improved-ci/download?job=build-assets%3Aprod
### Building your own assets
For developing, you'll want the ability to build your own assets.
## Setting up the backend
......@@ -245,6 +245,15 @@
"ref": "aaddfdf43cdecd4cf91f992052d76c2cadc04543"
}
},
"sensiolabs/security-checker": {
"version": "4.0",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "4.0",
"ref": "421933bf8f0e75546ac8e00cb3eb12904fa2ac1a"
}
},
"swiftmailer/swiftmailer": {
"version": "v6.0.2"
},
......
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