From 5bb2aa73e113a2b355433e8bc52daaaf0557cb90 Mon Sep 17 00:00:00 2001 From: cami Date: Mon, 12 Jul 2021 01:49:21 +0200 Subject: [PATCH 01/10] First drone-thing --- .drone.yml | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..895366f --- /dev/null +++ b/.drone.yml @@ -0,0 +1,59 @@ +kind: pipeline +type: docker +name: linux-amd64 + +platform: + os: linux + arch: amd64 + +steps: + - name: build + image: amd64/node:12.22.1-buster@sha256:436a6432b6f5109c2c70a1f71f5df0e7d29946a967e85882fe08a37f36b8bec4 + commands: + - npm install + - npm run build:ssr + - name: docker + image: plugins/docker + settings: + auto_tag: true + auto_tag_suffix: linux-amd64 + repo: cami/Bachelorthesis_Code + username: + from_secret: DOCKER_USERNAME + password: + from_secret: DOCKER_SECRET + when: + branch: + - main + event: + - push + +--- +kind: pipeline +type: docker +name: manifest + +steps: + - name: publish + image: plugins/manifest + settings: + auto_tag: true + ignore_missing: true + target: caminsha/behaviobio + template: caminsha/behaviobio:OS-ARCH + platforms: + - linux/amd64 + username: + from_secret: USERNAME + password: + from_secret: PASSWORD + +depends_on: + - linux-amd64 + +trigger: + branch: + - main + event: + - push + From 638a924f96996298ed82842cd61e2b82ecbf5643 Mon Sep 17 00:00:00 2001 From: cami Date: Mon, 12 Jul 2021 01:52:40 +0200 Subject: [PATCH 02/10] remove autotag --- .drone.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.drone.yml b/.drone.yml index 895366f..1a51886 100644 --- a/.drone.yml +++ b/.drone.yml @@ -15,8 +15,6 @@ steps: - name: docker image: plugins/docker settings: - auto_tag: true - auto_tag_suffix: linux-amd64 repo: cami/Bachelorthesis_Code username: from_secret: DOCKER_USERNAME @@ -37,7 +35,6 @@ steps: - name: publish image: plugins/manifest settings: - auto_tag: true ignore_missing: true target: caminsha/behaviobio template: caminsha/behaviobio:OS-ARCH From ce74bdeb399a1e9c29c8a56a10376c6a2388b21f Mon Sep 17 00:00:00 2001 From: cami Date: Mon, 12 Jul 2021 01:58:26 +0200 Subject: [PATCH 03/10] .. --- .drone.yml | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/.drone.yml b/.drone.yml index 1a51886..9378aa3 100644 --- a/.drone.yml +++ b/.drone.yml @@ -25,32 +25,3 @@ steps: - main event: - push - ---- -kind: pipeline -type: docker -name: manifest - -steps: - - name: publish - image: plugins/manifest - settings: - ignore_missing: true - target: caminsha/behaviobio - template: caminsha/behaviobio:OS-ARCH - platforms: - - linux/amd64 - username: - from_secret: USERNAME - password: - from_secret: PASSWORD - -depends_on: - - linux-amd64 - -trigger: - branch: - - main - event: - - push - From 5ab66c1e678a452160c37f3324997ec6e6d49b3d Mon Sep 17 00:00:00 2001 From: cami Date: Mon, 12 Jul 2021 02:00:08 +0200 Subject: [PATCH 04/10] removed steps things --- .drone.yml | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/.drone.yml b/.drone.yml index 9378aa3..572335b 100644 --- a/.drone.yml +++ b/.drone.yml @@ -6,22 +6,16 @@ platform: os: linux arch: amd64 -steps: - - name: build - image: amd64/node:12.22.1-buster@sha256:436a6432b6f5109c2c70a1f71f5df0e7d29946a967e85882fe08a37f36b8bec4 - commands: - - npm install - - npm run build:ssr - - name: docker - image: plugins/docker - settings: - repo: cami/Bachelorthesis_Code - username: - from_secret: DOCKER_USERNAME - password: - from_secret: DOCKER_SECRET - when: - branch: - - main - event: - - push +- name: docker + image: plugins/docker + settings: + repo: cami/Bachelorthesis_Code + username: + from_secret: DOCKER_USERNAME + password: + from_secret: DOCKER_SECRET + when: + branch: + - main + event: + - push From e81e07972739786c4c7fa13d6d8b8822f8a7eb29 Mon Sep 17 00:00:00 2001 From: cami Date: Mon, 12 Jul 2021 02:09:09 +0200 Subject: [PATCH 05/10] drone experiment --- .drone.yml | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/.drone.yml b/.drone.yml index 572335b..73bdbe6 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,21 +1,17 @@ kind: pipeline -type: docker name: linux-amd64 -platform: - os: linux - arch: amd64 - -- name: docker - image: plugins/docker - settings: - repo: cami/Bachelorthesis_Code - username: - from_secret: DOCKER_USERNAME - password: - from_secret: DOCKER_SECRET - when: - branch: - - main - event: - - push +steps: + - name: docker + image: plugins/docker + settings: + repo: cami/Bachelorthesis_Code + username: + from_secret: DOCKER_USERNAME + password: + from_secret: DOCKER_SECRET + when: + branch: + - main + event: + - push From 8c91f0baaf386f84bd16e81af127a6dbaeff41f3 Mon Sep 17 00:00:00 2001 From: cami Date: Mon, 12 Jul 2021 02:19:28 +0200 Subject: [PATCH 06/10] doing some things --- .drone.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.drone.yml b/.drone.yml index 73bdbe6..9a31bb8 100644 --- a/.drone.yml +++ b/.drone.yml @@ -2,16 +2,16 @@ kind: pipeline name: linux-amd64 steps: - - name: docker - image: plugins/docker - settings: - repo: cami/Bachelorthesis_Code - username: - from_secret: DOCKER_USERNAME - password: - from_secret: DOCKER_SECRET - when: - branch: - - main - event: - - push +- name: docker + image: plugins/docker + settings: + repo: cami/Bachelorthesis_Code + username: + from_secret: DOCKER_USERNAME + password: + from_secret: DOCKER_SECRET + when: + branch: + - main + event: + - push From c9a01ac68e662f231d1bcb4a38fae24426aa1603 Mon Sep 17 00:00:00 2001 From: cami Date: Mon, 12 Jul 2021 02:24:19 +0200 Subject: [PATCH 07/10] Two docker files --- .drone.yml | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 9a31bb8..62e46c1 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,11 +1,33 @@ kind: pipeline -name: linux-amd64 +name: backend steps: - name: docker image: plugins/docker settings: repo: cami/Bachelorthesis_Code + dockerfile: backend/Dockerfile + username: + from_secret: DOCKER_USERNAME + password: + from_secret: DOCKER_SECRET + when: + branch: + - main + event: + - push + +--- + +kind: pipeline +name: frontend + +steps: +- name: docker + image: plugins/docker + settings: + repo: cami/Bachelorthesis_Code + dockerfile: frontend/Dockerfile username: from_secret: DOCKER_USERNAME password: From 6d044c327101480a7fb07bd6600d9a2450e1cd0b Mon Sep 17 00:00:00 2001 From: cami Date: Mon, 12 Jul 2021 02:27:31 +0200 Subject: [PATCH 08/10] changed names and repos --- .drone.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.drone.yml b/.drone.yml index 62e46c1..fb221c1 100644 --- a/.drone.yml +++ b/.drone.yml @@ -2,10 +2,10 @@ kind: pipeline name: backend steps: -- name: docker +- name: backend image: plugins/docker settings: - repo: cami/Bachelorthesis_Code + repo: caminsha/behaviobio dockerfile: backend/Dockerfile username: from_secret: DOCKER_USERNAME @@ -23,10 +23,10 @@ kind: pipeline name: frontend steps: -- name: docker +- name: frontend image: plugins/docker settings: - repo: cami/Bachelorthesis_Code + repo: caminsha/behaviobio dockerfile: frontend/Dockerfile username: from_secret: DOCKER_USERNAME From 123ece89bea34a2b47c49f1cb1f8ac0730d578e6 Mon Sep 17 00:00:00 2001 From: cami Date: Mon, 12 Jul 2021 02:34:01 +0200 Subject: [PATCH 09/10] removed empty things.. --- .drone.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index fb221c1..b257bc3 100644 --- a/.drone.yml +++ b/.drone.yml @@ -16,9 +16,7 @@ steps: - main event: - push - --- - kind: pipeline name: frontend From 504e43258b7f5d1f71dbd0af0af5fb55c36e54b5 Mon Sep 17 00:00:00 2001 From: cami Date: Mon, 12 Jul 2021 02:36:07 +0200 Subject: [PATCH 10/10] added backend logging --- backend/src/app.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/backend/src/app.py b/backend/src/app.py index ff6b8b6..50f1cf5 100644 --- a/backend/src/app.py +++ b/backend/src/app.py @@ -4,6 +4,7 @@ import flask import flask_sqlalchemy import flask_praetorian import flask_cors +import sys db = flask_sqlalchemy.SQLAlchemy() guard = flask_praetorian.Praetorian() @@ -223,16 +224,12 @@ def survey(): return ret, 400 -@app.route('/api/protected/behavior', methods=['GET']) -@flask_praetorian.auth_required -def get_randompassword(): - print("Hallo") - - @app.route('/api/protected/behavior', methods=['POST']) @flask_praetorian.auth_required def check_password_username(): - print("hallooo POST") + print("hallooo POST", file=sys.stderr) + ret = {'message': 'Top'} + return ret, 200 # Run the example