This is a fusion themes based repository and is intended to be used as the starting point for using Arc Outboundfeeds. It doesn't matter if a client is currently using themes or not. This repo will be used to run Outbound feeds in its own dedicated environment.
Pre-requisites:
- node / npm installed (node version > 12).
- docker
- Create a local repo
Clone your Outbound Feeds repo to your local machine. In the arc-partners github account your repo will be named ORG-outboundfeeds, use your Arc organization name in place of ORG. For example, if your organization name is demo, your repo name would be demo-outboundfeeds.
git clone [email protected]:arc-partners/ORG-outboundfeeds.git
- Create a read-only personal access token in github
To be able to run locally or deploy outboundfeed bundles you need to create a read-only token in github. This token needs to be added to your .npmrc file and will allow you to view and install outboundfeeds blocks. The .npmrc file must never be added to the repo or checked in. Please use the following format when setting up your .npmrc:
@wpmedia:registry=https://npm.pkg.github.com/
//npm.pkg.github.com/:_authToken=<your personal access token>
- Install the packages
npm install
-
Create .env
Copy env.example to .env and edit the file to replace the placeholders with your correct values.
CONTENT_BASE
- Set your org inhttps://api.${ORG}.arcpublishing.com
ALC This is used by content sources to get data from your prod or sandbox environment. Replace ORG with your org name, like demo or sandbox.demo. This should point to your prod or sandbox environments, not the OBF environments.ARC_ACCESS_TOKEN
- your readonly developer token. ALC This is used by content sources to get data from your prod or sandbox environment. This should be from your prod or sandbox environments, not the OBF environments.- resizerKey - your orgs resizerKey. If you don’t have it, please contact your Technical Delivery Manager (TDM)
BLOCK_DIST_TAG
- To use production blocks, set this to 'stable', to use development blocks use 'beta'. Fusion defaults to stable if not set.
The .env file is in .gitignore and should never be checked into github.
-
Update Mock websites
When running the editor locally the list of websites comes from a local file instead of your site service. To have your websites used, you must update the mock file mocks/siteservice/api/v3/website
with your websites.
[
{
"_id": "website1",
"display_name": "Website 1",
"is_default_website": true
},
{
"_id": "website2",
"display_name": "Website 2",
"is_default_website": false
}
]
Run Fusion locally see here for more details:
npx fusion start
Once fusion has finished starting you should be able to to get to the pagebuilder editor pages and templates to add and configure feeds locally. Once you have create your templates and resolvers you can use a tool like postman to see them at http://localhost/arc/outboundfeeds/{FEED_NAME}?outputType=xml&_website={WEBSITE}
Run tests with:
npm test
- Once you are ready to deploy the bundle you will need to setup environment variables in the
environment/org-outboundfeeds.js
and orenvironment/org-outboundfeeds-sandbox.js
files. Use the values from your local .env to set theBLOCK_DIST_TAG
andresizerKey
. Rename the files, replacing the clients org name with theorg
in the current names. Any values that should not be made public (resizerKey) need to be encrypted.
Once you are ready to deploy a bundle, run the npx fusion zip command.
npx fusion zip
Upload the new bundle that was created in the dist folder using the deployer screen and promote it to Live to run your new bundle.
For more information on developing outbound feeds:
- intro
- blocks.json
- Ejecting blocks
- Block Architecture
- Dependencies
- Utilities
- Content Source
- Output Types
Example URLS: http://localhost/arc/outboundfeeds/rss/category/news/?outputType=xml&_website=910news