Skip to content

Commit

Permalink
Merge pull request #2026 from hollaex/testnet
Browse files Browse the repository at this point in the history
Testnet
  • Loading branch information
abeikverdi authored Mar 11, 2023
2 parents 266526f + 6129dbb commit ffe7999
Show file tree
Hide file tree
Showing 42 changed files with 1,168 additions and 217 deletions.
112 changes: 110 additions & 2 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,125 @@ trigger:

---

kind: pipeline
type: docker
name: hollaex_kit_amd64_build

platform:
os: linux
arch: amd64

steps:
- name: slack_noti_job_start_testnet
image: plugins/slack
settings:
channel: deployment
webhook:
from_secret: slack_webhook
template: "<{{build.link}}|HollaEx Kit Testnet AMD64 Build> - #{{build.number}} started on <https://github.com/{{repo.owner}}/{{repo.name}}/tree/{{build.branch}}|{{repo.name}} / {{build.branch}}> by {{build.author}}"
when:
branch: testnet

- name: slack_noti_job_start_master
image: plugins/slack
settings:
channel: deployment
webhook:
from_secret: slack_webhook
template: "<{{build.link}}|HollaEx Kit Master AMD64 Build> - #{{build.number}} started on <https://github.com/{{repo.owner}}/{{repo.name}}/tree/{{build.branch}}|{{repo.name}} / {{build.branch}}> by {{build.author}}"
when:
branch: master

- name: docker_tagging_amd64_testnet
image: alpine
commands:
- export TZ=UTC-9 && export GIT_COMMIT_SHORT="$(echo $DRONE_COMMIT | cut -c 1-7)" && export PACKAGE_VERSION="$(cat version)" && echo " $PACKAGE_VERSION-${DRONE_BRANCH}-$GIT_COMMIT_SHORT" > .tags
- echo "Current Docker tag is :" && cat .tags
- echo "dockerTag:$(cat .tags)" > .dockerTag.yml
when:
branch: testnet

- name: docker_tagging_amd64_master
image: alpine
commands:
- export TZ=UTC-9 && export GIT_COMMIT_SHORT="$(echo $DRONE_COMMIT | cut -c 1-7)" && export PACKAGE_VERSION="$(cat version)" && echo " $PACKAGE_VERSION,$PACKAGE_VERSION-amd64" > .tags
- echo "Current Docker tag is :" && cat .tags
- echo "dockerTag:$(cat .tags)" > .dockerTag.yml
when:
branch: master

- name: docker_build_amd64
image: plugins/docker
settings:
repo: bitholla/hollaex-kit
dockerfile: Dockerfile
environment:
DOCKER_USERNAME:
from_secret: docker_username
DOCKER_PASSWORD:
from_secret: docker_password

- name: manifest_creation
image: docker:18.06.3-dind
privileged: true
environment:
DOCKER_USERNAME:
from_secret: docker_username
DOCKER_PASSWORD:
from_secret: docker_password
volumes:
- name: docker
path: /var/run/docker.sock
commands:
- docker login -u $${DOCKER_USERNAME} -p $${DOCKER_PASSWORD}
- export DOCKER_CLI_EXPERIMENTAL=enabled
- export TZ=UTC-9 && export GIT_COMMIT_SHORT="$(echo $DRONE_COMMIT | cut -c 1-7)" && export PACKAGE_VERSION="$(grep version package.json | cut -c 15- | rev | cut -c 3- | rev)" && echo "$PACKAGE_VERSION" > .tags
- cat .tags
- docker manifest create bitholla/hollaex-kit:$(cat .tags) bitholla/hollaex-kit:$(cat .tags)-amd64 bitholla/hollaex-kit:$(cat .tags)-arm64v8 --amend
- docker manifest annotate bitholla/hollaex-kit:$(cat .tags) bitholla/hollaex-kit:$(cat .tags)-amd64 --arch amd64
- docker manifest annotate bitholla/hollaex-kit:$(cat .tags) bitholla/hollaex-kit:$(cat .tags)-arm64v8 --arch amd64
- docker manifest push bitholla/hollaex-kit:$(cat .tags)
when:
branch: master

