Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .firebaserc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"projects": {
"default": "parallel-cf800",
"prod": "parallel-cf800",
"default": "parallel-beta-31dc4",
"prod": "parallel-beta-31dc4",
"beta": "parallel-beta-31dc4"
}
}
40 changes: 40 additions & 0 deletions .github/workflows/beta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Deploy Beta

on:
workflow_dispatch:
pull_request:
types: [edited]

jobs:
deploy-beta:
name: Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Use Node.js version from .nvmrc
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc

- name: Write service account
run: |
mkdir private
echo "$BETA_FIREBASE_SERVICE_ACCOUNT" > ./private/service-account.json
echo '${{ secrets.BETA_FIREBASE_SERVICE_ACCOUNT }}' > gcloud.json
env:
BETA_FIREBASE_SERVICE_ACCOUNT: ${{ secrets.BETA_FIREBASE_SERVICE_ACCOUNT }}
shell: bash

- name: Install
run: |
npm install
shell: bash

- name: Deploy
env:
GOOGLE_APPLICATION_CREDENTIALS: gcloud.json
run: |
npm run deploy
shell: bash
2 changes: 1 addition & 1 deletion functions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
const firebase = require('firebase-admin');
firebase.initializeApp({
credential: firebase.credential.cert(require('./build/service-account.json')),
databaseURL: `https://parallel-cf800.firebaseio.com`,
databaseURL: `https://parallel-beta-31dc4.firebaseio.com`,
});

const fs = require('fs');
Expand Down
4 changes: 4 additions & 0 deletions functions/views/_layout.pug
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ html

