Skip to content
This repository was archived by the owner on Jan 17, 2025. It is now read-only.

Commit 4b4c94a

Browse files
committed
Merge branch 'main' into feat/wp-cli
2 parents e973bd7 + c3e7ab9 commit 4b4c94a

File tree

6 files changed

+107
-116
lines changed

6 files changed

+107
-116
lines changed

.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
COMPOSE_FILE=./dev/docker-compose.yml

CODE_OF_CONDUCT.md

Lines changed: 0 additions & 13 deletions
This file was deleted.

README.md

Lines changed: 21 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div align="center">
1+
<div align="center">
22
<img src="https://mirrors.creativecommons.org/presskit/icons/cc.xlarge.png" height="150">
33

44
<h2 align="center">CC WordPress Plugin</h2>
@@ -22,6 +22,20 @@ License](https://creativecommons.org/choose/)) on their WordPress website. This
2222
includes default, post, page and media attribution.
2323

2424

25+
## Code of conduct
26+
27+
[`CODE_OF_CONDUCT.md`][org-coc]:
28+
> The Creative Commons team is committed to fostering a welcoming community.
29+
> This project and all other Creative Commons open source projects are governed
30+
> by our [Code of Conduct][code_of_conduct]. Please report unacceptable
31+
> behavior to [conduct@creativecommons.org](mailto:conduct@creativecommons.org)
32+
> per our [reporting guidelines][reporting_guide].
33+
34+
[org-coc]: https://github.com/creativecommons/.github/blob/main/CODE_OF_CONDUCT.md
35+
[code_of_conduct]: https://opensource.creativecommons.org/community/code-of-conduct/
36+
[reporting_guide]: https://opensource.creativecommons.org/community/code-of-conduct/enforcement/
37+
38+
2539
## Installation
2640

2741
Download the latest version from this project's [releases][releases]. You can
@@ -107,65 +121,16 @@ At a glance, with WP CC Plugin you can:
107121
license required (Gutenberg License Blocks)
108122

109123

110-
## Contributing
111-
112-
Contributions will be very appreciated. See
113-
[`CONTRIBUTING.md`](CONTRIBUTING.md).
114-
115-
### Using a localized Docker Setup
116-
117-
A local `docker-compose.yml` file is included in the `./dev/` directory. It includes an Apache webserver, the latest WordPress installation files, and a mySQL db server utilizing MariaDB. We have also included a copy of wp-cli for ease of developement and testing.
118-
119-
It is modelled after the official example, given here by WordPress: https://hub.docker.com/_/wordpress/
120-
121-
To run a local development environment for building and testing contributions you can run the following pattern from the root directory of this repository after cloning it.
122-
123-
`docker compose -f ./dev/docker-compose.yml [command]`
124-
125-
Be sure to substitute `[command]` for a valid docker compose command, such as:
126-
127-
`docker compose -f ./dev/docker-compose.yml up` to build and start containers
128-
129-
OR
130-
131-
`docker compose -f ./dev/docker-compose.yml down` to stop containers
132-
133-
The first time the build process is run via `docker compose -f ./dev/docker-compose.yml up`, docker will create two directories within your local repository clone:
124+
## Contributing and development
134125

135-
- `./dev/db` where the database and relevant config will be stored
136-
- `./dev/wordpress` where the WordPress files will be stored
126+
**See [`development.md`](development.md).**
137127

138-
It will then mount this plugin's root directory into the `/wp-content/plugins/` directory of the WordPress installation. Edits made to your local plugin clone will reflect within the build.
139128

140-
You can then navigate to `http://localhost:8080/` and proceed with a manual WordPress installation. After the initial installation the WordPress install will persisist between docker sessions.
141-
142-
If you need to reset the WordPress install to a "clean slate" you can simply delete the `db` and `wordpress` directories respectively, and then run `docker compose -f ./dev/docker-compose.yml up` again to initialize a clean install build.
143-
144-
#### WP-CLI
145-
146-
To access `wp-cli`, you should have:
147-
148-
- Started the docker container
149-
- Completed wordpress setup from dashboard
150-
151-
You can run wp-cli commands like this:
152-
153-
```
154-
docker compose -f ./dev/docker-compose.yml exec wpcli wp core version
155-
```
156-
The above command will display the wp core version.
157-
158-
You can also use the container's shell to execute wp-cli commands:
159-
```
160-
docker compose -f ./dev/docker-compose.yml exec wpcli bash -i
161-
```
162-
163-
## Release Schedule
129+
## License
164130

165-
We will release a new version every month that there are substantial changes.
166-
See [milestones][milestones] for how GitHub issues are assigned for release.
131+
- [`license.txt`](license.txt) ([GPLv2 or later][gplv2] License)
167132

168-
[milestones]: https://github.com/creativecommons/wp-plugin-creativecommons/milestones
133+
[gplv2]: https://opensource.org/licenses/GPL-2.0 "GNU General Public License version 2 | Open Source Initiative"
169134

170135

171136
## History
@@ -191,13 +156,7 @@ Yergler.
191156
- Tarmo Toikkanen
192157

193158

194-
## License
195-
196-
* [`license.txt`](license.txt) ([GPLv2 or later][gplv2] License)
197-
198-
[gplv2]: https://opensource.org/licenses/GPL-2.0 "GNU General Public License version 2 | Open Source Initiative"
199-
200-
## Contributors ✨
159+
### Contributors ✨
201160

202161
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
203162

dev/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Development and Deployment
1+
# Deployment
22

33

44
## WordPress.org Plugin Deployment

dev/excludes.txt

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,5 @@
11
*.swp
2-
.DS_Store
3-
.cc-metadata.yml
4-
.editorconfig
5-
.eslintignore
6-
.eslintrc.json
7-
.git
8-
.gitattributes
9-
.github
10-
.gitignore
2+
.*
3+
dev*
4+
package*
115
README.md
12-
dev/db
13-
dev/excludes.txt
14-
dev/prep_svn_release.sh
15-
dev/wordpress
16-
package-lock.json
17-
package.json

CONTRIBUTING.md renamed to development.md

Lines changed: 81 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,31 @@
1-
# Contributing to CC WordPress Plugin
1+
# Contributing and development
22

33
Thank you for your interest in contributing to CC WordPress Plugin! This
44
document is a set of guidelines to help you contribute to this project.
55

66

7-
## Code of Conduct
7+
## Code of conduct
88

9-
By participating in this project, you are expected to uphold our [Code of
10-
Conduct][code_of_conduct].
9+
[`CODE_OF_CONDUCT.md`][org-coc]:
10+
> The Creative Commons team is committed to fostering a welcoming community.
11+
> This project and all other Creative Commons open source projects are governed
12+
> by our [Code of Conduct][code_of_conduct]. Please report unacceptable
13+
> behavior to [conduct@creativecommons.org](mailto:conduct@creativecommons.org)
14+
> per our [reporting guidelines][reporting_guide].
1115
16+
[org-coc]: https://github.com/creativecommons/.github/blob/main/CODE_OF_CONDUCT.md
1217
[code_of_conduct]: https://opensource.creativecommons.org/community/code-of-conduct/
18+
[reporting_guide]: https://opensource.creativecommons.org/community/code-of-conduct/enforcement/
1319

1420

15-
## Project Documentation
21+
## Contributing
1622

17-
The `README` in the root of the repository should contain or link to project
18-
documentation. If you cannot find the documentation you're looking for, please
19-
file a GitHub issue with details of what you'd like to see documented.
23+
See [`CONTRIBUTING.md`][org-contrib].
2024

25+
[org-contrib]: https://github.com/creativecommons/.github/blob/main/CONTRIBUTING.md
2126

22-
## How to Contribute
2327

24-
Please follow the processes in our general [Contributing Code][contributing]
25-
guidelines on the Creative Common Open Source website.
26-
27-
[contributing]: https://opensource.creativecommons.org/contributing-code/
28-
29-
30-
### Development
31-
32-
33-
### WordPress Coding Standards
28+
## WordPress Coding Standards
3429

3530
Creative Commons plugin for WordPress follows [WordPress Coding
3631
Standards][standards] and [WordPress Documentation Standards][inline]. Before
@@ -128,14 +123,13 @@ If you are not setup to detect WPCS errors, consider the following steps.
128123
[phpcs]: https://marketplace.visualstudio.com/items?itemName=ikappas.phpcs
129124

130125

131-
### Contributing to Gutenberg Blocks
126+
## Contributing to Gutenberg Blocks
132127

133128
CC plugin for WordPress uses Gutenberg blocks built by **create-guten-block**
134129
tool. If you are interested, you can read its detailed and well-written
135130
[documentation](https://github.com/ahmadawais/create-guten-block). If you want
136131
to test/make changes to these blocks, follow the following steps.
137132

138-
139133
1. **Setup npm**
140134

141135
First off, make sure you have Node version 8+ and npm 5.3 or more. Clone the
@@ -170,7 +164,7 @@ to test/make changes to these blocks, follow the following steps.
170164
It optimizes and builds production code for your block inside `dist` folder.
171165

172166

173-
### Using @wp-env for our local development environment
167+
## Using @wp-env for our local development environment
174168

175169
1. **Start the @wp-env envrionment using the command**
176170

@@ -193,9 +187,71 @@ to test/make changes to these blocks, follow the following steps.
193187
```
194188

195189

196-
## Questions or Thoughts?
190+
## Using a localized Docker setup
191+
192+
A local `docker-compose.yml` file is included in the `./dev/` directory. It
193+
includes an Apache webserver, the latest WordPress installation files, and a
194+
mySQL db server utilizing MariaDB. We have also included a copy of `wp-cli` for
195+
ease of developement and testing.
196+
197+
It is modelled after the official example: [wordpress - Official Image | Docker
198+
Hub](https://hub.docker.com/_/wordpress/).
199+
200+
To run a local development environment for building and testing contributions
201+
you can run the following pattern from the root directory of this repository
202+
after cloning it.
203+
204+
```shell
205+
docker compose [command]
206+
```
207+
208+
Be sure to substitute `[command]` for a valid docker compose command, such as
209+
the following to build and start containers:
210+
211+
```shell
212+
docker compose up
213+
```
214+
215+
Or to stop containers:
216+
217+
```shell
218+
docker compose down
219+
```
220+
221+
The first time the build process is run via `docker compose -f
222+
./dev/docker-compose.yml up`, docker will create two directories within your
223+
local repository clone:
224+
- `./dev/db` where the database and relevant config will be stored
225+
- `./dev/wordpress` where the WordPress files will be stored
226+
227+
It will then mount this plugin's root directory into the `/wp-content/plugins/`
228+
directory of the WordPress installation. Edits made to your local plugin clone
229+
will reflect within the build.
230+
231+
You can then navigate to `http://localhost:8080/` and proceed with a manual
232+
WordPress installation. After the initial installation the WordPress install
233+
will persisist between docker sessions.
234+
235+
If you need to reset the WordPress install to a "clean slate" you can simply
236+
delete the `db` and `wordpress` directories respectively, and then run `docker
237+
compose up` again to initialize a clean install
238+
build.
239+
240+
241+
### WP-CLI
242+
243+
To access `wp-cli`, you should have:
197244
198-
Talk to us on [one of our community forums][community].
245+
- Started the docker container
246+
- Completed wordpress setup from dashboard
199247
200-
[community]: https://opensource.creativecommons.org/community/
248+
For example, the following command uses wp-cli to display the version of
249+
WordPress installed:
250+
```shell
251+
docker compose exec wpcli wp core version
252+
```
201253
254+
You can also use the container's shell to execute wp-cli commands:
255+
```shell
256+
docker compose exec wpcli bash -i
257+
```

0 commit comments

Comments
 (0)