- name: slack_noti_job_end
image: plugins/slack
settings:
channel: deployment
webhook:
from_secret: slack_webhook
template: >
{{#success build.status}}
Successfully <{{build.link}}|built> the AMD64 Docker Image.
{{else}}
<{{build.link}}|Failed to build the AMD64 Docker Image.>
{{/success}}
when:
status: [success, failure]

trigger:
branch:
- testnet
- master
event:
- push

---

kind: pipeline
type: docker
name: slack_notify

steps:
- name: partymaker_version_tag_testnet
- name: partymaker_version_tag
image: alpine
commands:
- cat version > .tags
- echo "Current version tag is :" && cat .tags
when:
branch: master

- name: partymaker_version_tag
- name: partymaker_version_tag_testnet
image: alpine
commands:
- echo "$(cat version)-testnet" > .tags
Expand Down Expand Up @@ -103,6 +208,9 @@ kind: pipeline
type: docker
name: kit_v2_sandbox_deployment

depends_on:
- hollaex_kit_amd64_build

steps:
- name: slack_noti_job_start
image: plugins/slack
Expand Down
32 changes: 32 additions & 0 deletions Dockerfile.arm64v8
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
FROM arm64v8/node:16.18.1-buster-slim

RUN apt-get update && \
apt-get install -y curl openssl ca-certificates git python build-essential && \
rm -rf /var/lib/apt/lists/* && \
npm config set unsafe-perm true && \
npm install [email protected] [email protected] mocha -g --loglevel=error

ENV NODE_ENV=production

COPY ./server /app

WORKDIR /app

# Changing the default image user to 'appuser'
RUN groupadd -g 999 appuser && \
useradd -r -u 999 -g appuser appuser && \
mkdir /home/appuser && \
chown -R appuser /home/appuser && \
chown -R appuser /app

USER appuser

RUN npm install --loglevel=error && \
pm2 update && \
cd /app/mail && npm install --loglevel=error

EXPOSE 10010

EXPOSE 10080

ENTRYPOINT ["/entrypoint.sh"]
117 changes: 101 additions & 16 deletions install.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,32 @@
#!/bin/bash

# Parameter support to specify version of the CLI to install.
export HOLLAEX_INSTALLER_VERSION_TARGET=${1:-"master"}

echo "Pulling HollaEx CLI from Github..."
curl -s https://raw.githubusercontent.com/bitholla/hollaex-cli/master/install.sh > cli_installer.sh && \
bash cli_installer.sh ${HOLLAEX_INSTALLER_VERSION_TARGET} \
rm cli_installer.sh

# Dependencies installer for Debian (Ubuntu) based Linux.
if command apt-get -v > /dev/null 2>&1; then

if ! command curl --version > /dev/null 2>&1; then

printf "\n\033[93mHollaEx CLI requires CURL to operate. Installing it now...\033[39m\n"

echo "Updating APT list"
sudo apt-get update
IS_APT_UPDATED=true

echo "Installing Docker"
if command sudo apt-get install -y curl; then

printf "\n\033[92mCURL has been successfully installed!\033[39m\n"
echo "Info: $(curl --version)"

else

printf "\n\033[91mFailed to install CURL.\033[39m\n"
echo "Please review the logs and try to manually install it. - 'sudo apt-get install -y curl'."
exit 1;

fi

fi

if ! command docker -v > /dev/null 2>&1; then

printf "\n\033[93mHollaEx CLI requires Docker to operate. Installing it now...\033[39m\n"
Expand Down Expand Up @@ -122,6 +138,31 @@ if command apt-get -v > /dev/null 2>&1; then
# Dependencies installer for macOS with Homebrew.
elif command brew -v > /dev/null 2>&1; then

if ! command curl --version > /dev/null 2>&1; then

printf "\n\033[93mHollaEx CLI requires CURL to operate. Installing it now...\033[39m\n"

if [[ ! $IS_BREW_UPDATED ]]; then

echo "Updating Homebrew list"
brew update
fi

if command brew install curl; then

printf "\n\033[92mCURL has been successfully installed!\033[39m\n"

echo "Info: $(curl --version)"

else

printf "\n\033[91mFailed to install CURL.\033[39m\n"
echo "Please review the logs and try to manually install it. - 'brew install curl'."
exit 1;

fi

fi

if ! command docker -v > /dev/null 2>&1; then

Expand Down Expand Up @@ -192,6 +233,25 @@ elif command brew -v > /dev/null 2>&1; then
# Dependencies installer for CentOS (RHEL) with Yum.
elif command yum --version > /dev/null 2>&1; then

if ! command curl --version > /dev/null 2>&1; then

printf "\n\033[93mHollaEx CLI requires CURL to operate. Installing it now...\033[39m\n"

if command sudo yum install -y curl; then

printf "\n\033[92mCURL has been successfully installed!\033[39m\n"

echo "Info: $(curl --version)"

else

printf "\n\033[91mFailed to install CURL.\033[39m\n"
echo "Please review the logs and try to manually install it. - 'sudo yum install -y curl'."

fi

fi

if ! command docker -v > /dev/null 2>&1; then

printf "\n\033[93mHollaEx CLI requires Docker to operate. Installing it now...\033[39m\n"
Expand Down Expand Up @@ -291,7 +351,7 @@ elif command yum --version > /dev/null 2>&1; then

fi

if ! command docker -v > /dev/null 2>&1 || ! command docker-compose -v > /dev/null 2>&1 || ! command jq --version > /dev/null 2>&1 || ! command nslookup -version > /dev/null 2>&1; then
if ! command docker -v > /dev/null 2>&1 || ! command docker-compose -v > /dev/null 2>&1 || ! command curl --version > /dev/null 2>&1 || ! command jq --version > /dev/null 2>&1 || ! command nslookup -version > /dev/null 2>&1; then

if command docker -v > /dev/null 2>&1; then

Expand All @@ -305,6 +365,12 @@ if ! command docker -v > /dev/null 2>&1 || ! command docker-compose -v > /dev/nu

fi

if command curl --version > /dev/null 2>&1; then

IS_CURL_INSTALLED=true

fi

if command jq --version > /dev/null 2>&1; then

IS_JQ_INSTALLED=true
Expand Down Expand Up @@ -363,18 +429,22 @@ if ! command docker -v > /dev/null 2>&1 || ! command docker-compose -v > /dev/nu

fi

printf "\n\033[93mPlease install the missing one before you proceed to run exchange.\033[39m\n"
# curl installation status check
if [[ "$IS_CURL_INSTALLED" ]]; then

else
printf "\033[92mcurl: Installed\033[39m\n"

else

printf "\033[91mcurl: Not Installed\033[39m\n"

printf "\nYou are good to go!\n\n"
fi

if [[ "$IS_APT_UPDATED" ]] || [[ "$IS_BREW_UPDATED" ]]; then
printf "\n\033[93mPlease install the missing one before you proceed to run exchange.\033[39m\n"

echo "Start configuring your exchange with the command: 'hollaex server --setup'."
printf "\nTo see the full list of commands, use 'hollaex help'.\n\n"
else

fi
printf "\nThe dependencies are all set!\n\n"

if [[ "$DOCKER_USERGROUP_ADDED" ]]; then

Expand All @@ -384,4 +454,19 @@ else

fi

# Parameter support to specify version of the CLI to install.
export HOLLAEX_INSTALLER_VERSION_TARGET=${1:-"master"}

echo "Pulling HollaEx CLI from Github..."
curl -s https://raw.githubusercontent.com/bitholla/hollaex-cli/master/install.sh > cli_installer.sh && \
bash cli_installer.sh ${HOLLAEX_INSTALLER_VERSION_TARGET} \
rm cli_installer.shs

if [[ "$IS_APT_UPDATED" ]] || [[ "$IS_BREW_UPDATED" ]]; then

echo "Start configuring your exchange with the command: 'hollaex server --setup'."
printf "\nTo see the full list of commands, use 'hollaex help'.\n\n"

fi

exit 0;
2 changes: 1 addition & 1 deletion server/api/swagger/swagger.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const definition = {
swagger: '2.0',
info: {
title: 'HollaEx Kit',
version: '2.5.1'
version: '2.5.2'
},
host: 'api.hollaex.com',
basePath: '/v2',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
'use strict';

const TABLE = 'Plugins';
const COLUMN = 'description';

module.exports = {
up: (queryInterface, Sequelize) =>
queryInterface.changeColumn(TABLE, COLUMN, {
type: Sequelize.TEXT,
allowNull: true
}),
down: (queryInterface, Sequelize) =>
queryInterface.changeColumn(TABLE, COLUMN, {
type: Sequelize.STRING,
allowNull: true
})
};
2 changes: 1 addition & 1 deletion server/db/models/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module.exports = (sequelize, DataTypes) => {
type: DataTypes.STRING
},
description: {
type: DataTypes.STRING
type: DataTypes.TEXT
},
documentation: {
type: DataTypes.STRING
Expand Down
3 changes: 2 additions & 1 deletion server/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "2.5.1",
"version": "2.5.2",
"private": false,
"description": "HollaEx Kit",
"keywords": [
Expand Down Expand Up @@ -34,6 +34,7 @@
"hollaex-tools-lib": "file:utils/hollaex-tools-lib",
"http": "0.0.0",
"http-proxy-middleware": "2.0.6",
"express-http-proxy": "1.6.3",
"install": "0.10.4",
"ip-range-check": "0.2.0",
"is-base64": "1.1.0",
Expand Down
Loading

0 comments on commit ffe7999

Please sign in to comment.