From d52b2f45ad38e0f8da4a33e8c230d847d4137a7e Mon Sep 17 00:00:00 2001 From: Andrei Jiroh Eugenio Halili Date: Thu, 21 Apr 2022 15:09:20 +0000 Subject: [PATCH] Update documentation and then some --- .gitlab/ci/00-global.gitlab-ci.yml | 9 +++++---- README.md | 13 +++++++++++-- env.example.json | 14 ++++++++++++++ stdlib.json | 4 ++-- 4 files changed, 32 insertions(+), 8 deletions(-) create mode 100644 env.example.json diff --git a/.gitlab/ci/00-global.gitlab-ci.yml b/.gitlab/ci/00-global.gitlab-ci.yml index e1110dd..ae2583e 100644 --- a/.gitlab/ci/00-global.gitlab-ci.yml +++ b/.gitlab/ci/00-global.gitlab-ci.yml @@ -8,9 +8,10 @@ stages: default: before_script: - apk add bash coreutils wget - - echo WORKSPACE_PATH$PWD | tee ~/.librc >> /dev/null - - echo CREATED_AT=1650520343 | tee -a ~/.librc >> /dev/null - - echo $STDLIBRC | base64 -d | tee -a ~/.librc >> /dev/null - | - wget --header="Authorization: bearer $$SNIPPET_BYPASS_TOKEN" $ENV_JSON_FILE" -O ./env.json + echo WORKSPACE_PATH$PWD | tee ~/.librc >> /dev/null + echo CREATED_AT=1650520343 | tee -a ~/.librc >> /dev/null + echo STDLIBRC | base64 -d | tee -a ~/.librc >> /dev/null + - | + wget --header="Authorization: bearer $SNIPPET_BYPASS_TOKEN" $ENV_JSON_FILE" -O ./env.json - npm i diff --git a/README.md b/README.md index 80d86db..08fda0b 100755 --- a/README.md +++ b/README.md @@ -14,7 +14,16 @@ Requires Node.js 14+ and Autocode CLI if you want to do local development or eve 1. `npm install` 2. `npm start` to run an local FunctionScript gateway with hot reload included. -3. `curl -i http://localhost:8170/recaptime/rtapp-verify-backend/ping` +3. `curl -i http://localhost:8170/recaptime/rtapp-verify-backend/ping` to check if everything is ready + +### Deployment + +In order for this to work on your Autocode account, you need to update the value of `name` in `stdlib.json` to point to your namespace instead of pointing at `recaptime`. You also need to build your own `env.json` file before running `lib up dev`. + +1. Authenticate with `lib login`. +2. Prepare `env.json` using the template from `env.example.json`. DO NOT COMMIT! +3. Update the value `name` to point to your namespace (e.g. `username/your-app-here`). +4. Deploy with `lib up dev` ## Getting help @@ -27,4 +36,4 @@ Requires Node.js 14+ and Autocode CLI if you want to do local development or eve ## Credits -* [Hakiki](https://discord.gg/hakiki) for the landing page guide: \ No newline at end of file +* [Hakiki](https://discord.gg/hakiki) for the landing page guide: diff --git a/env.example.json b/env.example.json new file mode 100644 index 0000000..eff738a --- /dev/null +++ b/env.example.json @@ -0,0 +1,14 @@ +{ + "dev": { + "MONGO_DATABASE": "", + "GH_NAMESPACE": "RecapTimeSquad", + "GH_REPO_SLUG": "rtapp-verify-bot-testing", + "DISCORD_GUILD_ID": "953603786625146921", + "DISCORD_ROLE_ID": "953610409502449734", + "MW_OAUTH_ROOT": "https://meta.miraheze.org/w/rest.php", + "MW_OAUTH_CLIENT_ID": "123abc", + "MW_OAUTH_CLIENT_SECRET": "abc", + "MW_OAUTH_CALLBACK": "https://dev--rtapp-verify-backend.username.autocode.gg/oauth/mediawiki/callback/", + "TRIGGER_DEPLOY": "fbk3brkbjkrvbmebfk" + } +} \ No newline at end of file diff --git a/stdlib.json b/stdlib.json index 844a5c3..0141087 100755 --- a/stdlib.json +++ b/stdlib.json @@ -85,7 +85,7 @@ }, { "name": "TRIGGER_DEPLOY", - "description": "Trigger an manual deploy" + "description": "Trigger an manual deploy, usually used only on CI/CD." } ] -} \ No newline at end of file +}