forked from nanocurrency/nano-node
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add test network to build artifacts for non DB tags (nanocurrency#3000)
* add test network to build artifacts for non DB tags different installation defaults for different networks update debian package, will create user(nanocurrency) and service for each network * rename variable for continuity
- Loading branch information
Russel Waters
authored
Oct 20, 2020
1 parent
41a6423
commit ccdbda7
Showing
13 changed files
with
213 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
name: TestNetwork | ||
|
||
on: | ||
push: | ||
tags-ignore: | ||
- '*DB*' | ||
env: | ||
artifact: 1 | ||
TEST: 1 | ||
|
||
jobs: | ||
osx_job: | ||
runs-on: macOS-latest | ||
env: | ||
BOOST_ROOT: /tmp/boost | ||
steps: | ||
- uses: actions/checkout@722adc6 | ||
- uses: chrislennon/action-aws-cli@f0f8671 | ||
- name: tag | ||
run: echo "::set-env name=TAG::`git describe --tags $GITHUB_SHA`" | ||
- name: Checkout Submodules | ||
run: git submodule update --init --recursive | ||
- name: Fetch Deps | ||
run: ci/actions/osx/install_deps.sh | ||
- name: Build Artifact | ||
run: TRAVIS_TAG=${TAG} ci/build-deploy.sh "/tmp/qt/lib/cmake/Qt5"; | ||
- name: Deploy Artifact | ||
run: ci/actions/deploy.sh | ||
env: | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
AWS_DEFAULT_REGION: us-east-2 | ||
|
||
linux_job: | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
- uses: actions/checkout@722adc6 | ||
- uses: chrislennon/action-aws-cli@f0f8671 | ||
- name: tag | ||
run: echo "::set-env name=TAG::`git describe --tags $GITHUB_SHA`" | ||
- name: Checkout Submodules | ||
run: git submodule update --init --recursive | ||
- name: Fetch Deps | ||
run: ci/actions/linux/install_deps.sh | ||
- name: Build Artifact | ||
run: docker run -e TEST -v ${GITHUB_WORKSPACE}:/workspace nanocurrency/nano-env:gcc /bin/bash -c "cd /workspace && TRAVIS_TAG=${TAG} ci/build-deploy.sh /usr/lib/x86_64-linux-gnu/cmake/Qt5 ${PWD}" | ||
- name: Deploy Artifact | ||
run: ci/actions/deploy.sh | ||
env: | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
AWS_DEFAULT_REGION: us-east-2 | ||
|
||
linux_docker_job: | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
- uses: actions/checkout@722adc6 | ||
- uses: chrislennon/action-aws-cli@f0f8671 | ||
- name: tag | ||
run: echo "::set-env name=TAG::`git describe --tags $GITHUB_SHA`" | ||
- name: Checkout Submodules | ||
run: git submodule update --init --recursive | ||
- name: Fetch Deps | ||
run: ci/actions/linux/install_deps.sh | ||
- name: Deploy Docker (nanocurrency/nano) | ||
run: TRAVIS_TAG=${TAG} ci/actions/linux/deploy-docker.sh | ||
env: | ||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
windows_job: | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@722adc6 | ||
- uses: chrislennon/action-aws-cli@f0f8671 | ||
- name: tag | ||
run: | | ||
$TRAVIS_TAG=git describe --tags $GITHUB_SHA | ||
echo "::set-env name=TAG::$TRAVIS_TAG" | ||
- name: Checkout Submodules | ||
run: git submodule update --init --recursive | ||
- name: Fetch Deps | ||
run: ci/actions/windows/install_deps.ps1 | ||
- name: Build Artifact | ||
run: ci/actions/windows/build.ps1 | ||
env: | ||
CSC_LINK: ${{ secrets.CSC_LINK }} | ||
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }} | ||
- name: Deploy Artifact | ||
run: ci/actions/windows/deploy.ps1 | ||
env: | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
AWS_DEFAULT_REGION: us-east-2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -95,6 +95,27 @@ option(ENABLE_AVX2 "Enable AVX2 optimizations" OFF) | |
|
||
SET (ACTIVE_NETWORK nano_live_network CACHE STRING "Selects which network parameters are used") | ||
set_property (CACHE ACTIVE_NETWORK PROPERTY STRINGS nano_dev_network nano_beta_network nano_live_network nano_test_network) | ||
set (CPACK_PACKAGE_NAME "nano-node" CACHE STRING "" FORCE) | ||
set (CPACK_NSIS_PACKAGE_NAME "Nano" CACHE STRING "" FORCE) | ||
set (CPACK_PACKAGE_INSTALL_DIRECTORY "nanocurrency" CACHE STRING "" FORCE) | ||
set (NANO_SERVICE "nanocurrency.service") | ||
set (NANO_PREFIX "") | ||
if ("${ACTIVE_NETWORK}" MATCHES "nano_beta_network") | ||
project("nano-node-beta") | ||
set (CPACK_PACKAGE_NAME "nano-node-beta" CACHE STRING "" FORCE) | ||
set (CPACK_NSIS_PACKAGE_NAME "Nano-Beta" CACHE STRING "" FORCE) | ||
set (CPACK_PACKAGE_INSTALL_DIRECTORY "nanocurrency-beta" CACHE STRING "" FORCE) | ||
set (NANO_SERVICE "nanocurrency-beta.service") | ||
set (NANO_PREFIX "Beta") | ||
elseif ("${ACTIVE_NETWORK}" MATCHES "nano_test_network") | ||
project("nano-node-test") | ||
set (CPACK_PACKAGE_NAME "nano-node-test" CACHE STRING "" FORCE) | ||
set (CPACK_NSIS_PACKAGE_NAME "Nano-Test" CACHE STRING "" FORCE) | ||
set (CPACK_PACKAGE_INSTALL_DIRECTORY "nanocurrency-test" CACHE STRING "" FORCE) | ||
set (NANO_SERVICE "nanocurrency-test.service") | ||
set (NANO_PREFIX "Test") | ||
endif() | ||
set (NANO_OSX_PACKAGE_NAME ${CPACK_NSIS_PACKAGE_NAME} CACHE STRING "" FORCE) | ||
|
||
if(NOT CMAKE_BUILD_TYPE) | ||
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." FORCE) | ||
|
@@ -548,47 +569,44 @@ if (NANO_GUI OR RAIBLOCKS_GUI) | |
if (APPLE) | ||
set (CPACK_GENERATOR "DragNDrop") | ||
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/Info.plist.in ${CMAKE_SOURCE_DIR}/Info.plist @ONLY) | ||
install (TARGETS nano_wallet DESTINATION Nano.app/Contents/MacOS) | ||
install (TARGETS nano_node DESTINATION Nano.app/Contents/MacOS) | ||
install (TARGETS nano_rpc DESTINATION Nano.app/Contents/MacOS) | ||
install (FILES Info.plist DESTINATION Nano.app/Contents) | ||
install (FILES qt.conf DESTINATION Nano.app/Contents/Resources) | ||
install (DIRECTORY ${Qt5_DIR}/../../QtCore.framework DESTINATION Nano.app/Contents/Frameworks) | ||
install (DIRECTORY ${Qt5_DIR}/../../QtDBus.framework DESTINATION Nano.app/Contents/Frameworks) | ||
install (DIRECTORY ${Qt5_DIR}/../../QtGui.framework DESTINATION Nano.app/Contents/Frameworks) | ||
install (DIRECTORY ${Qt5_DIR}/../../QtPrintSupport.framework DESTINATION Nano.app/Contents/Frameworks) | ||
install (DIRECTORY ${Qt5_DIR}/../../QtTest.framework DESTINATION Nano.app/Contents/Frameworks) | ||
install (DIRECTORY ${Qt5_DIR}/../../QtWidgets.framework DESTINATION Nano.app/Contents/Frameworks) | ||
install (FILES "${Qt5_DIR}/../../../plugins/platforms/libqcocoa.dylib" DESTINATION Nano.app/Contents/PlugIns/platforms) | ||
install (TARGETS nano_wallet DESTINATION ${NANO_OSX_PACKAGE_NAME}.app/Contents/MacOS) | ||
install (TARGETS nano_node DESTINATION ${NANO_OSX_PACKAGE_NAME}.app/Contents/MacOS) | ||
install (TARGETS nano_rpc DESTINATION ${NANO_OSX_PACKAGE_NAME}.app/Contents/MacOS) | ||
install (FILES Info.plist DESTINATION ${NANO_OSX_PACKAGE_NAME}.app/Contents) | ||
install (FILES qt.conf DESTINATION ${NANO_OSX_PACKAGE_NAME}.app/Contents/Resources) | ||
install (DIRECTORY ${Qt5_DIR}/../../QtCore.framework DESTINATION ${NANO_OSX_PACKAGE_NAME}.app/Contents/Frameworks) | ||
install (DIRECTORY ${Qt5_DIR}/../../QtDBus.framework DESTINATION ${NANO_OSX_PACKAGE_NAME}.app/Contents/Frameworks) | ||
install (DIRECTORY ${Qt5_DIR}/../../QtGui.framework DESTINATION ${NANO_OSX_PACKAGE_NAME}.app/Contents/Frameworks) | ||
install (DIRECTORY ${Qt5_DIR}/../../QtPrintSupport.framework DESTINATION ${NANO_OSX_PACKAGE_NAME}.app/Contents/Frameworks) | ||
install (DIRECTORY ${Qt5_DIR}/../../QtTest.framework DESTINATION ${NANO_OSX_PACKAGE_NAME}.app/Contents/Frameworks) | ||
install (DIRECTORY ${Qt5_DIR}/../../QtWidgets.framework DESTINATION ${NANO_OSX_PACKAGE_NAME}.app/Contents/Frameworks) | ||
install (FILES "${Qt5_DIR}/../../../plugins/platforms/libqcocoa.dylib" DESTINATION ${NANO_OSX_PACKAGE_NAME}.app/Contents/PlugIns/platforms) | ||
if (NANO_SHARED_BOOST) | ||
foreach(boost_lib IN LISTS Boost_LIBRARIES) | ||
string(REGEX MATCH "(.+/.*boost_[^-]+)" boost_lib_name ${boost_lib}) | ||
set (boost_dll "${CMAKE_MATCH_1}") | ||
if (${boost_dll} MATCHES "boost") | ||
install (FILES ${boost_dll} DESTINATION Nano.app/Contents/boost/lib) | ||
install (FILES ${boost_dll} DESTINATION ${NANO_OSX_PACKAGE_NAME}.app/Contents/boost/lib) | ||
endif() | ||
endforeach(boost_lib) | ||
endif() | ||
if (NANO_POW_SERVER) | ||
install (TARGETS nano_pow_server DESTINATION Nano.app/Contents/MacOS) | ||
install (DIRECTORY ${PROJECT_SOURCE_DIR}/nano-pow-server/public DESTINATION Nano.app/Contents/MacOS) | ||
install (TARGETS nano_pow_server DESTINATION ${NANO_OSX_PACKAGE_NAME}.app/Contents/MacOS) | ||
install (DIRECTORY ${PROJECT_SOURCE_DIR}/nano-pow-server/public DESTINATION ${NANO_OSX_PACKAGE_NAME}.app/Contents/MacOS) | ||
endif() | ||
install (FILES Nano.icns DESTINATION Nano.app/Contents/Resources) | ||
install (FILES Nano.icns DESTINATION ${NANO_OSX_PACKAGE_NAME}.app/Contents/Resources) | ||
elseif (WIN32) | ||
if ("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") | ||
set (WIN_REDIST vc_redist.x64.exe) | ||
else () | ||
set (WIN_REDIST vc_redist.x86.exe) | ||
endif () | ||
set (CPACK_NSIS_EXTRA_INSTALL_COMMANDS "ExecWait '\\\"$INSTDIR\\\\${WIN_REDIST}\\\" /quiet /norestart' | ||
WriteRegDWORD HKLM 'SYSTEM\\\\CurrentControlSet\\\\Services\\\\EventLog\\\\Nano\\\\Nano' 'TypesSupported' '0x7' | ||
WriteRegStr HKLM 'SYSTEM\\\\CurrentControlSet\\\\Services\\\\EventLog\\\\Nano\\\\Nano' 'EventMessageFile' '$INSTDIR\\\\nano_wallet.exe'") | ||
set (CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "DeleteRegKey HKLM 'SYSTEM\\\\CurrentControlSet\\\\Services\\\\EventLog\\\\Nano'") | ||
set (CPACK_PACKAGE_INSTALL_DIRECTORY "nanocurrency") | ||
WriteRegDWORD HKLM 'SYSTEM\\\\CurrentControlSet\\\\Services\\\\EventLog\\\\Nano\\\\Nano${NANO_PREFIX}' 'TypesSupported' '0x7' | ||
WriteRegStr HKLM 'SYSTEM\\\\CurrentControlSet\\\\Services\\\\EventLog\\\\Nano\\\\Nano${NANO_PREFIX}' 'EventMessageFile' '$INSTDIR\\\\nano_wallet.exe'") | ||
set (CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "DeleteRegKey HKLM 'SYSTEM\\\\CurrentControlSet\\\\Services\\\\EventLog\\\\Nano${NANO_PREFIX}'") | ||
set (CPACK_NSIS_MUI_ICON ${CMAKE_SOURCE_DIR}/Nano.ico) | ||
set (CPACK_NSIS_DISPLAY_NAME "Nano") | ||
set (CPACK_PACKAGE_NAME "nano-node") | ||
set (CPACK_NSIS_PACKAGE_NAME "Nano") | ||
set (CPACK_NSIS_DISPLAY_NAME "Nano${NANO_PREFIX}") | ||
set (CPACK_NSIS_URL_INFO_ABOUT "https://nano.org") | ||
set (CPACK_NSIS_CONTACT "[email protected]") | ||
set (CPACK_NSIS_MENU_LINKS "nano_wallet.exe" "Nano Wallet" "https://nano.org" "Nano website") | ||
|
@@ -645,6 +663,20 @@ if (NANO_GUI OR RAIBLOCKS_GUI) | |
install (TARGETS nano_pow_server DESTINATION ./bin) | ||
install (DIRECTORY ${PROJECT_SOURCE_DIR}/nano-pow-server/public DESTINATION ./bin) | ||
endif () | ||
set(DEBIAN_POSTINST postinst.in) | ||
set(DEBIAN_POSTRM postrm.in) | ||
|
||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/debian-control/${DEBIAN_POSTINST} | ||
${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/postinst) | ||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/debian-control/${DEBIAN_POSTRM} | ||
${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/postrm) | ||
file(COPY ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/postinst | ||
${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/postrm | ||
DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/debian-control/. | ||
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ | ||
GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) | ||
install (FILES etc/systemd/${NANO_SERVICE} DESTINATION ./extras/systemd/.) | ||
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_BINARY_DIR}/debian-control/postinst;${CMAKE_CURRENT_BINARY_DIR}/debian-control/postrm") | ||
endif () | ||
endif () | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/env bash | ||
|
||
set +e | ||
|
||
useradd -r nanocurrency | ||
groupadd -r nanocurrency | ||
|
||
mkdir -p /var/nanocurrency/Nano | ||
mkdir -p /var/nanocurrency/NanoBeta | ||
mkdir -p /var/nanocurrency/NanoTest | ||
chown -R nanocurrency: /var/nanocurrency | ||
|
||
systemctl stop ${NANO_SERVICE} 2>/dev/null | ||
systemctl disable ${NANO_SERVICE} 2>/dev/null | ||
cp ${CMAKE_INSTALL_PREFIX}/extras/systemd/${NANO_SERVICE} /etc/systemd/system/${NANO_SERVICE} | ||
systemctl daemon-reload | ||
systemctl enable ${NANO_SERVICE} | ||
systemctl start ${NANO_SERVICE} | ||
sleep 1 | ||
systemctl --no-pager status ${NANO_SERVICE} | ||
|
||
set -e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env bash | ||
|
||
set +e | ||
|
||
systemctl stop ${NANO_SERVICE} 2>/dev/null | ||
systemctl disable ${NANO_SERVICE} 2>/dev/null | ||
rm -rf /etc/systemd/system/${NANO_SERVICE} | ||
systemctl daemon-reload | ||
|
||
set -e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[Unit] | ||
Description=Nano Test Network Daemon | ||
After=network.target | ||
|
||
[Service] | ||
Type=simple | ||
User=nanocurrency | ||
WorkingDirectory=/var/nanocurrency/NanoTest | ||
ExecStart=/usr/bin/nano_node --daemon --network=test --data_path=/var/nanocurrency/NanoTest | ||
Restart=on-failure | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters