Docker support

This commit is contained in:
simon987 2019-02-20 17:34:23 -05:00
parent 49ccf60c2e
commit 3bad57523a
4 changed files with 119 additions and 0 deletions

16
Dockerfile Normal file
View File

@ -0,0 +1,16 @@
# Build
FROM golang:latest as go_build
WORKDIR /go/src/github.com/simon987/task_tracker/
COPY . .
RUN go get ./main/ && GOOS=linux CGO_ENABLED=0 go build -a -installsuffix cgo -o tt_api ./main/
# Execute in alpine
FROM alpine:latest
WORKDIR /root
COPY --from=go_build ["/go/src/github.com/simon987/task_tracker/tt_api",\
"/go/src/github.com/simon987/task_tracker/schema.sql",\
"/go/src/github.com/simon987/task_tracker/config.yml",\
"./"]
CMD ["./tt_api"]

View File

@ -0,0 +1,12 @@
h3 {
border-bottom: 1px solid rgba(0,0,0,.12);
font-weight: 300;
font-size: 24px;
line-height: 32px;
margin: 40px 0 20px;
padding-bottom: 3px;
}
pre {
color: #ff4081;
}

View File

@ -0,0 +1,74 @@
<div class="container">
<mat-card>
<mat-card-header>
<mat-card-title>task_tracker</mat-card-title>
<mat-card-subtitle>"simple tracker that aims to blah blah"</mat-card-subtitle>
</mat-card-header>
<mat-card-content>
<h3>Get started</h3>
<mat-vertical-stepper>
<mat-step [label]="'Create a project'">
<p>Create a project and associate it to a git repository.
Payload URL for webhooks is is: </p>
<pre>{{apiService.url}}/receivewebhook</pre>
<p>Workers will be made aware of version changes on the master branch
when they assign themselves to new tasks:</p>
<pre>{{
'GET /task/get\n\n{\n' +
' "id": 24,\n' +
' "priority": 1,\n' +
' ...\n' +
' "project": {\n' +
' "id": 1,\n' +
' ...\n' +
' "version": "<' + ('index.version'|translate) +
'>",\n }\n}'}}
</pre>
</mat-step>
<mat-step [label]="'Setup worker(s)'">
<p>Register a worker</p>
<pre>{{
'POST /worker/create\n{\n' +
' "alias": "' + ('index.alias'|translate) +
'"\n}\n\n'}}</pre>
<p>Tracker response:</p>
<pre>{{
'{\n' +
' "ok": true,\n' +
' "content": {\n' +
' "worker": {\n' +
' "id": 45,\n' +
' "created": 1550442984,\n' +
' "alias": "' + ('index.alias'|translate) +
'",\n "secret": "PvFRQZK7CpSP+4fc0iczfn++PbWh7qMLVfO1+Y3d6X4="\n' +
' }\n' +
' }\n' +
'}'}}</pre>
<p>
Workers need to request access to private or hidden projects to submit new tasks.
Public projects do not require any additional configuration.</p>
<pre>{{
'POST /project/request_access\n{\n' +
' "assign": true,\n' +
' "submit": true,\n' +
' "project": 23\n}'
}}</pre>
</mat-step>
<mat-step [label]="'Setup permissions'">
<p>You will be given READ, EDIT and MANAGE_ACCESS roles from projects you create.
You can also give access to other project managers from the project permissions page</p>
</mat-step>
<ng-template matStepperIcon="edit" let-index="index">
{{index + 1}}
</ng-template>
</mat-vertical-stepper>
</mat-card-content>
</mat-card>
</div>

View File

@ -0,0 +1,17 @@
import {Component, OnInit} from '@angular/core';
import {ApiService} from "../api.service";
@Component({
selector: 'app-index',
templateUrl: './index.component.html',
styleUrls: ['./index.component.css']
})
export class IndexComponent implements OnInit {
constructor(public apiService: ApiService) {
}
ngOnInit() {
}
}