Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .ac-php-conf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"use-cscope": null,
"tag-dir": null,
"filter": {
"php-file-ext-list": [
"php"
],
"php-path-list": [
"."
],
"ignore-ruleset": [
"# like .gitignore file ",
"/vendor/**/[tT]ests/**/*.php",
"/vendor/**/[Ee]xamples/**/*.php",
"/vendor/composer/*.php",
"/vendor/*.php",
"# not need php_codesniffer",
"/vendor/squizlabs/php_codesniffer/**/*.php",
"# -- end -- "
]
}
}
65 changes: 65 additions & 0 deletions .drone.jsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@

local Pipeline(php_version, wp_version) =
{
kind: 'pipeline',
name: 'php-' + php_version,

clone: {
disable: true
},

steps: [
{
name: "git",
pull: "default",
image: "plugins/git",
settings: {
depth: 0,
tags: true
}
},
{
name: "test",
image: "docker.io/presslabs/php-runtime:%s" % php_version,
user: "root",
environment: {
WORDPRESS_TEST_DB_HOST: "database"
},
commands: [
"make test WP_VERSION=%s" % wp_version,
],
},
{
name: "publish",
image: "quay.io/presslabs/build:latest",
group: "publish",
commands: [
"/usr/local/bin/setup-credentials-helper.sh",
],
when: {
event: {
include: ['tag']
}
}
}
],

services: [
{
name: "database",
image: "percona:5.7",
pull: "always",
environment: {
MYSQL_DATABASE: "wordpress_test",
MYSQL_USER: "wordpress",
MYSQL_PASSWORD: "wordpress",
MYSQL_ROOT_PASSWORD: "test"
}
}
],
};

[
Pipeline('8.0', '6.0.1'),
//Pipeline('7.4'),
]
37 changes: 37 additions & 0 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
clone:
disable: true
kind: pipeline
name: php-8.0
services:
- environment:
MYSQL_DATABASE: wordpress_test
MYSQL_PASSWORD: wordpress
MYSQL_ROOT_PASSWORD: test
MYSQL_USER: wordpress
image: percona:5.7
name: database
pull: always
steps:
- image: plugins/git
name: git
pull: default
settings:
depth: 0
tags: true
- commands:
- make test WP_VERSION=6.0.1
environment:
WORDPRESS_TEST_DB_HOST: database
image: docker.io/presslabs/php-runtime:8.0
name: test
user: root
- commands:
- /usr/local/bin/setup-credentials-helper.sh
group: publish
image: quay.io/presslabs/build:latest
name: publish
when:
event:
include:
- tag
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,9 @@ Thumbs.db
vendor/
.idea/
*.sql
*.zip
*.zip

.cache/
.work/
_output/
bin/
47 changes: 47 additions & 0 deletions .phpcs.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?xml version="1.0"?>
<ruleset name="WordPress Coding Standards based custom ruleset for your plugin">
<description>Generally-applicable sniffs for WordPress plugins.</description>

<!-- What to scan -->
<file>.</file>
<exclude-pattern>/vendor/</exclude-pattern>
<exclude-pattern>/node_modules/</exclude-pattern>

<!-- How to scan -->
<!-- Usage instructions: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage -->
<!-- Annotated ruleset: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml -->
<arg value="sp"/> <!-- Show sniff and progress -->
<arg name="basepath" value="./"/><!-- Strip the file paths down to the relevant bit -->
<arg name="colors"/>
<arg name="extensions" value="php"/>
<arg name="parallel" value="8"/><!-- Enables parallel processing when available for faster results. -->

<!-- Rules: Check PHP version compatibility -->
<!-- https://github.com/PHPCompatibility/PHPCompatibility#sniffing-your-code-for-compatibility-with-specific-php-versions -->
<config name="testVersion" value="5.6-"/>
<!-- https://github.com/PHPCompatibility/PHPCompatibilityWP -->
<rule ref="PHPCompatibilityWP"/>

<!-- Rules: WordPress Coding Standards -->
<!-- https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards -->
<!-- https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki/Customizable-sniff-properties -->
<config name="minimum_supported_wp_version" value="4.6"/>
<rule ref="WordPress"/>
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
<properties>
<!-- Value: replace the function, class, and variable prefixes used. Separate multiple prefixes with a comma. -->
<property name="prefixes" type="array" value="my-plugin"/>
</properties>
</rule>
<rule ref="WordPress.WP.I18n">
<properties>
<!-- Value: replace the text domain used. -->
<property name="text_domain" type="array" value="my-plugin"/>
</properties>
</rule>
<rule ref="WordPress.WhiteSpace.ControlStructureSpacing">
<properties>
<property name="blank_line_check" value="true"/>
</properties>
</rule>
</ruleset>
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
PROJECT_NAME := toplytics
PROJECT_REPO := github.com/presslabs/toplytics

WP_VERSION ?= 6.0.1

include build/makelib/common.mk
include build/makelib/wordpress.mk
include build/makelib/php.mk

.php.test.init: $(WP_TESTS_DIR)/wp-tests-config.php $(WP_TESTS_DIR)/includes $(WP_TESTS_DIR)/data
Empty file modified bin/deploy.sh
100644 → 100755
Empty file.
95 changes: 95 additions & 0 deletions build/.drone.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
kind: pipeline
name: default

clone:
disable: true

workspace:
base: /workspace
path: src/github.com/presslabs/build

steps:
- name: clone
image: plugins/git
settings:
depth: 0
tags: true

- name: install dependencies
image: presslabs/build:stable
commands:
- make -j4 build.tools

- name: build
pull: true
image: presslabs/build:stable
environment:
DOCKER_HOST: "unix:///workspace/docker.sock"
commands:
- make -j4 build

- name: publish
image: presslabs/build:stable
commands:
- /usr/local/bin/setup-credentials-helper.sh
- make publish
environment:
DOCKER_HOST: "unix:///workspace/docker.sock"
DOCKER_USERNAME: presslabsbot
DOCKER_PASSWORD:
from_secret: DOCKERHUB_TOKEN
when:
ref:
- refs/heads/master
- refs/heads/release-*

services:
- name: docker
image: docker:dind
privileged: true
commands:
- /usr/local/bin/dockerd-entrypoint.sh dockerd --host "unix:///workspace/docker.sock" --storage-driver overlay2 --log-level error


trigger:
ref:
- refs/pull/**
- refs/heads/**
event:
exclude:
- promote
- tag

---
kind: pipeline
name: promote

clone:
disable: true

workspace:
base: /workspace
path: src/github.com/presslabs/build

steps:
- name: clone
image: plugins/git
settings:
depth: 0
tags: true

- name: promote
image: presslabs/build:stable
commands:
- /usr/local/bin/setup-credentials-helper.sh
- make promote CHANNEL=${DRONE_DEPLOY_TO} PROMOTE_IMAGE_TAG=${PUBLISH_TAG}
- '[ "$PUBLISH_TAG" = "" ] || make tag VERSION=${PUBLISH_TAG}'
environment:
DOCKER_HOST: "unix:///workspace/docker.sock"
DOCKER_USERNAME: presslabsbot
DOCKER_PASSWORD:
from_secret: DOCKERHUB_TOKEN

trigger:
event:
- promote
6 changes: 6 additions & 0 deletions build/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
_output
.cache
.work
/bin/

.#*
Loading