compose upgrade

This commit is contained in:
ycc 2023-10-18 11:01:41 +02:00
parent 88c21d1828
commit 153e576827
8 changed files with 40 additions and 17 deletions

View File

@ -12,7 +12,11 @@ EXPOSE 49618
WORKDIR /go/src/oc-catalog
#######################################################
RUN go get github.com/beego/bee/v2
COPY go.mod .
COPY go.sum .
RUN go get github.com/beego/bee/v2 && go install github.com/beego/bee/v2@master
# Manually download swagger during build
RUN ["/bin/bash", "-c", \
@ -21,8 +25,6 @@ RUN ["/bin/bash", "-c", \
curl -sL https://github.com/beego/swagger/archive/v3.tar.gz | tar xvvvz --overwrite -C swagger --strip-components=1"]
COPY go.mod .
COPY go.sum .
RUN go mod download -x
# COPY . .

View File

@ -1,7 +1,17 @@
# OC Catalog
OpenCloud Catalog API
## OpenCloud Catalog API
Uses the Beego framework
To install the Beego bee command :
go install github.com/beego/bee/v2@master
To build and run :
go mod tidy
bee run -downdoc=true -gendoc=true
## Full deploy
@ -11,6 +21,8 @@ Deploy with docker:
and populate DB (or other scripts) with:
`docker exec -it oc-catalog_oc-catalog_1 ./scripts/populate_models.sh ./scripts/demo.json`
or out of docker `./scripts/populate_models.sh ./scripts/demo.json`
## Dev
Start DB with `docker-compose up -d` and run the API with `bee run -downdoc=true -gendoc=true`

View File

@ -94,7 +94,7 @@ func (u *ScheduleController) CheckSchedule(cron string, duration uint, startDate
// @Param startDate query time.Time true "Start date"
// @Param stopDate query time.Time true "End date"
// @Success 200 {object} []models.ScheduleDB
// @Success 201 Too much elements within the range of dates
// @Success 201 Too many elements within the range of dates
// @Failure 403 Authentication issue
// @Failure 400 Other error. Check the output
// // @Security jwtAPIToken

View File

@ -27,22 +27,30 @@ type RepositoryModel struct {
}
type ComputingNEWModel struct {
Description string `json:"description" required:"true"`
Description string `json:"description,omitempty" required:"true"`
Name string `json:"name,omitempty" required:"true" validate:"required" description:"Name of the computing"`
ShortDescription string `json:"short_description" required:"true" validate:"required"`
Logo string `json:"logo" required:"true" validate:"required"`
ShortDescription string `json:"short_description,omitempty" required:"true" validate:"required"`
Logo string `json:"logo,omitempty" required:"true" validate:"required"`
Type string `json:"type,omitempty" required:"true"`
Owner string `json:"owner"`
License string `json:"license"`
Price uint `json:"price"`
Owner string `json:"owner,omitempty"`
License string `json:"license,omitempty"`
Price uint `json:"price,omitempty"`
ExecutionRequirements ExecutionRequirementsModel `json:"execution_requirements"`
ExecutionRequirements ExecutionRequirementsModel `json:"execution_requirements,omitempty"`
Dinputs []string
Doutputs []string
Dinputs []string `json:"dinputs,omitempty"`
Doutputs []string `json:"doutputs,omitempty"`
Repository RepositoryModel `json:"repository"`
Image string `json:"image,omitempty"`
Command string `json:"command,omitempty"`
Arguments []string `json:"arguments,omitempty"`
Environment []string `json:"environment,omitempty"`
Ports []string `json:"ports,omitempty"`
CustomDeployment string `json:"custom_deployment,omitempty"`
Repository RepositoryModel `json:"repository,omitempty"`
}
type ComputingModel struct {

View File

@ -506,7 +506,8 @@ func ParseMxGraph(username, workflowName, xmlData string) (err error, mxissues [
}
if currentWorkflow.Schedules.IsBooked {
return errors.New("Can't modify a booked workflow"), nil
//well, let's allow that
//return errors.New("Can't modify a booked workflow"), nil
}
var xmlModel MxGraphModel

Binary file not shown.

View File

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/usr/bin/bash
# Must specify a JSON with a following structure: