Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Major dudestack version update - Moving to PHP dotenv 5.3, roots/wp-config, oscarotero/env #4

Merged
merged 22 commits into from
Feb 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
c1574d4
Proposal for new version with phpdotenv 5.3
ronilaukkarinen Feb 16, 2021
6528e5e
Update files from latest bedrock
ronilaukkarinen Feb 16, 2021
8ee4c9d
Use application.php from latest bedrock, tweak to our preferences
ronilaukkarinen Feb 16, 2021
a07e4af
Drop php support for older than 7.1
ronilaukkarinen Feb 16, 2021
6ebc9da
Note about handbook
ronilaukkarinen Feb 16, 2021
facf29d
We need to have our version of wp-config
ronilaukkarinen Feb 16, 2021
036367b
Lint and fix with phpcbf, add unit tests
ronilaukkarinen Feb 16, 2021
e9ba5f8
Remove theme specific rules, make sure dev-phpcs.xml is removed in cr…
ronilaukkarinen Feb 16, 2021
592a52e
Update travis
ronilaukkarinen Feb 16, 2021
6334bff
Command orders
ronilaukkarinen Feb 16, 2021
5301c42
Do not run unit tests for content directory
ronilaukkarinen Feb 16, 2021
e00f28a
Do not run unit tests for vendor directory
ronilaukkarinen Feb 16, 2021
41ee6d6
Do not check for syntax errors in all files
ronilaukkarinen Feb 16, 2021
404c25e
Do not include Roots scripts in unit tests
ronilaukkarinen Feb 17, 2021
73e1300
Lint index
ronilaukkarinen Feb 17, 2021
253800f
Combine table of contents, add anchors to plugins
ronilaukkarinen Feb 17, 2021
da363ca
Fix table of contents list indenting
ronilaukkarinen Feb 17, 2021
3be4d9d
Bump versions
ronilaukkarinen Feb 17, 2021
f2de9c3
Merge branch 'dev' of github.com:digitoimistodude/dudestack into dev
ronilaukkarinen Feb 17, 2021
7f02267
Drop php 7.0 support as phpdotenv doesn't supprot it anyway
ronilaukkarinen Feb 17, 2021
c5492ea
Bump PHP version to 7.2
ronilaukkarinen Feb 18, 2021
b75d025
Change declaration order
ronilaukkarinen Feb 18, 2021
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
78 changes: 63 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,76 @@
sudo: false
# Travis CI (MIT License) configuration file for the Air-light WordPress theme.
# @link https://travis-ci.org/

# For use with the Air-light WordPress theme.
# @link https://github.com/digitoimistodude/air-light

# Ditch sudo and use containers.
# @link https://docs.travis-ci.com/user/migrating-from-legacy/#Why-migrate-to-container-based-infrastructure%3F
# @link https://docs.travis-ci.com/user/workers/container-based-infrastructure/#Routing-your-build-to-container-based-infrastructure
sudo: required
dist: xenial

# Declare project language.
# @link https://about.travis-ci.org/docs/user/languages/php/
language: php
php:
- 7.1
- 7.0.8
- 5.6
- nightly

# Declare versions of PHP to use. Use one decimal max.
# @link https://docs.travis-ci.com/user/build-configuration/
matrix:
fast_finish: true
allow_failures:
- php: nightly
fast_finish: true

cache:
apt: true
directories:
- $HOME/.composer/cache
- vendor
include:
# aliased to a recent 7.2.x version
- php: '7.2'
env: SNIFF=1
- php: '7.3'
- php: '7.4'
# bleeding edge PHP
- php: 'nightly'

allow_failures:
- php: 'nightly'

before_install:
- phpenv config-rm xdebug.ini || true
- composer self-update

# Use this to prepare your build for testing.
# e.g. copy database configurations, environment variables, etc.
# Failures in this section will result in build status 'errored'.
before_script:
# Speed up build time by disabling Xdebug.
- phpenv config-rm xdebug.ini || echo 'No xdebug config.'
# Set up temporary paths.
- if [[ "$SNIFF" == "1" ]]; then export PHPCS_DIR=/tmp/phpcs; fi
- if [[ "$SNIFF" == "1" ]]; then export WPCS_DIR=/tmp/wpcs; fi
- if [[ "$SNIFF" == "1" ]]; then export PHPCOMPAT_DIR=/tmp/phpcompatibility; fi
- if [[ "$SNIFF" == "1" ]]; then export SNIFFS_DIR=/tmp/sniffs; fi
# Install PHP_CodeSniffer.
- if [[ "$SNIFF" == "1" ]]; then git clone -b master --depth 1 https://github.com/squizlabs/PHP_CodeSniffer.git $PHPCS_DIR; fi
# Install WordPress Coding Standards.
- if [[ "$SNIFF" == "1" ]]; then git clone -b 2.2.1 --depth 1 https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git $WPCS_DIR; fi
# Set install path for WordPress Coding Standards.
- if [[ "$SNIFF" == "1" ]]; then $PHPCS_DIR/bin/phpcs --config-set installed_paths $WPCS_DIR,$PHPCOMPAT_DIR,$SNIFFS_DIR; fi
# After CodeSniffer install you should refresh your path.
- if [[ "$SNIFF" == "1" ]]; then phpenv rehash; fi
# Install PHP Compatibility sniffs.
- if [[ "$SNIFF" == "1" ]]; then git clone -b master --depth 1 https://github.com/wimg/PHPCompatibility.git $PHPCOMPAT_DIR; fi
# Pull in the dudestack phpcs rules.
- if [[ "$SNIFF" == "1" ]]; then wget https://raw.githubusercontent.com/digitoimistodude/dudestack/dev/phpcs.xml; fi

install:
- composer install -o --prefer-dist --no-interaction

# Run test script commands.
# Default is specific to project language.
# All commands must exit with code 0 on success. Anything else is considered failure.
script:
- if [[ "$SNIFF" == "1" ]]; then $PHPCS_DIR/scripts/phpcs -p -s -v -n . --standard=./codesniffer.ruleset.xml --extensions=php; fi
# Search for PHP syntax errors.
# - find -L . -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l
# Run against WordPress Coding Standards.
# If you use a custom ruleset, change `--standard=WordPress` to point to your ruleset file,
# for example: `--standard=wpcs.xml`.
# You can use any of the normal PHPCS command line arguments in the command:
# https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage
- if [[ "$SNIFF" == "1" ]]; then $PHPCS_DIR/bin/phpcs -p . --ignore=node_modules,scripts,vendor,content,wp,*/css/* --standard=phpcs.xml; fi
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### 1.8.6: 2021-02-16

* Start changelog
86 changes: 40 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

Dudestack is a modern WordPress toolkit that helps you get started with the best development tools and project structure - just like [Bedrock](https://github.com/roots/bedrock).

The idea is to have just one command for starting the project. Saves 10 hours easily in each project start when *Dont-Repeat-Yourself* -stuff are fully automated!
The idea is to have just one command for starting the project. Saves dozens of hours easily in each project start when DRY (*Dont-Repeat-Yourself*) stuff are fully automated!

After setting up, you can start a new project just by running:

Expand All @@ -21,12 +21,15 @@ createproject
4. [Requirements](#requirements)
5. [Installation](#installation)
6. [Documentation](#documentation)
1. [Starting a new project with createproject bash script](#starting-a-new-project-with-createproject-bash-script)
1. [What createproject.sh does](#what-createprojectsh-does)
2. [What you most probably need to edit in every project](#what-you-most-probably-need-to-edit-in-every-project)
3. [Getting started](#getting-started)
4. [Paid or Premium plugins](#paid-or-premium-plugins)
5. [WP-CLI alias](#wp-cli-alias)
1. [Starting a new project with createproject bash script](#starting-a-new-project-with-createproject-bash-script)
2. [What createproject.sh does](#what-createprojectsh-does)
3. [What you most probably need to edit in every project](#what-you-most-probably-need-to-edit-in-every-project)
4. [Getting started](#getting-started)
5. [Paid or Premium plugins](#paid-or-premium-plugins)
1. [Advanced Custom Fields Pro](#advanced-custom-fields-pro)
2. [Polylang Pro](#polylang-pro)
6. [WP-CLI alias](#wp-cli-alias)
7. [Issues](#issues)

#### Background

Expand Down Expand Up @@ -65,19 +68,22 @@ Despite the fact we love most of Bedrock, we noticed there are some things we do

## Requirements

* Composer v2
* Basic knowledge about bash scripting, deployment with capistrano, npm packages, bundle, composer etc.
* Vagrant ([marlin-vagrant](https://github.com/digitoimistodude/marlin-vagrant)) OR [osx-lemp-setup](https://github.com/digitoimistodude/osx-lemp-setup) but can be configured for MAMP or even Docker (in planning)
* GitHub account
* Unix-based OS (built for Mac OS X by default)
* Access to staging and production servers that supports sftp and git
* Projects located under $HOME/Projects
* Git
* PHP >= 5.6
* Ruby >= 2.2
* PHP >= 7.2
* Ruby >= 2.6
* Perl

# Installation

If you are a Finnish person, you might want to check out our [Handbook guide for developers](https://handbook.dude.fi/tyoskenteleminen-dudella/kehittajalle).

1. Clone this repo to your ~/Projects directory
2. Go to dudestack directory and run setup script (`cd ~/Projects/dudestack && sh bin/setup.sh`).
3. Edit `/usr/bin/createproject` to your needs. See [documentation](#documentation) and **[Getting started](#getting-started)**.
Expand All @@ -89,12 +95,6 @@ cat ~/.ssh/id_rsa.pub | ssh [email protected] 'mkdir -p ~/.ssh && cat >> ~/.ssh/a
```

# Documentation
1. [Starting a new project with createproject bash script](#starting-a-new-project-with-createproject-bash-script)
1. [What createproject.sh does](#what-createprojectsh-does)
2. [What you most probably need to edit in every project](#what-you-most-probably-need-to-edit-in-every-project)
3. [Getting started](#getting-started)
4. [Paid or Premium plugins](#paid-or-premium-plugins)

## Starting a new project with createproject bash script

Creating a new project has a lot of configs to do. We wanted to automate most of it by creating a bash script called `createproject.sh`. The script assumes:
Expand Down Expand Up @@ -154,58 +154,52 @@ Edit your `composer.json` and add these lines inside respository, separated by c

### Advanced Custom Fields Pro

Add to "repositories" section:

```json
{
"type": "package",
"package": {
"name": "advanced-custom-fields/advanced-custom-fields-pro",
"version": "5.0",
"type": "wordpress-muplugin",
"dist": {
"type": "zip",
"url": "YOUR_DOWNLOAD_URL (get it from ACF website)"
}
}
"type": "composer",
"url": "https://pivvenit.github.io/acf-composer-bridge/composer/v3/wordpress-plugin/"
},
{
"type": "composer",
"url": "https://pivvenit.github.io/acf-composer-bridge/composer/v3/wordpress-plugin/"
}
```

### WPML
Then to "requires":

```json
"advanced-custom-fields/advanced-custom-fields-pro": "5.9.4",
```

### Polylang Pro

Add to "repositories":

```json
,
{
"type": "package",
"package": {
"name": "wpml/sitepress-multilingual-cms",
"name": "polylang/polylang-pro",
"type": "wordpress-plugin",
"version": "3.1.8.4",
"version": "2.7.4",
"dist": {
"type": "zip",
"url": "YOUR_DOWNLOAD_URL (get it from WPML website)"
"url": "https://xxxxxxxxx:[email protected]/polylang-pro_2.7.4.zip"
}
}
}
},
```

### Gravity Forms

Gravityforms and some other plugins have urls that expire after some time, so to not having always get the url after new version, use your own private plugin repository to store zip files on remote server with basic HTTP auth and add package like this:
Then to "requires":

```json
{
"type": "package",
"package": {
"name": "gravityforms",
"type": "wordpress-plugin",
"version": "1.8.20.5",
"dist": {
"type": "zip",
"url": "http://YOURUSERNAME:[email protected]/path/to/plugins/gravityforms_1.8.20.5.zip"
}
}
}
"polylang/polylang-pro": "2.7.4",
```

In the similar manner you can add other plugins. I've covered with this almost every plugin we use.
In the similar manner you can add other plugins like Gravity Forms. We've covered with this almost every plugin we use.

When getting the new zip, I use this function in my `~/.bashrc`:

Expand Down
1 change: 1 addition & 0 deletions bin/createproject.sh
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ rm .DS_Store
rm -rf bin
rm .env-e
rm .env.example
rm phpcs.xml

composer update
echo "${yellow}Updating .env (db credentials)...:${txtreset}"
Expand Down
4 changes: 4 additions & 0 deletions bin/docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,10 @@ rm -rf .git
rm .travis.yml
rm package-lock.json
rm .DS_Store
rm -rf bin
rm .env-e
rm .env.example
rm phpcs.xml

sh bin/composer.sh update
echo "${yellow}Updating .env (db credentials)...:${txtreset}"
Expand Down
1 change: 1 addition & 0 deletions bin/osxlemp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ rm .DS_Store
rm -rf bin
rm .env-e
rm .env.example
rm phpcs.xml

composer update
echo "${yellow}Updating .env (db credentials)...:${txtreset}"
Expand Down
10 changes: 6 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,15 @@
],
"require": {
"koodimonni/composer-dropin-installer": "dev-master",
"php": ">=5.6",
"php": ">=7.2",
"koodimonni-language/fi": "*",
"koodimonni-language/en_gb": "*",
"composer/installers": "^1.9.0",
"composer/installers": "^1.10.0",
"wp-cli/wp-cli-bundle": "*",
"vlucas/phpdotenv": "^2.0.1",
"johnpbloch/wordpress": "5.6",
"vlucas/phpdotenv": "^5.3",
"oscarotero/env": "^2.1",
"roots/wp-config": "^1.0",
"johnpbloch/wordpress": "5.6.1",
"digitoimistodude/air-helper": "*",
"wpackagist-plugin/classic-editor": "*",
"wpackagist-plugin/ga-in": "*",
Expand Down
Loading