From 94c2879cc06039f4020dda752a884660a5b8fc26 Mon Sep 17 00:00:00 2001 From: Niggl Date: Sat, 6 Jun 2020 22:23:54 +0200 Subject: [PATCH 01/22] Added env to dockerfile and docker-compose --- Dockerfile | 1 + docker-compose.yml | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 5a0fa3e..863edab 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,5 +14,6 @@ RUN npm run build # Stage 2: Package up with the webserver FROM nginx:alpine AS final +ENV API_URL "https://localhost:5001" COPY --from=build /build/dist/frontend /usr/share/nginx/html CMD ["/bin/sh", "-c", "envsubst < /usr/share/nginx/html/assets/env.template.js > /usr/share/nginx/html/assets/env.js && exec nginx -g 'daemon off;'"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index d542488..5da458c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,4 +8,6 @@ services: networks: - default ports: - - "8080:80" \ No newline at end of file + - "8080:80" + environment: + API_URL: http://localhost:5001 \ No newline at end of file From 3c73414288fa87802955c1ef0f844af16a71e1dc Mon Sep 17 00:00:00 2001 From: Niggl Date: Sat, 6 Jun 2020 22:25:04 +0200 Subject: [PATCH 02/22] Added build pipeline --- .gitlab-ci.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..2c8fece --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,25 @@ +image: docker:dind + +services: + - name: docker:dind + entrypoint: ["env", "-u", "DOCKER_HOST"] + command: ["dockerd-entrypoint.sh"] +variables: + DOCKER_HOST: tcp://docker:2375/ + DOCKER_DRIVER: overlay2 + DOCKER_TLS_CERTDIR: "" + +before_script: + - echo $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER --password-stdin $CI_REGISTRY + + +build: + stage: build + script: + - docker build . -t frontend:$CI_COMMIT_SHORT_SHA + - docker tag frontend:$CI_COMMIT_SHORT_SHA $CI_REGISTRY/taskboard/frontend:$CI_COMMIT_SHORT_SHA + - docker push $CI_REGISTRY/taskboard/frontend:$CI_COMMIT_SHORT_SHA + - docker tag frontend:$CI_COMMIT_SHORT_SHA $CI_REGISTRY/taskboard/frontend:latest + - docker push $CI_REGISTRY/taskboard/frontend:latest + tags: + - frontend \ No newline at end of file From ff6399fe5f810b94e624d4e8298be09bd4be488f Mon Sep 17 00:00:00 2001 From: Niggl Date: Sat, 6 Jun 2020 22:37:01 +0200 Subject: [PATCH 03/22] Updated compose to use the prebuild version --- docker-compose.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 5da458c..5ea3353 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,8 +2,7 @@ version: "3" services: app: - build: - context: . + image: scrumdev.azurecr.io/taskboard/frontend:latest restart: unless-stopped networks: - default From 57ad2efcfb2d2afae33fa0f61b716712999120bf Mon Sep 17 00:00:00 2001 From: Niggl Date: Sat, 6 Jun 2020 22:37:21 +0200 Subject: [PATCH 04/22] Added the private registry to the readme --- README.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 2a8d22d..cf08cb1 100644 --- a/README.md +++ b/README.md @@ -31,15 +31,14 @@ To get more help on the Angular CLI use `ng help` or go check out the [Angular C > Prerequisite: Docker and/or Docker Compose have to be installed on your system
> The Docker installation instructions for most operation systems can be found here: [https://docs.docker.com/get-docker/](https://docs.docker.com/get-docker/)
> The Docker Compose installation instructions for most operation systems can be found here: [https://docs.docker.com/compose/install/](https://docs.docker.com/compose/install/) +> To use the prebuild images log into the private registry: docker login -u testuser -p LpH2v1mShPpC8Xeimkd2AISA03zaC+vq scrumdev.azurecr.io ### Quick Deployment with Docker Compose 1. Clone the git repo 2. Open the cloned repo's folder in a shell of your choice (as long as it supports Docker) -3. Tell Docker Compose to build - if it hasn't already been built - and run the app with `docker-compose up` +3. Tell Docker Compose to run the app alongside a database with `docker-compose up` Other useful commands: -* Just build: `docker-compose build` -* Build before running: `docker-compose up --build` * Run attached (in the background): `docker-compose up -d` * Stop: `docker-compose down` * Restart: `docker-compose restart` @@ -47,9 +46,9 @@ Other useful commands: ### Build the Container yourself (and run it) 1. Clone the git repo 2. Open the cloned repo's folder in a shell of your choice (as long as it supports Docker) -3. Tell Docker to build the app under the name "frontend" with `docker build -t taskboard_frontend .` -4. Tell Docker to run the app on port 8080 with `docker run -p 8080:80 taskboard_frontend` +3. Tell Docker to build the app under the name "taskboard/frontend" with `docker build -t taskboard/frontend .` +4. Tell Docker to run the app on port 8080 with `docker run -p 8080:80 taskboard/frontend` Other useful commands: -* Run detached: `docker run -d -p 8080:80 taskboard_frontend` -* Run under specified name: `docker run -p 8080:80 --name frontend taskboard_frontend` \ No newline at end of file +* Run detached: `docker run -d -p 8080:80 taskboard/frontend` +* Run under specified name: `docker run -p 8080:80 --name frontend taskboard/frontend` \ No newline at end of file From 7baf6a73969facfdf5ac591dcdd4b21cc70819b3 Mon Sep 17 00:00:00 2001 From: Niggl Date: Mon, 8 Jun 2020 09:28:37 +0200 Subject: [PATCH 05/22] updated env var to not use ssl by default --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 863edab..c29977f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,6 +14,6 @@ RUN npm run build # Stage 2: Package up with the webserver FROM nginx:alpine AS final -ENV API_URL "https://localhost:5001" +ENV API_URL "http://localhost:5001" COPY --from=build /build/dist/frontend /usr/share/nginx/html CMD ["/bin/sh", "-c", "envsubst < /usr/share/nginx/html/assets/env.template.js > /usr/share/nginx/html/assets/env.js && exec nginx -g 'daemon off;'"] \ No newline at end of file From 8da9d76acf499afb6102c4ce313949daa45becb9 Mon Sep 17 00:00:00 2001 From: Niggl Date: Wed, 10 Jun 2020 13:04:56 +0200 Subject: [PATCH 06/22] Added Workaround for the routing problem --- Dockerfile | 1 + nginx.conf | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 nginx.conf diff --git a/Dockerfile b/Dockerfile index c29977f..2bccf44 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,4 +16,5 @@ RUN npm run build FROM nginx:alpine AS final ENV API_URL "http://localhost:5001" COPY --from=build /build/dist/frontend /usr/share/nginx/html +COPY nginx.conf /etc/nginx/nginx.conf CMD ["/bin/sh", "-c", "envsubst < /usr/share/nginx/html/assets/env.template.js > /usr/share/nginx/html/assets/env.js && exec nginx -g 'daemon off;'"] \ No newline at end of file diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..519e56f --- /dev/null +++ b/nginx.conf @@ -0,0 +1,8 @@ +server { + listen 80; + location / { + root /usr/share/nginx/html; + index index.html index.htm; + try_files $uri $uri/ /index.html =404; + } +} From 5e0161cb7cceed9fa159c2f8ddfe078f967064e7 Mon Sep 17 00:00:00 2001 From: Niggl Date: Wed, 10 Jun 2020 13:12:45 +0200 Subject: [PATCH 07/22] Added Fix for nginx --- nginx.conf | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/nginx.conf b/nginx.conf index 519e56f..54d595a 100644 --- a/nginx.conf +++ b/nginx.conf @@ -1,8 +1,14 @@ -server { +worker_processes 1; + +events { worker_connections 1024; } + +http { + server { listen 80; location / { root /usr/share/nginx/html; index index.html index.htm; try_files $uri $uri/ /index.html =404; } -} + } +} \ No newline at end of file From f25806507a0153b3eab82195b5fc1255e7938ded Mon Sep 17 00:00:00 2001 From: Niggl Date: Wed, 10 Jun 2020 13:25:26 +0200 Subject: [PATCH 08/22] Another nginx-angular related update --- nginx.conf | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/nginx.conf b/nginx.conf index 54d595a..6679ffa 100644 --- a/nginx.conf +++ b/nginx.conf @@ -3,12 +3,13 @@ worker_processes 1; events { worker_connections 1024; } http { - server { - listen 80; - location / { - root /usr/share/nginx/html; - index index.html index.htm; - try_files $uri $uri/ /index.html =404; - } - } + server { + listen 80; + root /usr/share/nginx/html; + include /etc/nginx/mime.types; + + location / { + try_files $uri /index.html; + } + } } \ No newline at end of file From aa223ffa1016c32593b0d12805a3bcda5a26cca5 Mon Sep 17 00:00:00 2001 From: test Date: Thu, 18 Jun 2020 10:45:31 +0200 Subject: [PATCH 09/22] styling userstory-form modal --- .../userstory-form.component.css | 12 +++ .../userstory-form.component.html | 87 +++++++++++++------ 2 files changed, 71 insertions(+), 28 deletions(-) diff --git a/src/app/userstory-form/userstory-form.component.css b/src/app/userstory-form/userstory-form.component.css index e69de29..cb7d33d 100644 --- a/src/app/userstory-form/userstory-form.component.css +++ b/src/app/userstory-form/userstory-form.component.css @@ -0,0 +1,12 @@ +.modal-footer{ + border-top: 0px solid; + padding-top: 5%; +} +.modal-lg{ + width: 1040px; +} + + .modal{ + margin: 0 auto; + + } \ No newline at end of file diff --git a/src/app/userstory-form/userstory-form.component.html b/src/app/userstory-form/userstory-form.component.html index 70f3d0b..416f3df 100644 --- a/src/app/userstory-form/userstory-form.component.html +++ b/src/app/userstory-form/userstory-form.component.html @@ -1,30 +1,61 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/app/userstory-form/userstory-form.component.ts b/src/app/userstory-form/userstory-form.component.ts index 28f605f..0312338 100644 --- a/src/app/userstory-form/userstory-form.component.ts +++ b/src/app/userstory-form/userstory-form.component.ts @@ -3,48 +3,42 @@ import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; import { BackendService, ScrumUserstory, Priority } from '../services/backend.service'; @Component({ - selector: 'app-userstory-form', - templateUrl: './userstory-form.component.html', - styleUrls: ['./userstory-form.component.css'] + selector: 'app-userstory-form', + templateUrl: './userstory-form.component.html', + styleUrls: [ './userstory-form.component.css' ] }) export class UserstoryFormComponent implements OnInit { + @Input() public userstory: ScrumUserstory; + private editing: boolean; + constructor(private backendService: BackendService, private activeModalService: NgbActiveModal) {} - @Input() - public userstory: ScrumUserstory; - private editing: boolean; + ngOnInit(): void { + if (this.userstory === null || this.userstory === undefined) { + this.userstory = { title: '' }; + this.editing = false; + } else { + this.editing = true; + } + } - constructor(private backendService: BackendService, private activeModalService: NgbActiveModal) { } - - ngOnInit(): void { - if (this.userstory === null || this.userstory === undefined) { - this.userstory = {title: ""}; - this.editing = false; - } - else - { - this.editing = true; - } - } - - onSubmit() { - if (this.editing) { - this.backendService.putUserstory(this.userstory).subscribe(response => { - if (response.status > 399) { - alert('Fehler'); - } - }); - } - else { - this.backendService.postUserstory(this.userstory).subscribe(response => { - if (response.status > 399) { - alert('Fehler'); - } - }); - } - this.activeModalService.close(this.userstory); - } - onClose(){ - this.activeModalService.dismiss(this.userstory); - } + onSubmit() { + if (this.editing) { + this.backendService.putUserstory(this.userstory).subscribe((response) => { + if (response.status > 399) { + alert('Fehler'); + } + }); + } else { + this.backendService.postUserstory(this.userstory).subscribe((response) => { + if (response.status > 399) { + alert('Fehler'); + } + }); + } + this.activeModalService.close(this.userstory); + } + onClose() { + this.activeModalService.dismiss(this.userstory); + } } From 07dba527944139e298720b95e7284e77d89e21bb Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 22 Jun 2020 12:02:11 +0200 Subject: [PATCH 11/22] edited taskform --- src/app/task-form/task-form.component.css | 12 +++ src/app/task-form/task-form.component.html | 90 +++++++++++++++------- src/app/task-form/task-form.component.ts | 81 +++++++++---------- 3 files changed, 115 insertions(+), 68 deletions(-) diff --git a/src/app/task-form/task-form.component.css b/src/app/task-form/task-form.component.css index e69de29..cc04e06 100644 --- a/src/app/task-form/task-form.component.css +++ b/src/app/task-form/task-form.component.css @@ -0,0 +1,12 @@ +.modal-footer { + border-top: 0px solid; + padding-top: 5%; +} +.modal-content { + width: 1040px; + right: 55%; +} + +.modal { + margin: 0 auto; +} diff --git a/src/app/task-form/task-form.component.html b/src/app/task-form/task-form.component.html index f61d287..e1abec3 100644 --- a/src/app/task-form/task-form.component.html +++ b/src/app/task-form/task-form.component.html @@ -1,30 +1,62 @@ -
- - Startdatum +
- - Enddatum +