Skip to content

Commit

Permalink
Remove old rippled integration
Browse files Browse the repository at this point in the history
rm dockerhub pushing
  • Loading branch information
legleux committed Jan 18, 2024
1 parent e715467 commit b026bf4
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 348 deletions.
28 changes: 2 additions & 26 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ on:
jobs:
package:
name: Build packages
runs-on: ubuntu-latest
runs-on: [self-hosted, heavy]

container:
image: rippleci/xbwd-builder
steps:
Expand All @@ -29,12 +30,9 @@ jobs:
name: Publish Docker images
needs: package
env:
# The repo on Docker Hub the image will get pushed to. GHCR will be set by ${{ github.repository_owner }}
DOCKERHUB_REPO: legleux
# The the "latest" image will be built from this branch
LATEST_BRANCH: main
IMAGE_NAME: xbwd
DH_CREDS: "${{ secrets.DOCKERHUB_USER }} ${{ secrets.DOCKERHUB_PW }}"
GH_CREDS: ${{ secrets.GITHUB_TOKEN }}

steps:
Expand All @@ -54,22 +52,16 @@ jobs:
echo "BASE_IMAGE_NAME=${BASE_IMAGE_NAME}" >> $GITHUB_OUTPUT
BRANCH=${GITHUB_REF#refs/heads/}
DH_TAGS="${SHA} ${BRANCH}"
GH_TAGS="${SHA} ${BRANCH}"
DH_IMAGE_NAME=${DOCKERHUB_REPO}/${IMAGE_NAME}
echo "DH_IMAGE_NAME=${DH_IMAGE_NAME}" >> $GITHUB_OUTPUT
GH_IMAGE_NAME="ghcr.io/${{ github.repository_owner }}/${IMAGE_NAME}"
echo "GH_IMAGE_NAME=${GH_IMAGE_NAME}" >> $GITHUB_OUTPUT
if [[ $BRANCH == $LATEST_BRANCH ]]; then
echo "Tagging $BRANCH as 'latest'"
DH_TAGS+=" latest"
GH_TAGS+=" latest"
fi
echo "DH_TAGS=${DH_TAGS}" >> $GITHUB_OUTPUT
echo "GH_TAGS=${GH_TAGS}" >> $GITHUB_OUTPUT
- name: Build Docker image
Expand All @@ -80,22 +72,6 @@ jobs:
docker build . -t ${IMAGE} --file .github/actions/image/Dockerfile
docker run --rm ${IMAGE} /opt/xbwd/bin/xbridge_witnessd --version
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_PW }}

- name: Push to dockerhub
shell: bash
run: |
for tag in ${{ steps.tag_name.outputs.DH_TAGS }}; do
echo "Tagging ${{ steps.tag_name.outputs.BASE_IMAGE_NAME}} to ${{ steps.tag_name.outputs.DH_IMAGE_NAME }}:${tag} for Docker Hub"
docker tag ${{ steps.tag_name.outputs.BASE_IMAGE_NAME}} ${{ steps.tag_name.outputs.DH_IMAGE_NAME }}:${tag}
echo "Pushing ${{ steps.tag_name.outputs.DH_IMAGE_NAME}}:${tag} to Docker Hub"
docker push ${{ steps.tag_name.outputs.DH_IMAGE_NAME}}:${tag}
done
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
Expand Down
36 changes: 0 additions & 36 deletions Builds/CMake/XBridgeWitnessNIH.cmake

This file was deleted.

51 changes: 0 additions & 51 deletions Builds/CMake/deps/Boost.cmake

This file was deleted.

36 changes: 0 additions & 36 deletions Builds/CMake/deps/FindRipple.cmake

This file was deleted.

90 changes: 3 additions & 87 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,14 @@ set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
set(CMAKE_VERBOSE_MAKEFILE 1)



#[===========================================[
The tool depends on the xrpl_core
library which is defined by the rippled
project. This looks for installed rippled
libs and, if not found, pulls them in with
FetchContent.
#]===========================================]
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/Builds/CMake")

#include(deps/Boost)
find_package(SOCI REQUIRED)
find_package(fmt REQUIRED)
find_package(date REQUIRED)
find_package(OpenSSL REQUIRED)
find_package(Threads)

