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

Docker Dev Environment #154

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft
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
1 change: 1 addition & 0 deletions .svnignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ phpunit.xml.dist
.travis.yml
coverage
.coveralls.yml
stack.yml
62 changes: 36 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,49 +8,59 @@ Use SparkPost emails right from your WordPress site.

**Option 1**

* Download the plugin from [WordPress's plugins repository](https://wordpress.org/plugins/sparkpost/).
* Upload to plugins directory of your WordPress installation which, usually, is `wp-content/plugins`.
* Activate the plugin from admin panel.
- Download the plugin from [WordPress's plugins repository](https://wordpress.org/plugins/sparkpost/).
- Upload to plugins directory of your WordPress installation which, usually, is `wp-content/plugins`.
- Activate the plugin from admin panel.

**Option 2**
* From your WordPress site's admin panel go to **Plugins -> Add New**.
* Enter *sparkpost* in *Search Plugins* text field and hit Enter.
* It should show pluging titled *SparkPost SMTP*. Click **Install Now** button.
* In next page, upon successful downloading click **Activate Plugin**.

- From your WordPress site's admin panel go to **Plugins -> Add New**.
- Enter _sparkpost_ in _Search Plugins_ text field and hit Enter.
- It should show pluging titled _SparkPost SMTP_. Click **Install Now** button.
- In next page, upon successful downloading click **Activate Plugin**.

## Configuration

Once plugin is installed, you need some quick **but important** configuration. Click **SparkPost SMTP** from Settings menu
* In the form put SparkPost API key, sender name and email.
* Click **Save Changes**

- In the form put SparkPost API key, sender name and email.
- Click **Save Changes**

## Test Email
From Test Email section, try sending a test email to yourself to make sure the credentials are working fine.

From Test Email section, try sending a test email to yourself to make sure the credentials are working fine.

## Development
* Install WordPress
* Clone this repository to the WordPress plugins directory:

```
$ brew install docker
$ docker-compose -f stack.yml up
```

- Install WordPress
- Clone this repository to the WordPress plugins directory:

```
git clone [email protected]:SparkPost/wordpress-sparkpost.git ~/src/wordpress/wp-content/plugins/wordpress-sparkpost
```

* Activate the plugin from admin panel
- Activate the plugin from admin panel

## Running Tests
* Make sure you're using PHP 5.6 or above.
* Go to `./tests` directory.
* Install test files by running `bash bin/install-wp-tests.sh wordpress_test root '' localhost latest` (Try `127.0.0.1` instead of `localhost` if you're getting error). Details on [wp-cli.org](http://wp-cli.org/docs/plugin-unit-tests/).
* [Install composer](https://getcomposer.org/doc/00-intro.md)
* Run `composer install` to install required packages.
* To run tests, run `composer test`.
* Add your tests in `tests/specs` directory. Upon pushing the branch, Travis will automatically run it and generate reports (tests and coverage).

- Make sure you're using PHP 5.6 or above.
- Go to `./tests` directory.
- Install test files by running `bash bin/install-wp-tests.sh wordpress_test root '' localhost latest` (Try `127.0.0.1` instead of `localhost` if you're getting error). Details on [wp-cli.org](http://wp-cli.org/docs/plugin-unit-tests/).
- [Install composer](https://getcomposer.org/doc/00-intro.md)
- Run `composer install` to install required packages.
- To run tests, run `composer test`.
- Add your tests in `tests/specs` directory. Upon pushing the branch, Travis will automatically run it and generate reports (tests and coverage).

## Releasing

* Create a branch off master: `git checkout -b bump`
* Update the version in plugin meta and `WPSP_PLUGIN_VERSION` constant in [wordpress-sparkpost.php](wordpress-sparkpost.php)
* Update the version and change log in [readme.txt](readme.txt)
* Commit the changes and push the branch
* Create a pull request
* Once the pull request is merged, run `./deploy.sh`
- Create a branch off master: `git checkout -b bump`
- Update the version in plugin meta and `WPSP_PLUGIN_VERSION` constant in [wordpress-sparkpost.php](wordpress-sparkpost.php)
- Update the version and change log in [readme.txt](readme.txt)
- Commit the changes and push the branch
- Create a pull request
- Once the pull request is merged, run `./deploy.sh`
31 changes: 31 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
version: "3.8"
services:
wordpress:
image: wordpress:5.5.0
restart: always
ports:
- 3080:80
environment:
WORDPRESS_DB_HOST: db
WORDPRESS_DB_USER: admin
WORDPRESS_DB_PASSWORD: admin
WORDPRESS_DB_NAME: wordpress-5-5-0
WORDPRESS_DEBUG: "1"
volumes:
- wordpress:/var/www/html
- ./:/var/www/html/wp-content/plugins/sparkpost:ro

db:
image: mysql:5.7
restart: always
environment:
MYSQL_DATABASE: wordpress-5-5-0
MYSQL_USER: admin
MYSQL_PASSWORD: admin
MYSQL_RANDOM_ROOT_PASSWORD: "1"
volumes:
- db:/var/lib/mysql

volumes:
wordpress:
db: