Lint and update dockerfile for deploying
This commit is contained in:
parent
748fb37511
commit
f2e330df61
@ -10,10 +10,6 @@ then
|
||||
else
|
||||
echo "No version bump"
|
||||
git push
|
||||
git tag --delete latest
|
||||
git tag latest
|
||||
git push --delete origin latest
|
||||
git push --tags
|
||||
fi
|
||||
|
||||
cd docker/app || exit
|
||||
|
@ -1,14 +1,14 @@
|
||||
FROM node:latest AS builder
|
||||
ADD https://git.tanshu.com/api/v1/repos/tanshu/barker/tags /tags.json
|
||||
RUN git clone --single-branch --depth 1 --branch latest https://git.tanshu.com/tanshu/barker.git /app
|
||||
WORKDIR /app/bookie
|
||||
RUN npm install --unsafe-perm --legacy-peer-deps && /app/bookie/node_modules/.bin/ng build --prod
|
||||
ADD https://git.tanshu.com/api/v1/repos/tanshu/luthor/branches/main /main.json
|
||||
RUN git clone --single-branch --depth 1 --branch latest https://git.tanshu.com/tanshu/luthor.git /app
|
||||
WORKDIR /app/otis
|
||||
RUN npm install --unsafe-perm --legacy-peer-deps && /app/otis/node_modules/.bin/ng build --prod
|
||||
|
||||
|
||||
FROM python:latest
|
||||
LABEL maintainer="Amritanshu <docker@tanshu.com>"
|
||||
|
||||
COPY --from=builder /app/barker /app
|
||||
COPY --from=builder /app/luthor /app
|
||||
COPY --from=builder /app/frontend /app/frontend
|
||||
|
||||
RUN apt-get update && \
|
||||
|
@ -2,16 +2,12 @@ HOST=0.0.0.0
|
||||
PORT=80
|
||||
LOG_LEVEL=WARN
|
||||
DEBUG=false
|
||||
SQLALCHEMY_DATABASE_URI=postgresql://postgres:123456@db:5432/petty
|
||||
MODULE_NAME=barker.main
|
||||
PROJECT_NAME=barker
|
||||
REDIS_HOST=redis
|
||||
REDIS_PORT=6379
|
||||
SECRET_KEY=611f9393e58f85521d16d9497bfd847ced70f2b99e12a9c6af40b7bd05cc7b1d
|
||||
MIDDLEWARE_SECRET_KEY=c4afceca1a
|
||||
SQLALCHEMY_DATABASE_URI=postgresql://postgres:123456@db:5432/luthor
|
||||
MODULE_NAME=luthor.main
|
||||
PROJECT_NAME=luthor
|
||||
SECRET_KEY=0500a11310479deb2e3a729b59ee65c5f832da30d86624ec88619315054bea92
|
||||
MIDDLEWARE_SECRET_KEY=70282004a7
|
||||
ALGORITHM=HS256
|
||||
JWT_TOKEN_EXPIRE_MINUTES=30
|
||||
NEW_DAY_OFFSET_MINUTES=420
|
||||
TIMEZONE_OFFSET_MINUTES=330
|
||||
ALEMBIC_LOG_LEVEL=INFO
|
||||
ALEMBIC_SQLALCHEMY_LOG_LEVEL=WARN
|
||||
|
@ -11,9 +11,9 @@
|
||||
- name: Copy dockerfile
|
||||
synchronize: src=app dest=/tmp
|
||||
|
||||
- name: Build barker image
|
||||
- name: Build luthor image
|
||||
docker_image:
|
||||
name: barker:latest
|
||||
name: luthor:latest
|
||||
build:
|
||||
path: /tmp/app/
|
||||
dockerfile: /tmp/app/Dockerfile
|
||||
@ -21,47 +21,25 @@
|
||||
state: present
|
||||
source: build
|
||||
|
||||
- name: Build barker worker image
|
||||
docker_image:
|
||||
name: barker-worker:latest
|
||||
build:
|
||||
path: /tmp/app/
|
||||
dockerfile: /tmp/app/worker.Dockerfile
|
||||
pull: yes
|
||||
state: present
|
||||
source: build
|
||||
|
||||
- name: Upload the .env file
|
||||
template:
|
||||
src: "files/.env"
|
||||
dest: "/var/lib/{{ host_directory }}/.env"
|
||||
|
||||
- name: Create barker container
|
||||
- name: Create luthor container
|
||||
docker_container:
|
||||
name: "{{ host_directory }}"
|
||||
image: barker:latest
|
||||
image: luthor:latest
|
||||
state: started
|
||||
restart_policy: "unless-stopped"
|
||||
env_file: "/var/lib/{{ host_directory }}/.env"
|
||||
links:
|
||||
- "postgres:db"
|
||||
- "redis:redis"
|
||||
published_ports:
|
||||
- "127.0.0.1:{{ host_port }}:80"
|
||||
volumes:
|
||||
- "/var/lib/{{ host_directory }}/frontend:/frontend"
|
||||
|
||||
- name: Create barker worker container
|
||||
docker_container:
|
||||
name: "{{ host_directory }}-worker"
|
||||
image: barker-worker:latest
|
||||
state: started
|
||||
restart_policy: "unless-stopped"
|
||||
env_file: "/var/lib/{{ host_directory }}/.env"
|
||||
links:
|
||||
- "redis:redis"
|
||||
|
||||
|
||||
- name: Check if Nginx conf file exists
|
||||
stat: path="/etc/nginx/sites-available/{{ http_conf }}"
|
||||
register: status
|
||||
|
@ -10,8 +10,6 @@ class Settings(BaseSettings):
|
||||
MIDDLEWARE_SECRET_KEY: str = secrets.token_urlsafe(5)
|
||||
ALGORITHM: str = "HS256"
|
||||
JWT_TOKEN_EXPIRE_MINUTES: int = 30
|
||||
NEW_DAY_OFFSET_MINUTES: int = 7 * 60
|
||||
TIMEZONE_OFFSET_MINUTES: int = 330
|
||||
HOST: str = "0.0.0.0"
|
||||
PORT: int = 80
|
||||
DEBUG: bool = False
|
||||
|
@ -165,8 +165,13 @@ def show_list(db: Session = Depends(get_db), user: UserToken = Depends(get_user)
|
||||
|
||||
|
||||
@router.get("/list/{source_id}", response_model=List[schemas.Case])
|
||||
def show_list_of_source(source_id: uuid.UUID, db: Session = Depends(get_db), user: UserToken = Depends(get_user)) -> List[schemas.Case]:
|
||||
return [case_info(item) for item in db.query(Case).filter(Case.case_source_id == source_id).order_by(desc(Case.receipt_date)).all()]
|
||||
def show_list_of_source(
|
||||
source_id: uuid.UUID, db: Session = Depends(get_db), user: UserToken = Depends(get_user)
|
||||
) -> List[schemas.Case]:
|
||||
return [
|
||||
case_info(item)
|
||||
for item in db.query(Case).filter(Case.case_source_id == source_id).order_by(desc(Case.receipt_date)).all()
|
||||
]
|
||||
|
||||
|
||||
@router.get("/{id_}", response_model=schemas.Case)
|
||||
|
@ -16,7 +16,8 @@ const routes: Routes = [
|
||||
},
|
||||
{
|
||||
path: 'case-sources',
|
||||
loadChildren: () => import('./case-sources/case-sources.module').then((mod) => mod.CaseSourcesModule),
|
||||
loadChildren: () =>
|
||||
import('./case-sources/case-sources.module').then((mod) => mod.CaseSourcesModule),
|
||||
},
|
||||
{
|
||||
path: 'case-types',
|
||||
|
@ -91,7 +91,6 @@ export class AuthService {
|
||||
this.currentUserSubject.next(user);
|
||||
return user;
|
||||
}),
|
||||
tap((x) => console.log(x.perms)),
|
||||
);
|
||||
}
|
||||
|
||||
@ -119,7 +118,6 @@ export class AuthService {
|
||||
this.currentUserSubject.next(user);
|
||||
return user;
|
||||
}),
|
||||
tap((x) => console.log(x.perms)),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -14,12 +14,7 @@
|
||||
>
|
||||
<mat-form-field fxFlex>
|
||||
<mat-label>Name</mat-label>
|
||||
<input
|
||||
matInput
|
||||
#nameElement
|
||||
placeholder="Name"
|
||||
formControlName="name"
|
||||
/>
|
||||
<input matInput #nameElement placeholder="Name" formControlName="name" />
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div
|
||||
@ -31,11 +26,7 @@
|
||||
>
|
||||
<mat-form-field fxFlex>
|
||||
<mat-label>Prefix</mat-label>
|
||||
<input
|
||||
matInput
|
||||
placeholder="Prefix"
|
||||
formControlName="prefix"
|
||||
/>
|
||||
<input matInput placeholder="Prefix" formControlName="prefix" />
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</form>
|
||||
|
@ -22,7 +22,9 @@ export class CaseSourceService {
|
||||
const getUrl: string = id === null ? url : `${url}/${id}`;
|
||||
return this.http
|
||||
.get<CaseSource>(getUrl)
|
||||
.pipe(catchError(this.log.handleError(serviceName, `get id=${id}`))) as Observable<CaseSource>;
|
||||
.pipe(
|
||||
catchError(this.log.handleError(serviceName, `get id=${id}`)),
|
||||
) as Observable<CaseSource>;
|
||||
}
|
||||
|
||||
list(): Observable<CaseSource[]> {
|
||||
|
@ -13,16 +13,27 @@
|
||||
fxLayoutGap.lt-md="0px"
|
||||
>
|
||||
<mat-form-field fxFlex>
|
||||
<mat-label>Name</mat-label>
|
||||
<mat-label>Office File Number</mat-label>
|
||||
<input
|
||||
matInput
|
||||
#nameElement
|
||||
placeholder="Name"
|
||||
formControlName="name"
|
||||
(keyup.enter)="save()"
|
||||
placeholder="Office File Number"
|
||||
formControlName="officeFileNumber"
|
||||
/>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div
|
||||
fxLayout="row"
|
||||
fxLayoutAlign="space-around start"
|
||||
fxLayout.lt-md="column"
|
||||
fxLayoutGap="20px"
|
||||
fxLayoutGap.lt-md="0px"
|
||||
>
|
||||
<mat-form-field fxFlex>
|
||||
<mat-label>Title</mat-label>
|
||||
<input matInput placeholder="Title" formControlName="title" />
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div
|
||||
fxLayout="row"
|
||||
fxLayoutAlign="space-around start"
|
||||
|
@ -42,13 +42,35 @@ export class CaseDetailComponent implements OnInit, AfterViewInit {
|
||||
) {
|
||||
// Create form
|
||||
this.form = this.fb.group({
|
||||
name: '',
|
||||
mobile: '',
|
||||
landline: '',
|
||||
email: '',
|
||||
address: '',
|
||||
officeFileNumber: '',
|
||||
courtCaseNumber: '',
|
||||
year: '',
|
||||
title: '',
|
||||
docketNumber: '',
|
||||
receiptDate: '',
|
||||
limitationDate: '',
|
||||
filingDate: '',
|
||||
appearOnBehalfOf: '',
|
||||
questionOfLaw: '',
|
||||
aorName: '',
|
||||
opposingCouncilAor: '',
|
||||
opposingCouncilDetail: '',
|
||||
lowerCourtCaseNumber: '',
|
||||
dateOfImpugnedJudgement: '',
|
||||
briefDescription: '',
|
||||
remarks: '',
|
||||
slpCounter: '',
|
||||
contactDetail: '',
|
||||
caseConnectedWith: '',
|
||||
bunchCases: '',
|
||||
court: '',
|
||||
department: '',
|
||||
office: '',
|
||||
caseType: '',
|
||||
act: '',
|
||||
nature: '',
|
||||
officeStatus: '',
|
||||
courtStatus: '',
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -1,24 +1,21 @@
|
||||
import { DataSource } from '@angular/cdk/collections';
|
||||
import {merge, Observable, of as observableOf} from 'rxjs';
|
||||
import { EventEmitter } from '@angular/core';
|
||||
import { MatPaginator, PageEvent } from '@angular/material/paginator';
|
||||
import { merge, Observable, of as observableOf } from 'rxjs';
|
||||
import { map, tap } from 'rxjs/operators';
|
||||
|
||||
import { Case } from '../../core/case';
|
||||
import {MatPaginator, PageEvent} from "@angular/material/paginator";
|
||||
import {EventEmitter} from "@angular/core";
|
||||
import {map, tap} from "rxjs/operators";
|
||||
|
||||
export class CaseListDataSource extends DataSource<Case> {
|
||||
private dataValues: Case[] = [];
|
||||
private data: Observable<Case[]> = new Observable<Case[]>();
|
||||
constructor(public d: Observable<Case[]>, private paginator?: MatPaginator) {
|
||||
constructor(public d: Observable<Case[]>, private paginator?: MatPaginator) {
|
||||
super();
|
||||
this.data = d.pipe(tap(x=> this.dataValues = x));
|
||||
this.data = d.pipe(tap((x) => (this.dataValues = x)));
|
||||
}
|
||||
|
||||
connect(): Observable<Case[]> {
|
||||
const dataMutations: (
|
||||
| Observable<Case[]>
|
||||
| EventEmitter<PageEvent>
|
||||
)[] = [this.data];
|
||||
const dataMutations: (Observable<Case[]> | EventEmitter<PageEvent>)[] = [this.data];
|
||||
if (this.paginator) {
|
||||
dataMutations.push((this.paginator as MatPaginator).page);
|
||||
}
|
||||
@ -43,5 +40,4 @@ export class CaseListDataSource extends DataSource<Case> {
|
||||
const startIndex = this.paginator.pageIndex * this.paginator.pageSize;
|
||||
return data.slice(startIndex, startIndex + this.paginator.pageSize);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -7,7 +7,7 @@
|
||||
</a>
|
||||
</mat-card-title-group>
|
||||
<mat-card-content>
|
||||
<form [formGroup]="form" fxLayout="column">
|
||||
<form [formGroup]="form" fxLayout="column">
|
||||
<div
|
||||
fxLayout="row"
|
||||
fxLayout.lt-md="column"
|
||||
@ -24,7 +24,7 @@
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</form>
|
||||
</form>
|
||||
<mat-table #table [dataSource]="dataSource" aria-label="Elements">
|
||||
<!-- Office File Number Column -->
|
||||
<ng-container matColumnDef="officeFileNumber">
|
||||
|
@ -1,15 +1,15 @@
|
||||
import {Component, OnInit, ViewChild} from '@angular/core';
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
|
||||
import { MatPaginator } from '@angular/material/paginator';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { Observable, of as observableOf } from 'rxjs';
|
||||
import { distinctUntilChanged, startWith, switchMap, tap } from 'rxjs/operators';
|
||||
|
||||
import { Case } from '../../core/case';
|
||||
import { CaseSource } from '../../core/case-source';
|
||||
import { CaseService } from '../case.service';
|
||||
|
||||
import { CaseListDataSource } from './case-list-datasource';
|
||||
import {CaseSource} from "../../core/case-source";
|
||||
import {FormBuilder, FormControl, FormGroup} from "@angular/forms";
|
||||
import {distinctUntilChanged, startWith, switchMap, tap} from "rxjs/operators";
|
||||
import {CaseService} from "../case.service";
|
||||
import { Observable, of as observableOf } from 'rxjs';
|
||||
import {MatPaginator} from "@angular/material/paginator";
|
||||
|
||||
@Component({
|
||||
selector: 'app-case-list',
|
||||
@ -39,7 +39,7 @@ export class CaseListComponent implements OnInit {
|
||||
'lowerCourtCaseNumber',
|
||||
];
|
||||
|
||||
constructor(private route: ActivatedRoute, private fb: FormBuilder, private ser: CaseService) {
|
||||
constructor(private route: ActivatedRoute, private fb: FormBuilder, private ser: CaseService) {
|
||||
// Create form
|
||||
this.form = this.fb.group({
|
||||
caseSource: '',
|
||||
@ -56,9 +56,7 @@ export class CaseListComponent implements OnInit {
|
||||
startWith(''),
|
||||
distinctUntilChanged(),
|
||||
switchMap((x) => this.ser.list(x)),
|
||||
tap(x=>console.log(x))
|
||||
);
|
||||
|
||||
});
|
||||
this.dataSource = new CaseListDataSource(this.list, this.paginator);
|
||||
}
|
||||
|
@ -3,13 +3,13 @@ import { NgModule } from '@angular/core';
|
||||
import { RouterModule, Routes } from '@angular/router';
|
||||
|
||||
import { AuthGuard } from '../auth/auth-guard.service';
|
||||
import { CaseSourceListResolver } from '../case-sources/case-source-list-resolver.service';
|
||||
import { DepartmentListResolver } from '../departments/department-list-resolver.service';
|
||||
|
||||
import { CaseDetailComponent } from './case-detail/case-detail.component';
|
||||
import { CaseListResolver } from './case-list-resolver.service';
|
||||
import { CaseListComponent } from './case-list/case-list.component';
|
||||
import { CaseResolver } from './case-resolver.service';
|
||||
import {CaseSourceListResolver} from "../case-sources/case-source-list-resolver.service";
|
||||
|
||||
const advocatesRoutes: Routes = [
|
||||
{
|
||||
|
@ -7,6 +7,7 @@ import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatCardModule } from '@angular/material/card';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { MatInputModule } from '@angular/material/input';
|
||||
import { MatPaginatorModule } from '@angular/material/paginator';
|
||||
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
||||
import { MatSelectModule } from '@angular/material/select';
|
||||
import { MatTableModule } from '@angular/material/table';
|
||||
@ -14,24 +15,23 @@ import { MatTableModule } from '@angular/material/table';
|
||||
import { CaseDetailComponent } from './case-detail/case-detail.component';
|
||||
import { CaseListComponent } from './case-list/case-list.component';
|
||||
import { CasesRoutingModule } from './cases-routing.module';
|
||||
import {MatPaginatorModule} from "@angular/material/paginator";
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
CdkTableModule,
|
||||
FlexLayoutModule,
|
||||
MatButtonModule,
|
||||
MatCardModule,
|
||||
MatIconModule,
|
||||
MatInputModule,
|
||||
MatProgressSpinnerModule,
|
||||
MatTableModule,
|
||||
ReactiveFormsModule,
|
||||
CasesRoutingModule,
|
||||
MatSelectModule,
|
||||
MatPaginatorModule,
|
||||
],
|
||||
imports: [
|
||||
CommonModule,
|
||||
CdkTableModule,
|
||||
FlexLayoutModule,
|
||||
MatButtonModule,
|
||||
MatCardModule,
|
||||
MatIconModule,
|
||||
MatInputModule,
|
||||
MatProgressSpinnerModule,
|
||||
MatTableModule,
|
||||
ReactiveFormsModule,
|
||||
CasesRoutingModule,
|
||||
MatSelectModule,
|
||||
MatPaginatorModule,
|
||||
],
|
||||
declarations: [CaseListComponent, CaseDetailComponent],
|
||||
})
|
||||
export class CasesModule {}
|
||||
|
Loading…
Reference in New Issue
Block a user