Skip to content

Commit

Permalink
[CMSP-319] Updates references to 'blog' or 'subsite' to 'site' (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
pwtyler authored Apr 11, 2023
1 parent 491b67c commit 912244d
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 48 deletions.
6 changes: 3 additions & 3 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ The basic format for the file is:
api_version: 1
domain_maps:
{env_name}:
{blog_id}: {site_url}
{site_id}: {site_url}
```
A `sites.yml` file is valid if:
- the `api_version` is `1`
- the key for each item in `domain_maps` is a valid Pantheon environment name (`dev`, `test`, `multidev`, etc.)
- For each subsite listed for an environment:
- For each site listed for an environment:
- the key is an integer
- the value is a valid Pantheon hostname
- there are no more than 25 subsites listed for any environment
- there are no more than 25 sites listed for any environment

## Install

Expand Down
6 changes: 3 additions & 3 deletions fixtures/sites/valid.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
---
api_version: 1 # Currently only one api version.

# "domain_maps" is a collection of blog URLs for each environment used to
# "domain_maps" is a collection of site URLs for each environment used to
# facilitate search-replace of a WordPress Multisite (WPMS) across pantheon
# environments. Each key of "domain_maps" must be a valid environment name.
domain_maps:
# environment: <collection of domains to be used on this environment>
# i.e. dev, test, live, feat-branch, &c.
dev:
# each environment collection maps the blog ID to its URL. A url must be
# each environment collection maps the site ID to its URL. A url must be
# set in both the target and source environments for search-replace to be
# run.
# i.e. 2: blog1-mysite.com
# i.e. 2: site1-mysite.com
1: dev-srtest.pantheonsite.io
2: about.dev-srtest.pantheonsite.io
3: employee-resources.dev-srtest.pantheonsite.io
Expand Down
4 changes: 2 additions & 2 deletions pkg/model/sites.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ type SitesYml struct {
DomainMaps DomainMaps `yaml:"domain_maps"`
}

// DomainMaps is a collection of blog ID/blog domains keyed by environment name.
// DomainMaps is a collection of site ID/site domains keyed by environment name.
type DomainMaps map[string]DomainMapByEnvironment

// DomainMapByEnvironment is a collection of site (blog) domains keyed by blog ID.
// DomainMapByEnvironment is a collection of site domains keyed by site ID.
type DomainMapByEnvironment map[int]string
80 changes: 40 additions & 40 deletions pkg/validator/sites_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,16 @@ func TestValidate(t *testing.T) {
APIVersion: 1,
DomainMaps: model.DomainMaps{
"dev": model.DomainMapByEnvironment{
1: "blog1.dev-mysite.pantheonsite.io",
1: "site1.dev-mysite.pantheonsite.io",
},
"test": model.DomainMapByEnvironment{
1: "blog1.dev-mysite.pantheonsite.io",
1: "site1.dev-mysite.pantheonsite.io",
},
"live": model.DomainMapByEnvironment{
1: "blog1.mysite.com",
1: "site1.mysite.com",
},
"autopilot": model.DomainMapByEnvironment{
1: "blog1.autopilot-mysite.pantheonsite.io",
1: "site1.autopilot-mysite.pantheonsite.io",
},
},
},
Expand All @@ -70,10 +70,10 @@ func TestValidate(t *testing.T) {
APIVersion: 1,
DomainMaps: model.DomainMaps{
"dev": model.DomainMapByEnvironment{
1: "blog1.dev-mysite.pantheonsite.io",
1: "site1.dev-mysite.pantheonsite.io",
},
"mylongmultidevname": model.DomainMapByEnvironment{
1: "blog1.mylongmultidevname-mysite.pantheonsite.io",
1: "site1.mylongmultidevname-mysite.pantheonsite.io",
},
},
},
Expand All @@ -85,10 +85,10 @@ func TestValidate(t *testing.T) {
APIVersion: 1,
DomainMaps: model.DomainMaps{
"dev": model.DomainMapByEnvironment{
1: "blog1.dev-mysite.pantheonsite.io",
1: "site1.dev-mysite.pantheonsite.io",
},
"feat_branch": model.DomainMapByEnvironment{
1: "blog1.feat-branch-mysite.pantheonsite.io",
1: "site1.feat-branch-mysite.pantheonsite.io",
},
},
},
Expand All @@ -100,38 +100,38 @@ func TestValidate(t *testing.T) {
APIVersion: 1,
DomainMaps: model.DomainMaps{
"dev": model.DomainMapByEnvironment{
1: "blog1.dev-mysite.pantheonsite.io",
2: "blog2.dev-mysite.pantheonsite.io",
3: "blog3.dev-mysite.pantheonsite.io",
4: "blog4.dev-mysite.pantheonsite.io",
5: "blog5.dev-mysite.pantheonsite.io",
6: "blog6.dev-mysite.pantheonsite.io",
7: "blog7.dev-mysite.pantheonsite.io",
8: "blog8.dev-mysite.pantheonsite.io",
9: "blog9.dev-mysite.pantheonsite.io",
10: "blog10.dev-mysite.pantheonsite.io",
11: "blog11.dev-mysite.pantheonsite.io",
12: "blog12.dev-mysite.pantheonsite.io",
13: "blog13.dev-mysite.pantheonsite.io",
14: "blog14.dev-mysite.pantheonsite.io",
15: "blog15.dev-mysite.pantheonsite.io",
16: "blog16.dev-mysite.pantheonsite.io",
17: "blog17.dev-mysite.pantheonsite.io",
18: "blog18.dev-mysite.pantheonsite.io",
19: "blog19.dev-mysite.pantheonsite.io",
20: "blog20.dev-mysite.pantheonsite.io",
21: "blog21.dev-mysite.pantheonsite.io",
22: "blog22.dev-mysite.pantheonsite.io",
23: "blog23.dev-mysite.pantheonsite.io",
24: "blog24.dev-mysite.pantheonsite.io",
25: "blog25.dev-mysite.pantheonsite.io",
26: "blog26.dev-mysite.pantheonsite.io",
27: "blog27.dev-mysite.pantheonsite.io",
28: "blog28.dev-mysite.pantheonsite.io",
29: "blog29.dev-mysite.pantheonsite.io",
1: "site1.dev-mysite.pantheonsite.io",
2: "site2.dev-mysite.pantheonsite.io",
3: "site3.dev-mysite.pantheonsite.io",
4: "site4.dev-mysite.pantheonsite.io",
5: "site5.dev-mysite.pantheonsite.io",
6: "site6.dev-mysite.pantheonsite.io",
7: "site7.dev-mysite.pantheonsite.io",
8: "site8.dev-mysite.pantheonsite.io",
9: "site9.dev-mysite.pantheonsite.io",
10: "site10.dev-mysite.pantheonsite.io",
11: "site11.dev-mysite.pantheonsite.io",
12: "site12.dev-mysite.pantheonsite.io",
13: "site13.dev-mysite.pantheonsite.io",
14: "site14.dev-mysite.pantheonsite.io",
15: "site15.dev-mysite.pantheonsite.io",
16: "site16.dev-mysite.pantheonsite.io",
17: "site17.dev-mysite.pantheonsite.io",
18: "site18.dev-mysite.pantheonsite.io",
19: "site19.dev-mysite.pantheonsite.io",
20: "site20.dev-mysite.pantheonsite.io",
21: "site21.dev-mysite.pantheonsite.io",
22: "site22.dev-mysite.pantheonsite.io",
23: "site23.dev-mysite.pantheonsite.io",
24: "site24.dev-mysite.pantheonsite.io",
25: "site25.dev-mysite.pantheonsite.io",
26: "site26.dev-mysite.pantheonsite.io",
27: "site27.dev-mysite.pantheonsite.io",
28: "site28.dev-mysite.pantheonsite.io",
29: "site29.dev-mysite.pantheonsite.io",
},
"mdev": model.DomainMapByEnvironment{
1: "blog1.mdev-mysite.pantheonsite.io",
1: "site1.mdev-mysite.pantheonsite.io",
},
},
},
Expand All @@ -143,13 +143,13 @@ func TestValidate(t *testing.T) {
APIVersion: 1,
DomainMaps: model.DomainMaps{
"dev": model.DomainMapByEnvironment{
1: "blog1.dev-mysite.pantheonsite.io",
1: "site1.dev-mysite.pantheonsite.io",
},
"test": model.DomainMapByEnvironment{
1: "$(sudo do something dangerous)",
},
"live": model.DomainMapByEnvironment{
1: "blog1.mysite.com",
1: "site1.mysite.com",
},
},
},
Expand Down

0 comments on commit 912244d

Please sign in to comment.