include(XBridgeWitnessNIH)
find_package(xrpl REQUIRED)

get_directory_property(has_parent PARENT_DIRECTORY)

Expand All @@ -58,79 +47,6 @@ if (CMAKE_BUILD_TYPE STREQUAL "Debug")
add_compile_definitions(_DEBUG)
endif()

if (NOT has_parent)
find_package(Ripple QUIET)
if (NOT TARGET Ripple::xrpl_core)
include(deps/FindRipple)
if (NOT TARGET Ripple::xrpl_core)
find_package(Git)

if (NOT GIT_FOUND)
message (FATAL_ERROR "git is required to determine branch name")
endif ()

execute_process (COMMAND ${GIT_EXECUTABLE} "rev-parse" "--abbrev-ref" "HEAD"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
RESULT_VARIABLE _git_exit_code
OUTPUT_VARIABLE _branch
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET)
if (NOT _git_exit_code EQUAL 0)
message (WARNING "git command failed - deduced branch might be incorrect")
endif ()

# rippled_tag is cache string and can be overriden when configuring
# with -Drippled_tag=commit_or_tag in order to pick a specific
# rippled version to download. Default tag is develop/master/release as
# determined by the branch of this project
if (NOT (_branch STREQUAL "master" OR _branch STREQUAL "release"))
set (rippled_tag "develop" CACHE STRING
"tag/commit of rippled to fetch from if a local install is not found")
else ()
set (rippled_tag "${_branch}" CACHE STRING
"tag/commit of rippled to fetch from if a local install is not found")
endif ()
message(STATUS "Installed rippled not found... \
using local copy from tag/commit [${rippled_tag}]")
include (FetchContent)
FetchContent_Declare(
rippled_src
GIT_REPOSITORY https://github.com/XRPLF/rippled.git
GIT_TAG ${rippled_tag}
)
FetchContent_GetProperties(rippled_src)
if(NOT rippled_src_POPULATED)
message (STATUS "Pausing to download rippled source...")
FetchContent_Populate(rippled_src)

set (conan_build_type "Release")
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set (conan_build_type "Debug")
endif()

set (conan_profile "default")
if(NOT "${CONAN_PROFILE} " STREQUAL " ")
set (conan_profile ${CONAN_PROFILE})
endif()

execute_process (COMMAND conan install ${rippled_src_SOURCE_DIR} --build missing --output-folder . -s build_type=${conan_build_type} -pr=${conan_profile}
WORKING_DIRECTORY ${rippled_src_BINARY_DIR}
RESULT_VARIABLE _git_exit_code
OUTPUT_STRIP_TRAILING_WHITESPACE
ECHO_OUTPUT_VARIABLE
ECHO_ERROR_VARIABLE
)
if (NOT _git_exit_code EQUAL 0)
message (WARNING "conan exit_code: ${_git_exit_code}\n conan command failed - build might be incorrect")
endif ()

option (tests "Build tests" OFF)
add_subdirectory(${rippled_src_SOURCE_DIR} ${rippled_src_BINARY_DIR})
endif()
endif()
endif ()
endif ()

if(xbridge_witness_coverage)
set(coverage ${xbridge_witness_coverage} CACHE BOOL "gcc/clang only" FORCE)
endif()
Expand Down Expand Up @@ -218,7 +134,7 @@ if (tests)
src/test/RPCParse_test.cpp
src/test/WS_test.cpp
)
endif () #tests
endif ()

add_executable (${PROJECT_NAME}
${SOURCES}
Expand All @@ -233,7 +149,7 @@ if (is_linux)
target_link_options(${PROJECT_NAME} PUBLIC "LINKER:-z,relro,-z,now")
endif()
target_include_directories (${PROJECT_NAME} PRIVATE src ${date_INCLUDE_DIR})
target_link_libraries (${PROJECT_NAME} PUBLIC Ripple::xrpl_core XBridgeWitness::opts
target_link_libraries (${PROJECT_NAME} PUBLIC xrpl::libxrpl XBridgeWitness::opts
SOCI::soci_core_static SOCI::soci_sqlite3_static fmt::fmt OpenSSL::Crypto OpenSSL::SSL)

if (san)
Expand Down
Loading

0 comments on commit b026bf4

Please sign in to comment.