Verified Commit f8f9b1fa authored by Sandro Lutz's avatar Sandro Lutz
Browse files

Add preview build (build-dev)

parent 953bc5e3
Pipeline #58297 passed with stages
in 9 minutes and 56 seconds
......@@ -4,6 +4,8 @@
# First stage: Build project
FROM node:13 as build
ARG NPM_BUILD_COMMAND=build
# Copy files and install dependencies
COPY ./ /gatsby/
......@@ -18,7 +20,7 @@ RUN npm install && \
RUN npm install -g gatsby-cli
# Build project
RUN npm run build
RUN npm run $NPM_BUILD_COMMAND
# Second stage: Server to deliver files
......
/**
* Url used for calls to the AMIV API
*/
export const apiUrl = 'https://api-dev.amiv.ethz.ch'
/**
* OAuth2 client id
*/
export const OAuthId = 'AMIV Website'
/**
* Enable/Disable verbose output.
*/
export const verbose = true
/**
* Date formatting options
*/
const dateFormatOptions = {
hour: 'numeric',
minute: 'numeric',
hour12: false,
timeZone: 'Europe/Zurich',
}
// Note that we need seperate objects for the different languages
// (or they would need to be reinitialized on language change)
export const dateFormatter = {
en: {
short: new Intl.DateTimeFormat('en-GB', {
...dateFormatOptions,
timeZoneName: 'short',
}),
weekday: new Intl.DateTimeFormat('en-GB', {
...dateFormatOptions,
year: 'numeric',
month: 'numeric',
day: 'numeric',
weekday: 'long',
}),
weekdayTimezone: new Intl.DateTimeFormat('en-GB', {
...dateFormatOptions,
year: 'numeric',
month: 'numeric',
day: 'numeric',
weekday: 'long',
timeZoneName: 'short',
}),
},
de: {
short: new Intl.DateTimeFormat('de-DE', {
...dateFormatOptions,
timeZoneName: 'short',
}),
weekday: new Intl.DateTimeFormat('de-DE', {
...dateFormatOptions,
year: 'numeric',
month: 'numeric',
day: 'numeric',
weekday: 'long',
}),
weekdayTimezone: new Intl.DateTimeFormat('de-DE', {
...dateFormatOptions,
year: 'numeric',
month: 'numeric',
day: 'numeric',
weekday: 'long',
timeZoneName: 'short',
}),
},
}
......@@ -67,13 +67,13 @@
"license": "MIT",
"scripts": {
"build": "gatsby build",
"build-dev": "GATSBY_ACTIVE_ENV=\"preview\" gatsby build",
"develop": "gatsby develop",
"eslint": "eslint src/*.js src/**/*.js",
"format": "prettier --write \"**/*.{js,jsx,json,md}\"",
"start": "npm run develop",
"serve": "gatsby serve",
"clean": "gatsby clean",
"test": "echo \"Write tests! -> https://gatsby.dev/unit-testing\" && exit 1"
"clean": "gatsby clean"
},
"repository": {
"type": "git",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment