Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cf-online-api
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KS Pardubický kraj
cf-online-api
Commits
fd3ca3ab
Verified
Commit
fd3ca3ab
authored
3 years ago
by
Andrej Ramašeuski
Browse files
Options
Downloads
Patches
Plain Diff
Swagger spec renderer, image version from spec
parent
5a087391
No related branches found
No related tags found
No related merge requests found
Pipeline
#6886
failed
3 years ago
Stage: build
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitlab-ci.yml
+4
-3
4 additions, 3 deletions
.gitlab-ci.yml
Dockerfile
+2
-1
2 additions, 1 deletion
Dockerfile
lib/CF.pm
+7
-1
7 additions, 1 deletion
lib/CF.pm
openapi.yaml
+1
-1
1 addition, 1 deletion
openapi.yaml
with
14 additions
and
6 deletions
.gitlab-ci.yml
+
4
−
3
View file @
fd3ca3ab
...
@@ -2,18 +2,19 @@ image: docker:20.10.9
...
@@ -2,18 +2,19 @@ image: docker:20.10.9
variables
:
variables
:
DOCKER_TLS_CERTDIR
:
"
/certs"
DOCKER_TLS_CERTDIR
:
"
/certs"
IMAGE_VER
:
2.6.0
services
:
services
:
-
docker:20.10.9-dind
-
docker:20.10.9-dind
before_script
:
before_script
:
-
apk add --no-cache yq
-
docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
-
docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
build
:
build
:
stage
:
build
stage
:
build
script
:
script
:
-
VERSION=`yq '.info.version' openapi.yaml`
-
docker pull $CI_REGISTRY_IMAGE:latest ||
true
-
docker pull $CI_REGISTRY_IMAGE:latest ||
true
-
docker build --cache-from $CI_REGISTRY_IMAGE:latest --tag $CI_REGISTRY_IMAGE:$
IMAGE_VER
--tag $CI_REGISTRY_IMAGE:latest .
-
docker build --cache-from $CI_REGISTRY_IMAGE:latest --tag $CI_REGISTRY_IMAGE:$
VERSION
--tag $CI_REGISTRY_IMAGE:latest .
-
docker push $CI_REGISTRY_IMAGE:$
IMAGE_VER
-
docker push $CI_REGISTRY_IMAGE:$
VERSION
-
docker push $CI_REGISTRY_IMAGE:latest
-
docker push $CI_REGISTRY_IMAGE:latest
This diff is collapsed.
Click to expand it.
Dockerfile
+
2
−
1
View file @
fd3ca3ab
...
@@ -21,7 +21,8 @@ RUN cpanm \
...
@@ -21,7 +21,8 @@ RUN cpanm \
Mojo::Pg
\
Mojo::Pg
\
Mojo::Redis
\
Mojo::Redis
\
Mojo::JWT
\
Mojo::JWT
\
Mojolicious::Plugin::OpenAPI
Mojolicious::Plugin::OpenAPI
\
Mojolicious::Plugin::SwaggerUI
ADD
. /opt/cf
ADD
. /opt/cf
WORKDIR
/opt/cf
WORKDIR
/opt/cf
...
...
This diff is collapsed.
Click to expand it.
lib/CF.pm
+
7
−
1
View file @
fd3ca3ab
...
@@ -102,13 +102,19 @@ sub startup {
...
@@ -102,13 +102,19 @@ sub startup {
}
}
});
});
$self
->
plugin
(
SwaggerUI
=>
{
url
=>
"
/api
",
title
=>
"
CF Online
",
});
$self
->
defaults
(
$self
->
defaults
(
openapi_cors_allowed_origins
=>
['
*
']
openapi_cors_allowed_origins
=>
['
*
']
);
);
# Router
# Router
my
$r
=
$self
->
routes
;
my
$r
=
$self
->
routes
;
$r
->
get
('
/
')
->
to
(
cb
=>
sub
{
shift
->
redirect_to
('
/
api.html
');});
$r
->
get
('
/
')
->
to
(
cb
=>
sub
{
shift
->
redirect_to
('
/
swagger-ui
');});
$r
->
websocket
('
/ws
')
->
to
('
Websockets#main
');
$r
->
websocket
('
/ws
')
->
to
('
Websockets#main
');
}
}
...
...
This diff is collapsed.
Click to expand it.
openapi.yaml
+
1
−
1
View file @
fd3ca3ab
openapi
:
3.0.3
openapi
:
3.0.3
info
:
info
:
version
:
"
2.
0
"
version
:
"
2.
6.1
"
title
:
CF Online
title
:
CF Online
description
:
CF Online
description
:
CF Online
license
:
license
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment