diff options
author | Nikita Kozlovskiy <nikitka@gmail.com> | 2023-07-17 15:33:09 +0000 |
---|---|---|
committer | nkozlovskiy <nmk@ydb.tech> | 2023-07-17 18:33:09 +0300 |
commit | 73554a93bde316abed1cb16560985db25564cc3f (patch) | |
tree | 4a1bb562e8676cdd113d3ae88430da8e2f09a28e | |
parent | b5cf42727a51c60ab7cbca31253756dec5cdac23 (diff) | |
download | ydb-73554a93bde316abed1cb16560985db25564cc3f.tar.gz |
ci: fix docker local_ydb build
ci: fix docker local_ydb build
Pull Request resolved: #308
-rw-r--r-- | .github/docker/Dockerfile | 18 | ||||
-rw-r--r-- | .github/docker/files/cmake_common.patch | 13 | ||||
-rwxr-xr-x | .github/docker/files/make-vcs-info.py | 43 | ||||
-rw-r--r-- | .github/workflows/docker_publish.yml | 2 |
4 files changed, 3 insertions, 73 deletions
diff --git a/.github/docker/Dockerfile b/.github/docker/Dockerfile index d41fdb518e..35b02dcf1f 100644 --- a/.github/docker/Dockerfile +++ b/.github/docker/Dockerfile @@ -25,28 +25,14 @@ ENV GIT_REPO=$GIT_REPO ENV GIT_REF=$GIT_REF RUN mkdir ydb \ - && cd ydb \ - && git init -b main \ - && git remote add origin $GIT_REPO \ - && git fetch --depth=1 origin $GIT_REF \ - && git reset --hard FETCH_HEAD - -COPY files/cmake_common.patch /tmp -COPY files/make-vcs-info.py /tmp - -RUN cd ydb \ - && python3 /tmp/make-vcs-info.py . vcs-info.json \ - && cat vcs-info.json - - -RUN cd ydb/ && patch -p1 < /tmp/cmake_common.patch + && git clone --depth=1 -b "${GIT_REF?}" ${GIT_REPO?} RUN --mount=type=secret,id=ccache_remote_storage \ mkdir build && cd build \ && export CONAN_USER_HOME=/ydbwork/build \ && export CCACHE_BASEDIR=/ydbwork/ \ && export CCACHE_SLOPPINESS=locale \ - && export CCACHE_REMOTE_STORAGE="$( cat /run/secrets/ccache_remote_storage)" \ + && export CCACHE_REMOTE_STORAGE="$(cat /run/secrets/ccache_remote_storage)" \ && cmake -G Ninja -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_C_COMPILER_LAUNCHER=/usr/local/bin/ccache -DCMAKE_CXX_COMPILER_LAUNCHER=/usr/local/bin/ccache \ -DCMAKE_TOOLCHAIN_FILE=../ydb/clang.toolchain \ diff --git a/.github/docker/files/cmake_common.patch b/.github/docker/files/cmake_common.patch deleted file mode 100644 index 0533c57a42..0000000000 --- a/.github/docker/files/cmake_common.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/cmake/common.cmake b/cmake/common.cmake -index 00f970a036..0408e57701 100644 ---- a/cmake/common.cmake -+++ b/cmake/common.cmake -@@ -162,7 +162,7 @@ endfunction() - function(vcs_info Tgt) - add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/__vcs_version__.c -- COMMAND Python3::Interpreter ${CMAKE_SOURCE_DIR}/build/scripts/vcs_info.py no-vcs dummy.json ${CMAKE_CURRENT_BINARY_DIR}/__vcs_version__.c ${CMAKE_SOURCE_DIR}/build/scripts/c_templates/svn_interface.c -+ COMMAND Python3::Interpreter ${CMAKE_SOURCE_DIR}/build/scripts/vcs_info.py ${CMAKE_SOURCE_DIR}/vcs-info.json ${CMAKE_CURRENT_BINARY_DIR}/__vcs_version__.c ${CMAKE_SOURCE_DIR}/build/scripts/c_templates/svn_interface.c - DEPENDS ${CMAKE_SOURCE_DIR}/build/scripts/vcs_info.py ${CMAKE_SOURCE_DIR}/build/scripts/c_templates/svn_interface.c - ) - target_sources(${Tgt} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/__vcs_version__.c) diff --git a/.github/docker/files/make-vcs-info.py b/.github/docker/files/make-vcs-info.py deleted file mode 100755 index 061d565eda..0000000000 --- a/.github/docker/files/make-vcs-info.py +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/env python3 -import argparse -import json -import os -import subprocess - - -def main(): - parser = argparse.ArgumentParser() - parser.add_argument('path') - parser.add_argument('out', type=argparse.FileType('w')) - args = parser.parse_args() - - os.chdir(os.path.expanduser(args.path)) - git_show_cmd = 'git show -s --format=\'{"ref": "%D", "sha": "%H","author": "%an <%ae>","date":"%ad","commit_message": "%s"}\' HEAD' - output = subprocess.getoutput(git_show_cmd) - print(f'git output: {output}') - git_info = json.loads(output) - - refname = os.environ['GIT_REF'] - # refname = git_info['ref'] - commit = git_info['sha'] - author = git_info['author'] - summary = git_info['commit_message'] - - scm_data = f'''Git info: - refname: {refname} - Commit: {commit} - Author: {author} - Summary: {summary} -''' - - vcs_info = { - 'BRANCH': refname, - 'SCM_DATA': scm_data, - 'PROGRAM_VERSION': scm_data - } - - json.dump(vcs_info, args.out, indent=4) - - -if __name__ == '__main__': - main() diff --git a/.github/workflows/docker_publish.yml b/.github/workflows/docker_publish.yml index f788ef6a8d..a3eebe195c 100644 --- a/.github/workflows/docker_publish.yml +++ b/.github/workflows/docker_publish.yml @@ -9,7 +9,7 @@ on: type: string required: true default: main - description: "Git branch/tag/sha revision to build" + description: "Git branch/tag revision to build" image_tag: type: string required: true |