Skip to content

Commit

Permalink
Merge pull request #1 from UniversityOfHelsinkiCS/trunk
Browse files Browse the repository at this point in the history
Remove fields related to old grading from add new thesis view
  • Loading branch information
vaahtokarkki authored Aug 23, 2021
2 parents 6ada661 + 7492fc8 commit de09c5f
Show file tree
Hide file tree
Showing 21 changed files with 425 additions and 203 deletions.
18 changes: 17 additions & 1 deletion .github/workflows/staging-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Release staging backend
on:
push:
branches:
- main
- trunk
paths:
- 'backend/**'
- '.github/workflows/staging-backend.yml'
Expand All @@ -29,3 +29,19 @@ jobs:
tags: toska/back-grappa2:staging
build-args: |
GIT_SHA=${{ github.sha }}
sentry-release:
runs-on: ubuntu-latest
needs: build

steps:
- uses: actions/checkout@v2
- name: Create Sentry release
uses: getsentry/action-release@v1
env:
SENTRY_URL: https://sentry.cs.helsinki.fi
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: toska
SENTRY_PROJECT: grappa
with:
environment: staging
set_commits: 'skip'
29 changes: 28 additions & 1 deletion .github/workflows/staging-frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Release staging frontend
on:
push:
branches:
- main
- trunk
paths:
- 'frontend/**'
- '.github/workflows/staging-frontend.yml'
Expand All @@ -29,5 +29,32 @@ jobs:
push: true
tags: toska/front-grappa2:staging
build-args: |
NODE_ENV=staging
BASE_PATH=/staging/
GIT_SHA=${{ github.sha }}
sentry-release:
runs-on: ubuntu-latest
needs: build

steps:
- uses: actions/checkout@v2

- name: Pull image and create a container
run: docker create --name front-grappa2 toska/front-grappa2:staging

- name: Copy assets from the container
run: docker cp front-grappa2:/usr/src/app/build ./build

- name: Create Sentry release
uses: getsentry/action-release@v1
env:
SENTRY_URL: https://sentry.cs.helsinki.fi
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: toska
SENTRY_PROJECT: grappa
with:
environment: staging
set_commits: 'skip'
sourcemaps: './build/static/js'
url_prefix: '~/staging/static/js'
10 changes: 8 additions & 2 deletions backend/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,24 @@ require('dotenv').config()
require('babel-core/register')
require('babel-polyfill')
const express = require('express')
const Raven = require('raven')
const Sentry = require('@sentry/node')

const cors = require('cors')
const gracefulExit = require('express-graceful-exit')
const logger = require('./src/util/logger')
const routes = require('./src/routes.js')
const errorHandler = require('./src/util/errorHandler')
const initializeSentry = require('./src/util/sentry')

const app = express()

initializeSentry(app)

app.use(Sentry.Handlers.requestHandler())
app.use(Sentry.Handlers.tracingHandler())

const server = require('http').createServer(app)

Raven.config(process.env.SENTRY_ADDR).install()

app.listen(3100, () => {
logger.info('Grappa app listening on port 3100!')
Expand Down
185 changes: 140 additions & 45 deletions backend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
},
"homepage": "https://github.com/UniversityOfHelsinkiCS/back-grappa2#readme",
"dependencies": {
"@sentry/node": "^6.4.1",
"axios": "^0.19.2",
"babel-core": "^6.26.3",
"babel-polyfill": "^6.26.0",
Expand All @@ -50,7 +51,6 @@
"nodemailer": "^4.6.8",
"pdfkit": "^0.8.3",
"pg": "^7.6.1",
"raven": "^2.6.4",
"request": "^2.88.0",
"utf8": "^3.0.0",
"uuid": "^3.3.2",
Expand Down
3 changes: 3 additions & 0 deletions backend/src/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ const accessLogger = morgan((tokens, req, res) => {
})

module.exports = (app) => {
app.use('/sandbox', (req, res) => { //eslint-disable-line
throw new Error('Grappa ei toimi :eitoimi:')
})
app.use(auditLogger)
app.use(login)
app.use(auth.checkAuth, accessLogger)
Expand Down
Loading

0 comments on commit de09c5f

Please sign in to comment.