This commit is contained in:
Leandro Facchinetti 2020-03-21 13:23:01 -04:00
parent 6a3fb6d693
commit 84340887bb
2 changed files with 7 additions and 18 deletions

View File

@ -61,6 +61,12 @@ The web server will be running at `http://localhost:8000` and the email server a
$ npx pm2 deploy package.json production setup $ npx pm2 deploy package.json production setup
``` ```
5. Migrate the existing feeds. 5. Migrate the existing feeds:
```console
$ ssh-add
$ ssh -A root@kill-the-newsletter.com
root@kill-the-newsletter.com $ rsync -av <path-to-previous-feeds> /root/www.kill-the-newsletter.com/current/static/feeds/
```
6. Push to GitHub, which will trigger the Action that deploys the code and starts the server. 6. Push to GitHub, which will trigger the Action that deploys the code and starts the server.

View File

@ -1,17 +0,0 @@
import xml2js from "xml2js";
import fs from "fs";
(async () => {
for (const feed of fs
.readdirSync("static/feeds")
.filter(file => !file.startsWith(".")))
try {
const xml = await new xml2js.Parser().parseStringPromise(
fs.readFileSync(`static/feeds/${feed}`, "utf8")
);
if (xml?.feed?.updated === undefined)
throw new Error("Cant find xml.feed.updated");
} catch (error) {
console.error(`Error for ${feed}: ${error}`);
}
})();