-
Notifications
You must be signed in to change notification settings - Fork 4
feat: wordpress management #5
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,29 +36,29 @@ def load_about(): | |
| license="AGPLv3", | ||
| author="Emad Rad", | ||
| author_email="codewithemad@gmail.com", | ||
| description="Tutor plugin for WooCommerce", | ||
| description="Tutor plugin for WordPress.", | ||
| long_description=load_readme(), | ||
| long_description_content_type="text/x-rst", | ||
| packages=find_packages(exclude=["tests*"]), | ||
| include_package_data=True, | ||
| python_requires=">=3.8", | ||
| install_requires=["tutor>=14.0.0,<19.0.0"], | ||
| python_requires=">=3.7", | ||
| install_requires=[ | ||
| "tutor>=15.0.0,<19.0.0", | ||
| "importlib_resources", # for older versions of tutor | ||
| ], | ||
| extras_require={ | ||
| "dev": [ | ||
| "tutor[dev]>=14.0.0,<19.0.0", | ||
| ] | ||
| }, | ||
| entry_points={ | ||
| "tutor.plugin.v1": [ | ||
| "wordpress = tutorwordpress.plugin" | ||
| "tutor[dev]>=15.0.0,<19.0.0", | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it necessary to use tutor[dev] in a standard installation?
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a common pattern for tutor plugins. where we install tutor[dev], if you wnat to install tutor-contrib-wordpress[dev] for better developer experience. for example: https://github.com/overhangio/tutor-notes/blob/75e64f506597158fcd850ce76c5715acf7b0a163/setup.py#L37 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I reviewed it, and you are right; that part is not in the standard installation but in the dev mode ✨ |
||
| ] | ||
| }, | ||
| entry_points={"tutor.plugin.v1": ["wordpress = tutorwordpress.plugin"]}, | ||
| classifiers=[ | ||
| "Development Status :: 3 - Alpha", | ||
| "Intended Audience :: Developers", | ||
| "License :: OSI Approved :: GNU Affero General Public License v3", | ||
| "Operating System :: OS Independent", | ||
| "Programming Language :: Python", | ||
| "Programming Language :: Python :: 3.7", | ||
| "Programming Language :: Python :: 3.8", | ||
| "Programming Language :: Python :: 3.9", | ||
| "Programming Language :: Python :: 3.10", | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # WordPress | ||
| {{ WORDPRESS_HOST }}{$default_site_port} { | ||
|
|
||
| import proxy "wordpress:{{ WORDPRESS_PORT }}" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| --- | ||
| apiVersion: apps/v1 | ||
| kind: Deployment | ||
| metadata: | ||
| name: wordpress | ||
| labels: | ||
| app.kubernetes.io/name: wordpress | ||
| spec: | ||
| selector: | ||
| matchLabels: | ||
| app.kubernetes.io/name: wordpress | ||
| template: | ||
| metadata: | ||
| labels: | ||
| app.kubernetes.io/name: wordpress | ||
| spec: | ||
| initContainers: | ||
| - name: init-wordpress | ||
| image: {{ WORDPRESS_DOCKER_IMAGE }} | ||
| command: ['sh', '-c', 'chown -R www-data:www-data /var/www/html/wp-content'] | ||
| volumeMounts: | ||
| - name: wordpress-data | ||
| mountPath: /var/www/html/wp-content | ||
| securityContext: | ||
| runAsUser: 0 | ||
| containers: | ||
| - name: wordpress | ||
| image: {{ WORDPRESS_DOCKER_IMAGE }} | ||
| ports: | ||
| - containerPort: 8080 | ||
| env: | ||
| - name: WORDPRESS_DB_HOST | ||
| value: {{ WORDPRESS_MYSQL_HOST }} | ||
| - name: WORDPRESS_DB_USER | ||
| value: {{ WORDPRESS_MYSQL_USERNAME }} | ||
| - name: WORDPRESS_DB_PASSWORD | ||
| value: {{ WORDPRESS_MYSQL_PASSWORD }} | ||
| - name: WORDPRESS_DB_NAME | ||
| value: {{ WORDPRESS_MYSQL_DATABASE }} | ||
| - name: WORDPRESS_TABLE_PREFIX | ||
| value: {{ WORDPRESS_TABLE_PREFIX }} | ||
| volumeMounts: | ||
| - name: wordpress-data | ||
| mountPath: /var/www/html/wp-content | ||
| securityContext: | ||
| runAsUser: 33 | ||
| runAsGroup: 33 | ||
| volumes: | ||
| - name: wordpress-data | ||
| persistentVolumeClaim: | ||
| claimName: wordpress-data |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| --- | ||
| apiVersion: batch/v1 | ||
| kind: Job | ||
| metadata: | ||
| name: wordpress-job | ||
| labels: | ||
| app.kubernetes.io/component: job | ||
| spec: | ||
| template: | ||
| spec: | ||
| restartPolicy: Never | ||
| containers: | ||
| - name: wordpress | ||
| image: {{ WORDPRESS_DOCKER_IMAGE }} | ||
| volumeMounts: | ||
| - name: wordpress-data | ||
| mountPath: /var/www/html/wp-content | ||
| volumes: | ||
| - name: wordpress-data | ||
| persistentVolumeClaim: | ||
| claimName: wordpress-data |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| --- | ||
| apiVersion: v1 | ||
| kind: Service | ||
| metadata: | ||
| name: wordpress | ||
| spec: | ||
| type: ClusterIP | ||
| ports: | ||
| - port: {{ WORDPRESS_PORT }} | ||
| targetPort: 8080 | ||
| protocol: TCP | ||
| selector: | ||
| app.kubernetes.io/name: wordpress |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| --- | ||
| apiVersion: v1 | ||
| kind: PersistentVolumeClaim | ||
| metadata: | ||
| name: wordpress-data | ||
| labels: | ||
| app.kubernetes.io/component: volume | ||
| app.kubernetes.io/name: wordpress-data | ||
| spec: | ||
| accessModes: | ||
| - ReadWriteOnce | ||
| resources: | ||
| requests: | ||
| storage: {{ WORDPRESS_DATA_VOLUME_SIZE }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| - "{{ WORDPRESS_HOST }}" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| wordpress: | ||
| stdin_open: true | ||
| tty: true | ||
| ports: | ||
| - {{ WORDPRESS_PORT }}:8080 | ||
| environment: | ||
| WORDPRESS_DEBUG: 1 | ||
| WORDPRESS_CONFIG_EXTRA: | | ||
| define('WP_DEBUG', true); | ||
| define('WP_DEBUG_LOG', true); | ||
| define('WP_DEBUG_DISPLAY', true); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| wordpress-job: | ||
| image: {{ WORDPRESS_DOCKER_IMAGE }} | ||
| volumes: | ||
| - ../../data/wordpress:/var/www/html/wp-content | ||
CodeWithEmad marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| depends_on: | ||
| - lms | ||
| {% if RUN_MYSQL %}- mysql{% endif %} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| wordpress: | ||
| image: {{ WORDPRESS_DOCKER_IMAGE }} | ||
| restart: unless-stopped | ||
| environment: | ||
| WORDPRESS_DB_HOST: {{ WORDPRESS_MYSQL_HOST }} | ||
| WORDPRESS_DB_USER: {{ WORDPRESS_MYSQL_USERNAME }} | ||
| WORDPRESS_DB_PASSWORD: {{ WORDPRESS_MYSQL_PASSWORD }} | ||
| WORDPRESS_DB_NAME: {{ WORDPRESS_MYSQL_DATABASE }} | ||
| WORDPRESS_TABLE_PREFIX: {{ WORDPRESS_TABLE_PREFIX }} | ||
| volumes: | ||
| - ../../data/wordpress/wp-content:/var/www/html/wp-content | ||
| {%- if RUN_MYSQL %} | ||
| depends_on: | ||
| - mysql | ||
| {% endif -%} | ||
|
|
Uh oh!
There was an error while loading. Please reload this page.