Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
2695acf
Added compose file for mongodb
Apr 21, 2022
3089a94
rename compose file
Apr 21, 2022
db53bd1
package-lock for node 12
Apr 21, 2022
bc7efd6
use volume for db dump
Apr 21, 2022
37612b7
Datamodel for event timeline and created gql api for updating event
Apr 21, 2022
e699f8a
wip: event form now uses gql -- in somewhat of a broken state
Apr 27, 2022
05e4c3c
wipetiwip
Apr 27, 2022
912afb8
wip yup schema
May 3, 2022
b812078
finished yup schema
May 5, 2022
6f5e045
Fixed event form using GQL
May 7, 2022
f1ac7ae
Fucken fixed
May 7, 2022
5e4e303
Fixed timeline for styling
May 16, 2022
b34ca86
Merge pull request #3 from CadusTech/feature/10-event-form-rework
ronkkol May 16, 2022
7eb6190
Unused import
May 16, 2022
005b000
fix for event form
May 18, 2022
a6c0270
render timeline on dashboard (#4)
ronkkol May 21, 2022
b679d0e
7 - Challenge database model (#2)
iirisjoutsi May 21, 2022
09a5722
feat: Improve event page button design
biharygergo Jun 11, 2022
80ec715
feat: Cover photo dimensions should be 16/9
biharygergo Jun 12, 2022
dc0e22b
feat: Improve organiser invitation drawer
biharygergo Jun 12, 2022
1ab87dd
calrified timeline -hint
Jun 14, 2022
ba4d5a3
Merge pull request #532 from CadusTech/dev
Eficnbo Jun 15, 2022
981d72b
Merge pull request #534 from biharygergo/improve-event-page-button
Eficnbo Jun 21, 2022
d945394
Merge pull request #536 from biharygergo/improve-organiser-invitation
Eficnbo Jun 21, 2022
ba5838c
Merge pull request #535 from biharygergo/fix-cover-photo-dimensions
Eficnbo Jun 28, 2022
5252d15
Feature/6 Add challenges page to dashboard (#7)
iirisjoutsi Jul 9, 2022
630b252
Merge pull request #549 from CadusTech/dev
Eficnbo Aug 26, 2022
579e833
playground remove
Eficnbo Sep 27, 2022
6bd15d8
added guidebookx
Eficnbo Nov 3, 2022
2470ea4
Create main.yml
samurotko Feb 14, 2023
2f205c5
Update main.yml
samurotko Feb 14, 2023
9809e04
Set up CI with Azure Pipelines
samurotko Feb 19, 2023
0392fb5
Update azure-pipelines.yml for Azure Pipelines
samurotko Feb 21, 2023
822993c
Bump minimist from 1.2.5 to 1.2.8
dependabot[bot] Mar 4, 2023
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
50 changes: 50 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Deployment pipeline

on:
push:
branches: [main]
pull_request:
branches: [einoSTAG]
types: [opened, synchronize]

workflow_dispatch:

jobs:
simple_deployment_pipeline:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '12.20.1'
- name: npm install
run: npm install
- name: npm setup
run: npm run setup
- name: 'Create backend env file'
run: |
cd backend
echo "${{ secrets.BACKEND_ENV_FILE }}" > .env
- name: 'Create frontend env file'
run: |
cd frontend
echo "${{ secrets.FRONTEND_ENV_FILE }}" > .env
- name: build
run: npm run build
- name: azure deploy
#if: ${{ github.event_name == 'push' && !(contains( join( toJson(github.event.commits.*.message) ), '#skip')) }}
uses: appleboy/scp-action@master # This is the action
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
key: ${{ secrets.SSH_KEY }}
overwrite: true
source: "backend/build"
target: "/usr/share/nginx/html/build"






3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
.DS_Store
scripts/
scripts/
dump/
39 changes: 39 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Node.js
# Build a general Node.js project with npm.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript

trigger:
- einoSTAG

pool:
vmImage: ubuntu-latest

steps:
- task: NodeTool@0
inputs:
versionSpec: '12.20.1'
displayName: 'Install Node.js'

- script: |
npm install
displayName: 'npm install'

- script: |
npm run build
displayName: 'npm build'

- task: CopyFilesOverSSH@0
inputs:
sshEndpoint: JunctionAppEurope# string. Required. SSH service connection.
sourceFolder: /backend/build # string. Source folder.
contents: '**' # string. Required. Contents. Default: **.
targetFolder: /usr/share/nginx/html/build # string. Target folder.
# Advanced
#isWindowsOnTarget: false # boolean. Target machine running Windows. Default: false.
cleanTargetFolder: true # boolean. Clean target folder. Default: false.
#cleanHiddenFilesInTarget: false # boolean. Optional. Use when cleanTargetFolder = true. Remove hidden files in target folder. Default: false.
readyTimeout: '20000' # string. Required. SSH handshake timeout. Default: 20000.
#overwrite: true # boolean. Overwrite. Default: true.
#failOnEmptySource: false # boolean. Fail if no files found to copy. Default: false.
#flattenFolders: false # boolean. Flatten folders. Default: false.
24 changes: 24 additions & 0 deletions backend/migrations/12-add-timeline-to-event.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
const mongoose = require('mongoose')
const Promise = require('bluebird')

module.exports = {
index: 12,
name: '12-add-timeline-to-event',
description: 'add timeline event',
run: async () => {
const nres = await mongoose
.model('Event')
.updateMany(
{ eventTimeline: { $exists: false } },
{ $set: { eventTimeline: { items: [] } } },
)
const bres = await mongoose
.model('Event')
.updateMany(
{ eventTimeline: null },
{ $set: { eventTimeline: { items: [] } } },
)
console.info('Done with event timeline', nres.n, nres.nModified)
return Promise.resolve()
},
}
18 changes: 18 additions & 0 deletions backend/migrations/13-set-eventLocation-null-where-not-exists.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const mongoose = require('mongoose')
const Promise = require('bluebird')

module.exports = {
index: 13,
name: '13-set-eventLocation-null-where-not-exists',
description: 'set eventLocation null where not exists',
run: async () => {
const nres = await mongoose
.model('Event')
.updateMany(
{ eventLocation: { $exists: false } },
{ $set: { eventLocation: null } },
)
console.info('Done with event timeline', nres.n, nres.nModified)
return Promise.resolve()
},
}
2 changes: 2 additions & 0 deletions backend/migrations/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ const migrations = [
require('./09-sync-registration-to-profiles'),
require('./10-add-banner-priority-and-approved-to-event'),
require('./11-add-organization-to-event'),
require('./12-add-timeline-to-event'),
require('./13-set-eventLocation-null-where-not-exists'),
]

const run = async () => {
Expand Down
9 changes: 9 additions & 0 deletions backend/modules/event/graphql-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,15 @@ class EventController {
return this._clean(Event.find().lean())
}

async update(id, event) {
if (!this.isAdmin) {
return null
}
return this._clean(
Event.findOneAndUpdate({ _id: id }, event, { new: true }),
)
}

async _clean(promise) {
const result = await promise
if (Array.isArray(result)) {
Expand Down
Loading