浏览代码

:poop: trying drone kick-off 01

master
j 2 年前
父节点
当前提交
74f095b781
共有 1 个文件被更改,包括 32 次插入31 次删除
  1. 32
    31
      README.md

+ 32
- 31
README.md 查看文件

1
-Container Based Wordpress
2
-=========================
1
+# Container Based Wordpress
3
 
2
 
4
 [![Build Status](http://gitea.yvvas.com:8000/api/badges/craft-in-america/vue-wp/status.svg)](http://gitea.yvvas.com:8000/craft-in-america/vue-wp)
3
 [![Build Status](http://gitea.yvvas.com:8000/api/badges/craft-in-america/vue-wp/status.svg)](http://gitea.yvvas.com:8000/craft-in-america/vue-wp)
5
 
4
 
7
 
6
 
8
 Vue.js for sanity
7
 Vue.js for sanity
9
 
8
 
10
-:tools: Requirements
11
---------------------
9
+## :tools: Requirements
12
 
10
 
13
 ### Node.js 19+
11
 ### Node.js 19+
14
 
12
 
15
- * OSX: `brew install node` using [Homebrew](http://brew.sh/)
16
- * Linux: `apt install nodejs` ([see Ubuntu/Debian specific instructions](https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions)) or `pacman -S nodejs` (Arch Linux)
17
- * Windows: [Install](https://nodejs.org/en/download/)
13
+-   OSX: `brew install node` using [Homebrew](http://brew.sh/)
14
+-   Linux: `apt install nodejs` ([see Ubuntu/Debian specific instructions](https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions)) or `pacman -S nodejs` (Arch Linux)
15
+-   Windows: [Install](https://nodejs.org/en/download/)
18
 
16
 
19
 ### Docker & docker-compose
17
 ### Docker & docker-compose
20
 
18
 
21
- * OSX: TBD
22
- * Linux: TBD
23
- * Windows: TBD
24
-  
25
-:gear: Installation
26
--------------------
19
+-   OSX: TBD
20
+-   Linux: TBD
21
+-   Windows: TBD
22
+
23
+## :gear: Installation
27
 
24
 
28
 1. Clone repo: `git clone ssh://git@gitea.yvvas.com:4022/craft-in-america/vue-wp.git`
25
 1. Clone repo: `git clone ssh://git@gitea.yvvas.com:4022/craft-in-america/vue-wp.git`
29
 2. Get into the directory with `cd vue-wp`
26
 2. Get into the directory with `cd vue-wp`
35
 
32
 
36
 ### Post-Installation Configuration
33
 ### Post-Installation Configuration
37
 
34
 
38
-The initial Wordpress installation does *not* include any content or user data beyond the default, so we'll need to adjust some settings before we can use our custom theme.
35
+The initial Wordpress installation does _not_ include any content or user data beyond the default, so we'll need to adjust some settings before we can use our custom theme.
39
 
36
 
40
 1. The vue-theme is NOT enabled. Please enable it in the wp-admin page under `Appearance > Themes`
37
 1. The vue-theme is NOT enabled. Please enable it in the wp-admin page under `Appearance > Themes`
41
 2. The custom plugins must be enabled for our theme to work. Please activate them in the wp-admin page under `Plugins`. You should activate `craft-endpoints`, `craft-post-types`, and `posts-to-posts`
38
 2. The custom plugins must be enabled for our theme to work. Please activate them in the wp-admin page under `Plugins`. You should activate `craft-endpoints`, `craft-post-types`, and `posts-to-posts`
49
 4. Click 'Save Changes'
46
 4. Click 'Save Changes'
50
 5. Verify the API by [visiting the API endpoint](http://localhost:8080/wp-json/wp/v2/)
47
 5. Verify the API by [visiting the API endpoint](http://localhost:8080/wp-json/wp/v2/)
51
 
48
 
52
-:construction_site: Development
53
--------------------------------
49
+## :construction_site: Development
54
 
50
 
55
 After the `API` is active double check your settings in the `.env` file like so..
51
 After the `API` is active double check your settings in the `.env` file like so..
52
+
56
 ```
53
 ```
57
 DB_PASSWORD=<change_me>
54
 DB_PASSWORD=<change_me>
58
 WORDPRESS_DB_USER=<default_user>
55
 WORDPRESS_DB_USER=<default_user>
64
 
61
 
65
 Make sure `IS_DEV` is set to `true`. This is important.
62
 Make sure `IS_DEV` is set to `true`. This is important.
66
 
63
 
67
-Currently the API uses `localhost`. This should be changed in production. 
64
+Currently the API uses `localhost`. This should be changed in production.
68
 
65
 
69
 Set your directory owner to `www-data` with `docker exec -it craft-wp chown -R www-data:www-data ./wp-content` so your Wordpress container can write files
66
 Set your directory owner to `www-data` with `docker exec -it craft-wp chown -R www-data:www-data ./wp-content` so your Wordpress container can write files
70
 
67
 
71
-Lastly, run `npm run dev` to start the development server. 
68
+Lastly, run `npm run dev` to start the development server.
72
 
69
 
73
 If successful, it will tell you that it is running on `http://localhost:8081`
70
 If successful, it will tell you that it is running on `http://localhost:8081`
74
 
71
 
75
-:electric_plug: Deployment
76
---------------------------
72
+## :electric_plug: Deployment
73
+
77
 Setup a staging server and initialize a bare git repo in the `/opt` directory
74
 Setup a staging server and initialize a bare git repo in the `/opt` directory
78
 
75
 
79
 ```
76
 ```
85
 On your development machine, add the staging server as a remote...
82
 On your development machine, add the staging server as a remote...
86
 
83
 
87
 ```
84
 ```
88
-git remote add staging <user>@<server_ip>:/opt/staging/vue-wp.git 
85
+git remote add staging <user>@<server_ip>:/opt/staging/vue-wp.git
89
 ```
86
 ```
90
 
87
 
91
 When you are ready to get your app to the new server, run `git push && git push staging` and things will get pulled and built on the staging server. Sweet!
88
 When you are ready to get your app to the new server, run `git push && git push staging` and things will get pulled and built on the staging server. Sweet!
92
 
89
 
93
-:robot: CI/CD
94
--------------
90
+## :robot: CI/CD
95
 
91
 
96
-Included is a drone config, and some recommended steps to build. 
92
+Included is a drone config, and some recommended steps to build.
97
 
93
 
98
-* You MUST activate the pipeline
99
-* Add the `id_rsa` of the drone host to appropriate key in the pipeline secrets under the name `push_deploy_key`
94
+-   You MUST activate the pipeline
95
+-   Add the `id_rsa` of the drone host to appropriate key in the pipeline secrets under the name `push_deploy_key`
100
 
96
 
101
 You also need to setup a `post-receive` hook on the host server.
97
 You also need to setup a `post-receive` hook on the host server.
102
 
98
 
103
-* On your *development* machine, add the target host as a remote `git remote add </opt/staging/vue-wp.git> staging master`
104
-* Login to the *remote* machine and setup a bare git repo on `git init --bare </opt/staging/vue-wp.git>`
105
-* Copy the `post-receive` hook file into the `</opt/staging/vue-wp.git/hooks/>` directory
99
+-   On your _development_ machine, add the target host as a remote `git remote add </opt/staging/vue-wp.git> staging master`
100
+-   Login to the _remote_ machine and setup a bare git repo on `git init --bare </opt/staging/vue-wp.git>`
101
+-   Copy the `post-receive` hook file into the `</opt/staging/vue-wp.git/hooks/>` directory
106
 
102
 
107
-:question_mark: Misc
108
---------------------
103
+## :question_mark: Misc
109
 
104
 
110
 ### Backup commands
105
 ### Backup commands
111
 
106
 
112
 #### Uploads Directories
107
 #### Uploads Directories
108
+
113
 1. Download to development machine: `rsync -av <user>@<host>:/opt/vue-wp/uploads/ <local directory>`
109
 1. Download to development machine: `rsync -av <user>@<host>:/opt/vue-wp/uploads/ <local directory>`
114
 2. Upload from development machine: `rsync -azP <file-path-to>/uploads/* <user>@<host>:/opt/staging/vue-wp.git/uploads/`
110
 2. Upload from development machine: `rsync -azP <file-path-to>/uploads/* <user>@<host>:/opt/staging/vue-wp.git/uploads/`
115
 
111
 
116
 #### mysql Dump
112
 #### mysql Dump
113
+
117
 1. On the production machine:
114
 1. On the production machine:
115
+
118
 ```
116
 ```
119
 docker-compose exec -T craft-db mysqldump -u root -p current_cia | gzip > /home/<user_name>/backups/"`date +"%Y-%m-%d"`"-craftdb-backup.sql.gz
117
 docker-compose exec -T craft-db mysqldump -u root -p current_cia | gzip > /home/<user_name>/backups/"`date +"%Y-%m-%d"`"-craftdb-backup.sql.gz
120
 ```
118
 ```
119
+
121
 2. On your development machine: `rsync -av <user>@<host>:/home/<user>/<date>-craftdb-backup.sql.gz <local directory>`
120
 2. On your development machine: `rsync -av <user>@<host>:/home/<user>/<date>-craftdb-backup.sql.gz <local directory>`
122
 
121
 
123
 ```mysql
122
 ```mysql
124
 update wp_posts
123
 update wp_posts
125
    set guid = replace(guid, 'http://old', 'http://143.110.234.41:8080/');
124
    set guid = replace(guid, 'http://old', 'http://143.110.234.41:8080/');
126
 ```
125
 ```
126
+
127
+testing drone

正在加载...
取消
保存