mirror of
https://github.com/valitydev/limiter-proto.git
synced 2024-11-06 00:35:18 +00:00
migrate on dev.vality domain and GitHub Action CI
This commit is contained in:
parent
c29d2435c2
commit
69af2f73ab
29
.github/workflows/build.yml
vendored
Normal file
29
.github/workflows/build.yml
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
name: Build Artifact
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- '*'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Install thrift
|
||||
uses: valitydev/action-setup-thrift@v0.0.1
|
||||
- name: Checkout Repo
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Set up Maven
|
||||
uses: actions/setup-java@v2
|
||||
with:
|
||||
java-version: '15'
|
||||
distribution: 'adopt'
|
||||
- name: Retrieve commit info
|
||||
run: |
|
||||
echo "::set-output name=COMMIT_NUMBER::$(git rev-list HEAD --count)"
|
||||
echo "::set-output name=SHA_7::${GITHUB_SHA::7}"
|
||||
id: commit_info
|
||||
- name: Build package
|
||||
run: mvn --batch-mode -Dcommit.number=${{ steps.commit_info.outputs.COMMIT_NUMBER }} -Drevision="1.${{ steps.commit_info.outputs.COMMIT_NUMBER }}-${{ steps.commit_info.outputs.SHA_7 }}" clean compile -f pom.xml
|
31
.github/workflows/deploy.yml
vendored
Normal file
31
.github/workflows/deploy.yml
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
name: Deploy Artifact
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
- 'main'
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Install thrift
|
||||
uses: valitydev/action-setup-thrift@v0.0.1
|
||||
- name: Checkout Repo
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Retrieve commit info
|
||||
run: |
|
||||
echo "::set-output name=COMMIT_NUMBER::$(git rev-list HEAD --count)"
|
||||
echo "::set-output name=SHA_7::${GITHUB_SHA::7}"
|
||||
id: commit_info
|
||||
- name: Deploy package
|
||||
uses: valitydev/action-deploy-jdk-package@v1.0.12
|
||||
with:
|
||||
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 }}
|
||||
maven-args: '-Dcommit.number=${{ steps.commit_info.outputs.COMMIT_NUMBER }} -Drevision="1.${{ steps.commit_info.outputs.COMMIT_NUMBER }}-${{ steps.commit_info.outputs.SHA_7 }}"'
|
37
.github/workflows/erlang-pr.yml
vendored
Normal file
37
.github/workflows/erlang-pr.yml
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
name: Erlang
|
||||
on:
|
||||
pull_request:
|
||||
branches: [ '*' ]
|
||||
push:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build and verify
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- uses: valitydev/action-setup-thrift@b457b89c7e1e960ea354f510bce69a725d16c556
|
||||
with:
|
||||
thrift-version: '0.14.2'
|
||||
|
||||
- uses: erlef/setup-beam@v1.9
|
||||
id: beam
|
||||
with:
|
||||
otp-version: '24'
|
||||
rebar3-version: '3.18'
|
||||
|
||||
- name: Restore PLT cache
|
||||
uses: actions/cache@v2
|
||||
id: plt-cache
|
||||
with:
|
||||
key: |
|
||||
${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-plt
|
||||
path: |
|
||||
_build/default/rebar3_*_plt
|
||||
|
||||
- run: rebar3 compile
|
||||
- run: rebar3 xref
|
||||
- run: rebar3 dialyzer
|
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
|
24
Jenkinsfile
vendored
24
Jenkinsfile
vendored
@ -1,24 +0,0 @@
|
||||
#!groovy
|
||||
// -*- mode: groovy -*-
|
||||
|
||||
build('limiter-proto', 'docker-host') {
|
||||
checkoutRepo()
|
||||
loadBuildUtils()
|
||||
|
||||
def pipeDefault
|
||||
def gitUtils
|
||||
runStage('load pipeline') {
|
||||
env.JENKINS_LIB = "build_utils/jenkins_lib"
|
||||
pipeDefault = load("${env.JENKINS_LIB}/pipeDefault.groovy")
|
||||
pipeJavaProto = load("${env.JENKINS_LIB}/pipeJavaProto.groovy")
|
||||
gitUtils = load("${env.JENKINS_LIB}/gitUtils.groovy")
|
||||
}
|
||||
|
||||
pipeDefault() {
|
||||
runStage('compile') {
|
||||
sh "make wc_compile"
|
||||
}
|
||||
env.skipSonar = 'true'
|
||||
pipeJavaProto()
|
||||
}
|
||||
}
|
42
Makefile
42
Makefile
@ -1,42 +0,0 @@
|
||||
THRIFT = $(or $(shell which thrift), $(error "`thrift' executable missing"))
|
||||
REBAR = $(shell which rebar3 2>/dev/null || which ./rebar3)
|
||||
SUBMODULES = build_utils
|
||||
SUBTARGETS = $(patsubst %,%/.git,$(SUBMODULES))
|
||||
|
||||
UTILS_PATH := build_utils
|
||||
TEMPLATES_PATH := .
|
||||
|
||||
# Name of the service
|
||||
SERVICE_NAME := limiter-proto
|
||||
|
||||
# Build image tag to be used
|
||||
BUILD_IMAGE_TAG := b04c5291d101132e53e578d96e1628d2e6dab0c0
|
||||
CALL_ANYWHERE := \
|
||||
all submodules compile clean distclean
|
||||
|
||||
CALL_W_CONTAINER := $(CALL_ANYWHERE)
|
||||
|
||||
all: compile
|
||||
|
||||
-include $(UTILS_PATH)/make_lib/utils_container.mk
|
||||
|
||||
.PHONY: $(CALL_W_CONTAINER)
|
||||
|
||||
# CALL_ANYWHERE
|
||||
$(SUBTARGETS): %/.git: %
|
||||
git submodule update --init $<
|
||||
touch $@
|
||||
|
||||
submodules: $(SUBTARGETS)
|
||||
|
||||
compile:
|
||||
$(REBAR) compile
|
||||
|
||||
clean:
|
||||
$(REBAR) clean
|
||||
|
||||
distclean:
|
||||
$(REBAR) clean -a
|
||||
rm -rfv _build
|
||||
|
||||
include $(UTILS_PATH)/make_lib/java_proto.mk
|
@ -1 +0,0 @@
|
||||
Subproject commit e1318727d4d0c3e48f5122bf3197158b6695f50e
|
55
pom.xml
55
pom.xml
@ -5,34 +5,57 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>com.rbkmoney</groupId>
|
||||
<artifactId>parent</artifactId>
|
||||
<groupId>dev.vality</groupId>
|
||||
<artifactId>library-parent-pom</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
|
||||
<groupId>com.rbkmoney</groupId>
|
||||
<artifactId>limiter-proto</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<version>${revision}</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>limiter</name>
|
||||
<description>Generates jar artifact containing compiled thrift classes based on generated thrift IDL files</description>
|
||||
<name>limiter-proto</name>
|
||||
<description>Generates jar artifact containing compiled thrift classes based on generated thrift IDL files
|
||||
</description>
|
||||
<url>https://github.com/valitydev/limiter-proto</url>
|
||||
|
||||
<licenses>
|
||||
<license>
|
||||
<name>The Apache Software License, Version 2.0</name>
|
||||
<url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
|
||||
</license>
|
||||
</licenses>
|
||||
|
||||
<developers>
|
||||
<developer>
|
||||
<email>devs@vality.dev</email>
|
||||
<organization>Vality</organization>
|
||||
<organizationUrl>https://vality.dev</organizationUrl>
|
||||
</developer>
|
||||
</developers>
|
||||
|
||||
<scm>
|
||||
<connection>scm:git:git://github.com/valitydev/limiter-proto</connection>
|
||||
<developerConnection>scm:git:ssh://github.com/valitydev/limiter-proto</developerConnection>
|
||||
<url>https://github.com/valitydev/limiter-proto/tree/master</url>
|
||||
</scm>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<revision>SNAPSHOT</revision>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.rbkmoney.woody</groupId>
|
||||
<groupId>dev.vality.woody</groupId>
|
||||
<artifactId>woody-thrift</artifactId>
|
||||
<version>LATEST</version>
|
||||
<version>1.0.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.rbkmoney</groupId>
|
||||
<artifactId>msgpack-proto</artifactId>
|
||||
<version>LATEST</version>
|
||||
<groupId>javax.annotation</groupId>
|
||||
<artifactId>javax.annotation-api</artifactId>
|
||||
<version>1.3.2</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
@ -44,7 +67,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.thrift</groupId>
|
||||
<artifactId>thrift-maven-plugin</artifactId>
|
||||
<version>0.9.3-1</version>
|
||||
<version>0.10.0</version>
|
||||
<configuration>
|
||||
<generator>java:fullcamel</generator>
|
||||
<thriftSourceRoot>${project.basedir}/proto</thriftSourceRoot>
|
||||
@ -60,11 +83,10 @@
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>3.0.0</version>
|
||||
<version>3.2.4</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
@ -74,8 +96,8 @@
|
||||
<configuration>
|
||||
<relocations>
|
||||
<relocation>
|
||||
<pattern>com.rbkmoney.limiter</pattern>
|
||||
<shadedPattern>com.rbkmoney.limiter.v${commit.number}</shadedPattern>
|
||||
<pattern>dev.vality.damsel</pattern>
|
||||
<shadedPattern>dev.vality.damsel.v${commit.number}</shadedPattern>
|
||||
</relocation>
|
||||
</relocations>
|
||||
<shadedArtifactAttached>true</shadedArtifactAttached>
|
||||
@ -86,5 +108,4 @@
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
|
@ -1,4 +1,4 @@
|
||||
namespace java com.rbkmoney.limiter.base
|
||||
namespace java dev.vality.limiter.base
|
||||
namespace erlang limiter_base
|
||||
|
||||
/**
|
||||
@ -44,15 +44,11 @@ typedef binary Opaque
|
||||
|
||||
/**
|
||||
* Идентификатор валюты
|
||||
*
|
||||
* Украдено из https://github.com/rbkmoney/damsel/blob/8235b6f6/proto/domain.thrift#L912
|
||||
*/
|
||||
struct CurrencyRef { 1: required CurrencySymbolicCode symbolic_code }
|
||||
|
||||
/**
|
||||
* Объём денежных средств
|
||||
*
|
||||
* Украдено из https://github.com/rbkmoney/damsel/blob/8235b6f6/proto/domain.thrift#L70
|
||||
*/
|
||||
struct Cash {
|
||||
1: required Amount amount
|
||||
|
@ -2,7 +2,7 @@ include "base.thrift"
|
||||
include "limiter.thrift"
|
||||
include "limiter_config.thrift"
|
||||
|
||||
namespace java com.rbkmoney.limiter.configurator
|
||||
namespace java dev.vality.limiter.configurator
|
||||
namespace erlang limiter_cfg
|
||||
|
||||
typedef base.ID LimitName
|
||||
|
@ -1,7 +1,7 @@
|
||||
include "base.thrift"
|
||||
include "limiter_context.thrift"
|
||||
|
||||
namespace java com.rbkmoney.limiter
|
||||
namespace java dev.vality.limiter
|
||||
namespace erlang limiter
|
||||
|
||||
typedef base.ID LimitChangeID
|
||||
|
@ -2,7 +2,7 @@
|
||||
* Машина хранящая конфигурацию лимита
|
||||
*/
|
||||
|
||||
namespace java com.rbkmoney.limiter.config
|
||||
namespace java dev.vality.limiter.config
|
||||
namespace erlang limiter_config
|
||||
|
||||
include "base.thrift"
|
||||
|
@ -1,6 +1,6 @@
|
||||
include "base.thrift"
|
||||
|
||||
namespace java com.rbkmoney.limiter.context
|
||||
namespace java dev.vality.limiter.context
|
||||
namespace erlang limiter_context
|
||||
|
||||
typedef base.ID ID
|
||||
@ -11,7 +11,6 @@ struct LimitContext {
|
||||
|
||||
/**
|
||||
* Контекст, получаемый из сервисов, реализующих один из интерфейсов протокола
|
||||
* https://github.com/rbkmoney/damsel/tree/master/proto/payment_processing.thrift
|
||||
* (например invoicing в hellgate)
|
||||
*/
|
||||
struct ContextPaymentProcessing {
|
||||
|
@ -2,7 +2,7 @@
|
||||
* Машина хранящая временные интервалы
|
||||
*/
|
||||
|
||||
namespace java com.rbkmoney.limiter.range
|
||||
namespace java dev.vality.limiter.range
|
||||
namespace erlang limiter_range
|
||||
|
||||
include "base.thrift"
|
||||
|
@ -2,7 +2,7 @@
|
||||
* Временные интервалы
|
||||
*/
|
||||
|
||||
namespace java com.rbkmoney.limiter.range.time
|
||||
namespace java dev.vality.limiter.range.time
|
||||
namespace erlang time_range
|
||||
|
||||
include "base.thrift"
|
||||
|
@ -49,7 +49,7 @@
|
||||
|
||||
{plugins, [
|
||||
{rebar3_thrift_compiler,
|
||||
{git, "https://github.com/rbkmoney/rebar3_thrift_compiler.git", {branch, "master"}}}
|
||||
{git, "https://github.com/valitydev/rebar3_thrift_compiler.git", {branch, "master"}}}
|
||||
]}.
|
||||
|
||||
{provider_hooks, [
|
||||
|
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"
|
||||
}
|
||||
]
|
||||
}
|
@ -4,8 +4,5 @@
|
||||
{applications, [
|
||||
kernel,
|
||||
stdlib
|
||||
]},
|
||||
{maintainers, [
|
||||
"Artem Fedorenko <a.fedorenko@rbkmoney.com>"
|
||||
]}
|
||||
]}.
|
||||
|
Loading…
Reference in New Issue
Block a user