mirror of
https://github.com/valitydev/swag-anapi-v2.git
synced 2024-11-06 01:05:17 +00:00
Build impl + renovate + actualization
This commit is contained in:
parent
0eed1aed6a
commit
b682b091a9
30
.github/workflows/build.yaml
vendored
Normal file
30
.github/workflows/build.yaml
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
name: build
|
||||
on:
|
||||
- pull_request
|
||||
|
||||
env:
|
||||
NODEJS_VERSION: '16'
|
||||
|
||||
jobs:
|
||||
bundle:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
- name: Setup Maven
|
||||
uses: actions/setup-java@v2
|
||||
with:
|
||||
java-version: '15'
|
||||
distribution: 'adopt'
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: ${{ env.NODEJS_VERSION }}
|
||||
cache: npm
|
||||
- run: npm install
|
||||
- name: Bundle specification
|
||||
run: npm run build
|
||||
- name: Validate specification
|
||||
run: npm run test
|
||||
- name: Build server jar
|
||||
run: mvn --batch-mode clean package -f pom.xml -P="server"
|
16
.github/workflows/deploy-jar.yaml
vendored
Normal file
16
.github/workflows/deploy-jar.yaml
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
name: Maven Deploy Artifact
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
- 'main'
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
uses: valitydev/base-workflow/.github/workflows/maven-library-deploy.yml@v1.0.1
|
||||
secrets:
|
||||
server-username: ${{ secrets.OSSRH_USERNAME }}
|
||||
server-password: ${{ secrets.OSSRH_TOKEN }}
|
||||
deploy-secret-key: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
|
||||
deploy-secret-key-password: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
|
28
.github/workflows/gh-pages.yaml
vendored
Normal file
28
.github/workflows/gh-pages.yaml
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
name: gh-pages
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
|
||||
env:
|
||||
NODEJS_VERSION: '16'
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: ${{ env.NODEJS_VERSION }}
|
||||
cache: npm
|
||||
- run: npm install
|
||||
- name: Bundle specification
|
||||
run: npm run build
|
||||
- name: Publish ReDoc on Github Pages
|
||||
uses: peaceiris/actions-gh-pages@v3
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
publish_dir: ./dist
|
||||
exclude_assets: 'swagger-ui'
|
4
.gitmodules
vendored
4
.gitmodules
vendored
@ -1,4 +0,0 @@
|
||||
[submodule "build_utils"]
|
||||
path = build_utils
|
||||
url = git@github.com:rbkmoney/build_utils.git
|
||||
branch = master
|
61
Jenkinsfile
vendored
61
Jenkinsfile
vendored
@ -1,61 +0,0 @@
|
||||
#!groovy
|
||||
// -*- mode: groovy -*-
|
||||
|
||||
build('swag-anapi-v2', 'docker-host') {
|
||||
checkoutRepo()
|
||||
loadBuildUtils('build_utils')
|
||||
|
||||
def pipeDefault
|
||||
def withWsCache
|
||||
def gitUtils
|
||||
runStage('load pipeline') {
|
||||
env.JENKINS_LIB = "build_utils/jenkins_lib"
|
||||
pipeDefault = load("${env.JENKINS_LIB}/pipeDefault.groovy")
|
||||
withWsCache = load("${env.JENKINS_LIB}/withWsCache.groovy")
|
||||
gitUtils = load("${env.JENKINS_LIB}/gitUtils.groovy")
|
||||
}
|
||||
|
||||
pipeDefault() {
|
||||
|
||||
runStage('install-deps') {
|
||||
withWsCache("node_modules") {
|
||||
sh 'make wc_install'
|
||||
}
|
||||
}
|
||||
|
||||
runStage('validate-spec') {
|
||||
sh 'make wc_validate'
|
||||
}
|
||||
|
||||
runStage('bundle') {
|
||||
sh 'make wc_build'
|
||||
}
|
||||
|
||||
// Java
|
||||
runStage('build java client & server') {
|
||||
env.JAVA_HOME = sh(returnStdout: true, script: 'java-config --select-vm openjdk-bin-11 --jdk-home').trim()
|
||||
withMaven() {
|
||||
if (env.BRANCH_NAME == 'master' || env.BRANCH_NAME.startsWith('epic/')) {
|
||||
withGPG() {
|
||||
sh 'make SETTINGS_XML=${SETTINGS_XML} BRANCH_NAME=${BRANCH_NAME} REPO_PUBLIC=${REPO_PUBLIC} GPG_PASSPHRASE=${GPG_PASSPHRASE} GPG_KEYID=${GPG_KEYID} java.openapi.deploy_client'
|
||||
sh 'make SETTINGS_XML=${SETTINGS_XML} BRANCH_NAME=${BRANCH_NAME} REPO_PUBLIC=${REPO_PUBLIC} GPG_PASSPHRASE=${GPG_PASSPHRASE} GPG_KEYID=${GPG_KEYID} java.openapi.deploy_server'
|
||||
}
|
||||
} else {
|
||||
sh 'make SETTINGS_XML=${SETTINGS_XML} BRANCH_NAME=${BRANCH_NAME} java.openapi.compile_client'
|
||||
sh 'make SETTINGS_XML=${SETTINGS_XML} BRANCH_NAME=${BRANCH_NAME} java.openapi.compile_server'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Release
|
||||
if (env.BRANCH_NAME == 'master' || env.BRANCH_NAME.startsWith('epic/')) {
|
||||
runStage('publish release bundle') {
|
||||
dir("web_deploy") {
|
||||
gitUtils.push(commitMsg: "Generated from commit: $COMMIT_ID \n\non $BRANCH_NAME in $RBK_REPO_URL\n\nChanges:\n$COMMIT_MSG",
|
||||
files: "*", branch: "release/$BRANCH_NAME", orphan: true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
98
Makefile
98
Makefile
@ -1,98 +0,0 @@
|
||||
UTILS_PATH := build_utils
|
||||
TEMPLATES_PATH := .
|
||||
|
||||
SERVICE_NAME := swag-anapi-v2
|
||||
BUILD_IMAGE_TAG := 917afcdd0c0a07bf4155d597bbba72e962e1a34a
|
||||
|
||||
CALL_ANYWHERE := all install validate build java.compile java.deploy
|
||||
CALL_W_CONTAINER := $(CALL_ANYWHERE)
|
||||
|
||||
all: validate
|
||||
|
||||
-include $(UTILS_PATH)/make_lib/utils_container.mk
|
||||
|
||||
.PHONY: $(CALL_W_CONTAINER)
|
||||
|
||||
install:
|
||||
npm install
|
||||
|
||||
validate:
|
||||
npm run validate
|
||||
|
||||
build:
|
||||
npm run build
|
||||
|
||||
# Java
|
||||
|
||||
ifdef SETTINGS_XML
|
||||
DOCKER_RUN_OPTS = -v $(SETTINGS_XML):$(SETTINGS_XML)
|
||||
DOCKER_RUN_OPTS += -e SETTINGS_XML=$(SETTINGS_XML)
|
||||
endif
|
||||
|
||||
ifdef LOCAL_BUILD
|
||||
DOCKER_RUN_OPTS += -v $$HOME/.m2:/home/$(UNAME)/.m2:rw
|
||||
endif
|
||||
|
||||
COMMIT_HASH := $(shell git --no-pager log -1 --pretty=format:"%h")
|
||||
NUMBER_COMMITS := $(shell git rev-list --count HEAD)
|
||||
|
||||
JAVA_PKG_VERSION := 1.$(NUMBER_COMMITS)-$(COMMIT_HASH)
|
||||
|
||||
ifdef BRANCH_NAME
|
||||
ifeq "$(findstring epic,$(BRANCH_NAME))" "epic"
|
||||
JAVA_PKG_VERSION := $(JAVA_PKG_VERSION)-epic
|
||||
endif
|
||||
endif
|
||||
|
||||
REPO_PROFILE := private
|
||||
|
||||
ifdef REPO_PUBLIC
|
||||
ifeq ($(REPO_PUBLIC), true)
|
||||
REPO_PROFILE := public
|
||||
endif
|
||||
endif
|
||||
|
||||
MVN = mvn -s $(SETTINGS_XML) -Dcommit.number="$(NUMBER_COMMITS)"
|
||||
|
||||
java.openapi.compile_client: java.settings
|
||||
$(MVN) clean && \
|
||||
$(MVN) compile -P="client" -P="$(REPO_PROFILE)"
|
||||
|
||||
java.openapi.deploy_client: java.settings
|
||||
$(MVN) clean && \
|
||||
$(MVN) versions:set versions:commit -DnewVersion="$(JAVA_PKG_VERSION)-client" && \
|
||||
$(MVN) deploy --batch-mode -Dgpg.keyname="$(GPG_KEYID)" -Dgpg.passphrase="$(GPG_PASSPHRASE)" -P="client" -P="$(REPO_PROFILE)"
|
||||
|
||||
java.openapi.install_client: java.settings
|
||||
$(MVN) clean && \
|
||||
$(MVN) versions:set versions:commit -DnewVersion="$(JAVA_PKG_VERSION)-client" && \
|
||||
$(MVN) install -P="client" -P="$(REPO_PROFILE)"
|
||||
|
||||
java.openapi.compile_server: java.settings
|
||||
$(MVN) clean && \
|
||||
$(MVN) compile -P="server" -P="$(REPO_PROFILE)"
|
||||
|
||||
java.openapi.deploy_server: java.settings
|
||||
$(MVN) clean && \
|
||||
$(MVN) versions:set versions:commit -DnewVersion="$(JAVA_PKG_VERSION)-server" && \
|
||||
$(MVN) deploy --batch-mode -Dgpg.keyname="$(GPG_KEYID)" -Dgpg.passphrase="$(GPG_PASSPHRASE)" -P="server" -P="$(REPO_PROFILE)"
|
||||
|
||||
java.openapi.install_server: java.settings
|
||||
$(MVN) clean && \
|
||||
$(MVN) versions:set versions:commit -DnewVersion="$(JAVA_PKG_VERSION)-server" && \
|
||||
$(MVN) install -P="server" -P="$(REPO_PROFILE)"
|
||||
|
||||
java.compile: java.settings
|
||||
$(MVN) compile
|
||||
|
||||
java.deploy: java.settings
|
||||
$(MVN) versions:set versions:commit -DnewVersion="$(JAVA_PKG_VERSION)" && \
|
||||
$(MVN) deploy
|
||||
|
||||
java.install: java.settings
|
||||
$(MVN) clean && \
|
||||
$(MVN) versions:set versions:commit -DnewVersion="$(JAVA_PKG_VERSION)" && \
|
||||
$(MVN) install
|
||||
|
||||
java.settings:
|
||||
$(if $(SETTINGS_XML),, echo "SETTINGS_XML not defined"; exit 1)
|
@ -1,4 +1,4 @@
|
||||
# RBKmoney Analytics API Specification (OpenAPI 3.0)
|
||||
# Vality Analytics API Specification (OpenAPI 3.0)
|
||||
|
||||
## Working on specification
|
||||
### Install
|
||||
@ -10,7 +10,7 @@
|
||||
### Usage
|
||||
|
||||
1. Run `npm start`
|
||||
2. Checkout console output to see where local server is started. You can use all [links](#links) (except `preview`) by replacing https://git@github.com:antonlva.github.io/rbkmoney-api-docs.git/ with url from the message: `Server started <url>`
|
||||
2. Checkout console output to see where local server is started. You can use all [links](#links) (except `preview`) by replacing https://github.com/valitydev/docs.git with url from the message: `Server started <url>`
|
||||
3. Make changes using your favorite editor or `swagger-editor` (look for URL in console output)
|
||||
4. All changes are immediately propagated to your local server, moreover all documentation pages will be automagically refreshed in a browser after each change
|
||||
**TIP:** you can open `swagger-editor`, documentation and `swagger-ui` in parallel
|
||||
|
@ -1 +0,0 @@
|
||||
Subproject commit be44d69fc87b22a0bb82d98d6eae7658d1647f98
|
@ -10,7 +10,7 @@ description: >
|
||||
```
|
||||
|
||||
Посмотреть ваш API-ключ вы можете в [личном
|
||||
кабинете](https://dashboard.rbk.money/).
|
||||
кабинете](https://dashboard.vality/).
|
||||
|
||||
|
||||
Помните, что вы никому не должны передавать ваш API ключ!
|
||||
|
@ -1,12 +1,12 @@
|
||||
openapi: 3.0.0
|
||||
info:
|
||||
version: 2.0.0
|
||||
title: RBKmoney Platform Analytics API
|
||||
title: Vality Platform Analytics API
|
||||
description: |
|
||||
## Описание
|
||||
RBKmoney Analytics API является точкой взаимодействия с аналитической и поисковой частью платформы. Все аналитическоие запросы осуществляются с помощью вызовов соответствующих методов API. Любые сторонние приложения, включая наши веб-сайты, личные кабинеты и другие UI-интерфейсы являются внешними приложениями-клиентами.
|
||||
Vality Analytics API является точкой взаимодействия с аналитической и поисковой частью платформы. Все аналитическоие запросы осуществляются с помощью вызовов соответствующих методов API. Любые сторонние приложения, включая наши веб-сайты, личные кабинеты и другие UI-интерфейсы являются внешними приложениями-клиентами.
|
||||
|
||||
RBKmoney Analytics API работает поверх HTTP-протокола. Мы используем REST архитектуру, схема описывается в соответствии со стандартом [OpenAPI v3.0](https://spec.openapis.org/oas/v3.0.0/). Коды возврата описываются соответствующими HTTP-статусами. Платформа принимает и возвращает JSON-структуры в HTTP body.
|
||||
Vality Analytics API работает поверх HTTP-протокола. Мы используем REST архитектуру, схема описывается в соответствии со стандартом [OpenAPI v3.0](https://spec.openapis.org/oas/v3.0.0/). Коды возврата описываются соответствующими HTTP-статусами. Платформа принимает и возвращает JSON-структуры в HTTP body.
|
||||
|
||||
## Запросы
|
||||
Любой вызов методов API обязан предваряться предоставлением уникального для участника в пределах платформы ID запроса. Данный ID передается в соответствующем заголовке HTTP-запроса:
|
||||
@ -88,16 +88,16 @@ info:
|
||||
[5xx]: https://tools.ietf.org/html/rfc7231#section-6.6
|
||||
|
||||
Если вы получили ошибку, которой нет в данном описании, обратитесь в техническую поддержку.
|
||||
termsOfService: https://rbk.money/
|
||||
termsOfService: https://vality.dev/
|
||||
contact:
|
||||
name: RBKmoney support team
|
||||
email: support@rbk.money
|
||||
url: https://api.rbk.money/lk/v2
|
||||
name: Vality support team
|
||||
email: support@vality.dev
|
||||
url: https://vality.dev/lk/v2
|
||||
license:
|
||||
name: Apache 2.0
|
||||
url: https://www.apache.org/licenses/LICENSE-2.0.html
|
||||
servers:
|
||||
- url: 'https://api.rbk.money/lk/v2'
|
||||
- url: 'https://api.vality.dev/lk/v2'
|
||||
security:
|
||||
- bearer: [ ]
|
||||
tags:
|
||||
|
@ -1,11 +1,11 @@
|
||||
{
|
||||
"name": "swag-anapi-v2",
|
||||
"version": "0.1.0",
|
||||
"version": "1.0.0",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@redocly/openapi-cli": "^1.0.0-beta.61",
|
||||
"json-merge-patch": "^1.0.0",
|
||||
"redoc-cli": "^0.12.1"
|
||||
"@redocly/openapi-cli": "^1.0.0-beta.79",
|
||||
"json-merge-patch": "^1.0.2",
|
||||
"redoc-cli": "^0.13.2"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "openapi preview-docs",
|
||||
|
20
pom.xml
20
pom.xml
@ -5,9 +5,9 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>com.rbkmoney</groupId>
|
||||
<groupId>dev.vality</groupId>
|
||||
<artifactId>library-parent-pom</artifactId>
|
||||
<version>1.0.8</version>
|
||||
<version>1.0.2</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>swag-anapi-v2</artifactId>
|
||||
@ -19,21 +19,21 @@
|
||||
</description>
|
||||
|
||||
<properties>
|
||||
<default.package>com.rbkmoney.anapi.v2</default.package>
|
||||
<default.package>dev.vality.anapi.v2</default.package>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<maven-plugin-version>1.0.0</maven-plugin-version>
|
||||
<java.version>11</java.version>
|
||||
<maven.compiler.source>${java.version}</maven.compiler.source>
|
||||
<maven.compiler.target>${java.version}</maven.compiler.target>
|
||||
<slf4j-version>1.7.21</slf4j-version>
|
||||
<slf4j-version>1.7.33</slf4j-version>
|
||||
<junit-version>4.13.2</junit-version>
|
||||
<servlet-api-version>2.5</servlet-api-version>
|
||||
<jackson-version>2.12.5</jackson-version>
|
||||
<spring-version>2.5.3</spring-version>
|
||||
<springfox-version>2.9.2</springfox-version>
|
||||
<jackson-version>2.13.1</jackson-version>
|
||||
<spring-version>2.6.1</spring-version>
|
||||
<springfox-version>3.0.0</springfox-version>
|
||||
<javax-annotation-api-version>1.3.2</javax-annotation-api-version>
|
||||
<jaxb-version>2.3.1</jaxb-version>
|
||||
<openapi-generator-version>5.2.1</openapi-generator-version>
|
||||
<openapi-generator-version>5.3.1</openapi-generator-version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
@ -86,7 +86,7 @@
|
||||
<dependency>
|
||||
<groupId>io.swagger</groupId>
|
||||
<artifactId>swagger-annotations</artifactId>
|
||||
<version>1.6.2</version>
|
||||
<version>1.6.4</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
@ -129,7 +129,7 @@
|
||||
<dependency>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>jackson-databind-nullable</artifactId>
|
||||
<version>0.2.1</version>
|
||||
<version>0.2.2</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
|
18
renovate.json
Normal file
18
renovate.json
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"extends": [
|
||||
"config:base"
|
||||
],
|
||||
"packageRules": [
|
||||
{
|
||||
"matchPackagePatterns": [
|
||||
"*"
|
||||
],
|
||||
"matchUpdateTypes": [
|
||||
"minor",
|
||||
"patch"
|
||||
],
|
||||
"groupName": "all non-major dependencies",
|
||||
"groupSlug": "all-minor-patch"
|
||||
}
|
||||
]
|
||||
}
|
@ -2,7 +2,7 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>RBKmoney Anapi v2 API</title>
|
||||
<title>Vality Anapi v2 API</title>
|
||||
<!-- needed for adaptive design -->
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="icon" type="image/png" href="favicon.png">
|
||||
|
Loading…
Reference in New Issue
Block a user