body
#vue
.beta
div You are on our Beta Testing Site!
div The information & events on this page are for testing purposes and should not be followed.
a(href="https://parallel.org.uk") Click here to return to the production site.
.headerWrapper
.header
if !sidebarDisabled
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
},
"scripts": {
"start": "grunt build && npm run serve",
"serve": "grunt concurrent & GOOGLE_APPLICATION_CREDENTIALS=private/service-account.json firebase serve --project prod",
"export-users": "cross-env GOOGLE_APPLICATION_CREDENTIALS=private/service-account.json firebase auth:export ./private/tmp-users.json --format=json --project prod",
"deploy": "grunt && GOOGLE_APPLICATION_CREDENTIALS=private/service-account.json firebase deploy --project prod",
"serve": "grunt concurrent & GOOGLE_APPLICATION_CREDENTIALS=private/service-account.json firebase serve --project beta",
"export-users": "cross-env GOOGLE_APPLICATION_CREDENTIALS=private/service-account.json firebase auth:export ./private/tmp-users.json --format=json --project beta",
"deploy": "grunt && GOOGLE_APPLICATION_CREDENTIALS=private/service-account.json firebase deploy --project beta",
"convert-teachers": "node scripts/convert-teachers.js",
"convert-students": "node scripts/convert-students.js",
"get-users": "node scripts/get-users.js",
Expand All @@ -20,7 +20,7 @@
"get-tts-results": "node scripts/get-tts-results.js",
"update-results": "node scripts/update-results.js",
"set-points": "node scripts/set-points.js",
"start-marsh": "grunt build && concurrently \"grunt concurrent\" \"GOOGLE_APPLICATION_CREDENTIALS=private/service-account.json firebase serve --project prod\""
"start-marsh": "grunt build && concurrently \"grunt concurrent\" \"GOOGLE_APPLICATION_CREDENTIALS=private/service-account.json firebase serve --project beta\""
},
"devDependencies": {
"@babel/core": "^7.15.0",
Expand Down
4 changes: 2 additions & 2 deletions pages/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

In order for pupils to receive the weekly email reminder to take part in the latest Parallelograms and successfully manage their account and password, you may need your school's IT department to whitelist the following addresses:

* noreply@parallel-cf800.firebaseapp.com
* https://parallel-cf800.firebaseapp.com
* noreply@parallel-beta-31dc4.firebaseapp.com
* https://parallel-beta-31dc4.firebaseapp.com
* contact@parallel.org.uk
* https://parallel.org.uk/

Expand Down
2 changes: 1 addition & 1 deletion scripts/change-email.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const to = 'lalanthi026@googlemail.com'

fb.initializeApp({
credential: fb.credential.cert(serviceAccount),
databaseURL: "https://parallel-cf800.firebaseio.com",
databaseURL: "https://parallel-beta-31dc4.firebaseio.com",
});

const run = () =>
Expand Down
2 changes: 1 addition & 1 deletion scripts/convert-students.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const STUDENTS = [

fb.initializeApp({
credential: fb.credential.cert(serviceAccount),
databaseURL: 'https://parallel-cf800.firebaseio.com'
databaseURL: 'https://parallel-beta-31dc4.firebaseio.com'
});

const file = path.join(__dirname, `../private/tmp-users.json`);
Expand Down
2 changes: 1 addition & 1 deletion scripts/convert-teachers.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const TEACHERS = [

fb.initializeApp({
credential: fb.credential.cert(serviceAccount),
databaseURL: 'https://parallel-cf800.firebaseio.com'
databaseURL: 'https://parallel-beta-31dc4.firebaseio.com'
});

const file = path.join(__dirname, `../private/tmp-users.json`);
Expand Down
2 changes: 1 addition & 1 deletion scripts/delete-accounts.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const USERS = [

fb.initializeApp({
credential: fb.credential.cert(serviceAccount),
databaseURL: 'https://parallel-cf800.firebaseio.com'
databaseURL: 'https://parallel-beta-31dc4.firebaseio.com'
});

async function deleteAccount(email) {
Expand Down
2 changes: 1 addition & 1 deletion scripts/privacy-approve.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const dryRun = true; // when true, will just log what it will write, but not sav

fb.initializeApp({
credential: fb.credential.cert(serviceAccount),
databaseURL: 'https://parallel-cf800.firebaseio.com'
databaseURL: 'https://parallel-beta-31dc4.firebaseio.com'
});

const userDb = fb.firestore().collection('users');
Expand Down
2 changes: 1 addition & 1 deletion scripts/privacy-y8webinar.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const dryRun = true; // when true, will just log what it will write, but not sav

fb.initializeApp({
credential: fb.credential.cert(serviceAccount),
databaseURL: 'https://parallel-cf800.firebaseio.com'
databaseURL: 'https://parallel-beta-31dc4.firebaseio.com'
});

const userDb = fb.firestore().collection('users');
Expand Down
2 changes: 1 addition & 1 deletion scripts/recover-account.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const makePassword = () => {

fb.initializeApp({
credential: fb.credential.cert(serviceAccount),
databaseURL: "https://parallel-cf800.firebaseio.com",
databaseURL: "https://parallel-beta-31dc4.firebaseio.com",
});

const updateUserPassword = (email) =>
Expand Down
2 changes: 1 addition & 1 deletion scripts/set-account-level.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const isEuclidAdmin = true;

fb.initializeApp({
credential: fb.credential.cert(serviceAccount),
databaseURL: "https://parallel-cf800.firebaseio.com",
databaseURL: "https://parallel-beta-31dc4.firebaseio.com",
});

const setAdmin = () => {
Expand Down
2 changes: 1 addition & 1 deletion scripts/switch-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const TO_EMAIL = "jmanyoma20@gmail.com";

fb.initializeApp({
credential: fb.credential.cert(serviceAccount),
databaseURL: "https://parallel-cf800.firebaseio.com",
databaseURL: "https://parallel-beta-31dc4.firebaseio.com",
});

const getAnswerCount = (data) =>
Expand Down
2 changes: 1 addition & 1 deletion scripts/temp-update-levels/fix-levels-run.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const limit = promiseLimit(400);

fb.initializeApp({
credential: fb.credential.cert(serviceAccount),
databaseURL: 'https://parallel-cf800.firebaseio.com'
databaseURL: 'https://parallel-beta-31dc4.firebaseio.com'
});

const userDb = fb.firestore().collection('users');
Expand Down
2 changes: 1 addition & 1 deletion scripts/update-euclid-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const dryRun = true; // when true, will just log what it will write, but not sav

fb.initializeApp({
credential: fb.credential.cert(serviceAccount),
databaseURL: 'https://parallel-cf800.firebaseio.com'
databaseURL: 'https://parallel-beta-31dc4.firebaseio.com'
});
const userDb = fb.firestore().collection('users');

Expand Down
2 changes: 1 addition & 1 deletion scripts/update-results.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const ADD_POINTS = 2;

fb.initializeApp({
credential: fb.credential.cert(serviceAccount),
databaseURL: 'https://parallel-cf800.firebaseio.com'
databaseURL: 'https://parallel-beta-31dc4.firebaseio.com'
});
const userDb = fb.firestore().collection('users');

Expand Down
2 changes: 1 addition & 1 deletion scripts/utils/downloadUsers.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const serviceAccount = require('../../private/service-account.json');

fb.initializeApp({
credential: fb.credential.cert(serviceAccount),
databaseURL: 'https://parallel-cf800.firebaseio.com'
databaseURL: 'https://parallel-beta-31dc4.firebaseio.com'
});

const cacheFilePath = path.join(__dirname, `../../private/cache-users.json`);
Expand Down
2 changes: 1 addition & 1 deletion scripts/yearly-updates/delete-old-users.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const serviceAccount = require("../../private/service-account.json");

fb.initializeApp({
credential: fb.credential.cert(serviceAccount),
databaseURL: "https://parallel-cf800.firebaseio.com",
databaseURL: "https://parallel-beta-31dc4.firebaseio.com",
});

const keysToRemove = [
Expand Down
2 changes: 1 addition & 1 deletion scripts/yearly-updates/update-users-upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const limit = promiseLimit(400);

fb.initializeApp({
credential: fb.credential.cert(serviceAccount),
databaseURL: 'https://parallel-cf800.firebaseio.com'
databaseURL: 'https://parallel-beta-31dc4.firebaseio.com'
});

const userDb = fb.firestore().collection('users');
Expand Down
6 changes: 3 additions & 3 deletions static/scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ document.addEventListener("wheel", function(event){

document.addEventListener('DOMContentLoaded', function() {
firebase.initializeApp({
apiKey: "AIzaSyCrQ_PdH-05lcNWETGvGfiwO3MBXk_WeVU",
projectId: "parallel-cf800",
authDomain: "parallel-cf800.firebaseapp.com",
apiKey: "AIzaSyDk4_ME-Uy1D3Yjg94Af7Gzhg3I1xNYWp8",
projectId: "parallel-beta-31dc4",
authDomain: "parallel-beta-31dc4.firebaseapp.com",
});

const user = getUser();
Expand Down
11 changes: 11 additions & 0 deletions static/styles/layout.less
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,17 @@ html {
line-height: 1.8;
}

.beta {
background-color: orange;
margin: 0px -1rem;
text-align: center;

a {
color: blue;
text-decoration: underline;
}
}

#logo {
background: url('/images/logo.png');
background-size: cover;
Expand Down
Loading