Build impl

This commit is contained in:
Egor Cherniak 2022-01-10 16:51:06 +03:00
parent 410b2c241d
commit 3e2b3b9e2f
No known key found for this signature in database
GPG Key ID: 26F47333B7BE4ED9
10 changed files with 78 additions and 85 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.9
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 }}"'

3
.gitmodules vendored
View File

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

24
Jenkinsfile vendored
View File

@ -1,24 +0,0 @@
#!groovy
// -*- mode: groovy -*-
build('binbase-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()
}

View File

@ -1,45 +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 := binbase-proto
# Build image tag to be used
BUILD_IMAGE_TAG := c66dc597fdc30abcb7a6368ba7cc13c02151f8de
CALL_ANYWHERE := \
all submodules rebar-update 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)
rebar-update:
$(REBAR) update
compile:
$(REBAR) compile
clean:
$(REBAR) clean
distclean:
$(REBAR) clean -a
rm -rfv _build _builds _cache _steps _temp
include $(UTILS_PATH)/make_lib/java_proto.mk

@ -1 +0,0 @@
Subproject commit 2fab5dff82ae08dacbea2f4a0d35d4f58577b708

24
pom.xml
View File

@ -5,13 +5,13 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.rbkmoney</groupId>
<artifactId>parent</artifactId>
<version>1.0.5</version>
<groupId>dev.vality</groupId>
<artifactId>library-parent-pom</artifactId>
<version>1.0.0</version>
</parent>
<artifactId>binbase-proto</artifactId>
<version>SNAPSHOT</version>
<version>${revision}</version>
<packaging>jar</packaging>
<name>Damsel</name>
@ -19,15 +19,21 @@
<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>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>1.3.2</version>
</dependency>
</dependencies>
<build>
@ -56,7 +62,7 @@
<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>
@ -66,8 +72,8 @@
<configuration>
<relocations>
<relocation>
<pattern>com.rbkmoney.damsel</pattern>
<shadedPattern>com.rbkmoney.damsel.v${commit.number}</shadedPattern>
<pattern>dev.vality.damsel</pattern>
<shadedPattern>dev.vality.damsel.v${commit.number}</shadedPattern>
</relocation>
</relocations>
<shadedArtifactAttached>true</shadedArtifactAttached>

View File

@ -1,4 +1,4 @@
namespace java com.rbkmoney.damsel.binbase
namespace java dev.vality.damsel.binbase
namespace erlang binbase
include "msgpack.thrift"

View File

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

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, [