migrate on dev.vality domain and GitHub Action CI

This commit is contained in:
Anatoly Karlov 2022-01-14 14:23:40 +03:00
parent 0b031c14b0
commit 2330facac1
14 changed files with 155 additions and 78 deletions

29
.github/workflows/build.yml vendored Normal file
View 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
View 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 }}"'

2
.gitignore vendored
View File

@ -9,4 +9,4 @@
.tags*
rebar3.crashdump
include/*.hrl
src/*.erl
src/*.erl

4
.gitmodules vendored
View File

@ -1,4 +0,0 @@
[submodule "build_utils"]
path = build_utils
url = git@github.com:rbkmoney/build_utils.git
branch = master

23
Jenkinsfile vendored
View File

@ -1,23 +0,0 @@
#!groovy
// -*- mode: groovy -*-
build('identification-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")
gitUtils = load("${env.JENKINS_LIB}/gitUtils.groovy")
}
pipeDefault() {
runStage('compile') {
sh "make wc_compile"
}
}
}

View File

@ -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 := identification_proto
# Build image tag to be used
BUILD_IMAGE_NAME := build-erlang
BUILD_IMAGE_TAG := 61a001bbb48128895735a3ac35b0858484fdb2eb
CALL_ANYWHERE := \
all submodules compile clean distclean \
java.compile java.deploy
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

@ -1 +0,0 @@
Subproject commit e1318727d4d0c3e48f5122bf3197158b6695f50e

87
pom.xml Normal file
View File

@ -0,0 +1,87 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>dev.vality</groupId>
<artifactId>library-parent-pom</artifactId>
<version>1.0.0</version>
</parent>
<artifactId>identification-proto</artifactId>
<version>${revision}</version>
<packaging>jar</packaging>
<name>identification-proto</name>
<description>Generates jar artifact containing compiled thrift classes based on generated thrift IDL files
</description>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<revision>SNAPSHOT</revision>
</properties>
<dependencies>
<dependency>
<groupId>dev.vality.woody</groupId>
<artifactId>woody-thrift</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>1.3.2</version>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<!-- THRIFT -->
<plugin>
<groupId>org.apache.thrift</groupId>
<artifactId>thrift-maven-plugin</artifactId>
<version>0.10.0</version>
<configuration>
<generator>java:fullcamel</generator>
<thriftSourceRoot>${project.basedir}/proto</thriftSourceRoot>
<thriftExecutable>${path_to_thrift}</thriftExecutable>
</configuration>
<executions>
<execution>
<id>thrift-sources</id>
<phase>generate-sources</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<relocations>
<relocation>
<pattern>dev.vality.damsel</pattern>
<shadedPattern>dev.vality.damsel.v${commit.number}</shadedPattern>
</relocation>
</relocations>
<shadedArtifactAttached>true</shadedArtifactAttached>
<shadedClassifierName>v${commit.number}</shadedClassifierName>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -4,7 +4,7 @@
* commit id: b0806eb1d55646cbb937206ad8183e6d3f62719a
*/
namespace java com.rbkmoney.identity.base
namespace java dev.vality.identity.base
namespace erlang identity_base
/** Идентификатор */

View File

@ -2,7 +2,7 @@
* Определение непрозрачного контекста объектов.
*/
namespace java com.rbkmoney.identity.ctx
namespace java dev.vality.identity.ctx
namespace erlang identity_ctx
include "msgpack.thrift"
@ -10,7 +10,7 @@ include "msgpack.thrift"
/**
* Пространство имён, отделяющее конексты одного сервиса.
*
* Например, `com.rbkmoney.capi`.
* Например, `dev.vality.capi`.
*/
typedef string Namespace

View File

@ -3,7 +3,7 @@
* и привязки идентифицированной сущности к ее владельцу.
*/
namespace java com.rbkmoney.identity
namespace java dev.vality.identity
namespace erlang identity
include "base.thrift"

View File

@ -1,4 +1,4 @@
namespace java com.rbkmoney.damsel.identity.errors
namespace java dev.vality.damsel.identity.errors
namespace erlang identity_err

View File

@ -1,4 +1,4 @@
namespace java com.rbkmoney.identity.msgpack
namespace java dev.vality.identity.msgpack
namespace erlang identity_msgpack
/**

View File

@ -50,7 +50,7 @@
{plugins, [
{rebar3_thrift_compiler,
{git, "https://github.com/rbkmoney/rebar3_thrift_compiler.git", {tag, "0.2"}}}
{git, "https://github.com/valitydev/rebar3_thrift_compiler.git", {tag, "0.2"}}}
]}.
{provider_hooks, [