Skip to content

Commit

Permalink
Ci update (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
Asherda authored Sep 4, 2018
1 parent cb15a2a commit e05f6b6
Show file tree
Hide file tree
Showing 9 changed files with 125 additions and 172 deletions.
199 changes: 113 additions & 86 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,113 +4,119 @@ stages:
- deploy
variables:
DOCKER_DRIVER: overlay2
DEFAULT_CLI_BRANCH: dev
DEFAULT_EASYDEXGUI_BRANCH: dev
AGAMA_VERSION: 0.3.13
EASYDEX_GUI_ARTIFACT: build.tar.gz
AGAMA_ARTIFACTS_LINUX: linux64.tar.gz
AGAMA_ARTIFACTS_MACOS: osx.tar.gz
AGAMA_ARTIFACTS_WINDOWS: win64.zip
EASYDEX_GUI_BUILD: build.tar.gz
ELECTRON_BUILD_LINUX: Agama-linux-x64
ELECTRON_BUILD_WINDOWS: Agama-win32-x64
ELECTRON_BUILD_OSX: Agama-darwin-x64
AGAMA_LINUX_PORTABLE: ${ELECTRON_BUILD_LINUX}-v${AGAMA_VERSION}-beta.tar.gz
AGAMA_WINDOWS_PORTABLE: ${ELECTRON_BUILD_WINDOWS}-v${AGAMA_VERSION}-beta.zip
AGAMA_OSX_PORTABLE: ${ELECTRON_BUILD_OSX}-v${AGAMA_VERSION}-beta.tar.gz
ELECTRON_BUILD_MACOS: Agama-darwin-x64
AGAMA_LINUX: ${ELECTRON_BUILD_LINUX}-v${AGAMA_VERSION}-beta.tar.gz
AGAMA_WINDOWS: ${ELECTRON_BUILD_WINDOWS}-v${AGAMA_VERSION}-beta.zip
AGAMA_MACOS: Agama-MacOS-v${AGAMA_VERSION}-beta
GIT_SUBMODULE_STRATEGY: recursive

POST_COMMENT: "$\n Agama Branch and Commit: ${CI_COMMIT_REF_NAME} ${CI_COMMIT_SHA} $'\n'MD5: "
build:linux:
image: asherd/agama-builder
stage: build
before_script:
- echo "$AUTH_KEY" > AUTH_KEY.json
- gcloud auth activate-service-account --key-file AUTH_KEY.json
- rm AUTH_KEY.json
- gsutil cp $STAGING/EasyDEX-GUI/$CI_COMMIT_REF_NAME/$EASYDEX_GUI_ARTIFACT . || gsutil cp $STAGING/EasyDEX-GUI/master/$EASYDEX_GUI_ARTIFACT .
- tar -xzf $EASYDEX_GUI_ARTIFACT --directory gui/EasyDEX-GUI/react
- rm $EASYDEX_GUI_ARTIFACT
- gsutil cp $STAGING/VerusCoin/$CI_COMMIT_REF_NAME/Linux/$AGAMA_ARTIFACTS_LINUX . || gsutil cp $STAGING/VerusCoin/master/Linux/$AGAMA_ARTIFACTS_LINUX .
- mkdir -p assets/bin/
- tar -xzf $AGAMA_ARTIFACTS_LINUX --directory assets/bin/ && ls assets/bin
- rm $AGAMA_ARTIFACTS_LINUX


- if [ -z "${VERUS_CLI_LINUX}" ]; then export VERUS_CLI_LINUX="Verus-CLI-Linux-v${AGAMA_VERSION}-beta.tar.gz"; fi
- if [ -z "${UPSTREAM_CLI_BRANCH}" ]; then export CLI_BRANCH=$CI_COMMIT_REF_NAME; else export CLI_BRANCH=$UPSTREAM_CLI_BRANCH; fi
- echo "$AUTH_KEY" > AUTH_KEY.json &&
gcloud auth activate-service-account
--key-file AUTH_KEY.json &&
rm AUTH_KEY.json
- echo "fetching latest build from EasyDEX-GUI:$CI_COMMIT_REF_NAME" &&
gsutil cp $STAGING/EasyDEX-GUI/$CI_COMMIT_REF_NAME/$EASYDEX_GUI_BUILD . ||
echo "No builds found in $CI_COMMIT_REF_NAME branch, fetching from $DEFAULT_EASYDEXGUI_BRANCH branch" &&
gsutil cp $STAGING/EasyDEX-GUI/$DEFAULT_EASYDEXGUI_BRANCH/$EASYDEX_GUI_BUILD .
- tar -xzf $EASYDEX_GUI_BUILD --directory gui/EasyDEX-GUI/react &&
rm $EASYDEX_GUI_BUILD
- echo "fetching builds from VerusCoin:$CLI_BRANCH" &&
gsutil cp $STAGING/VerusCoin/$CLI_BRANCH/Linux/$VERUS_CLI_LINUX . ||
echo "No matching artifacts found in $CLI_BRANCH branch, fetching from $DEFAULT_CLI_BRANCH branch" &&
gsutil cp $STAGING/VerusCoin/$DEFAULT_CLI_BRANCH/Linux/$VERUS_CLI_LINUX .
- mkdir -p assets/bin/
- tar -xzf $VERUS_CLI_LINUX --directory assets/bin/
- rm $VERUS_CLI_LINUX
- mv assets/bin/verus-cli assets/bin/linux64
script:
- npm install electron-packager -g
- npm install electron -g --unsafe-perm=true
- npm install
- ./buildscripts/electron-build-linux.sh
- cd build
- tar -czf $AGAMA_LINUX_PORTABLE $ELECTRON_BUILD_LINUX
- mv $AGAMA_LINUX_PORTABLE ..
- npm install electron-packager -g
- npm install electron -g --unsafe-perm=true
- npm install
- npm run package-linux
- cd build
- tar -czf $AGAMA_LINUX $ELECTRON_BUILD_LINUX
- mv $AGAMA_LINUX ..
artifacts:
paths:
- $AGAMA_LINUX_PORTABLE
paths: [$AGAMA_LINUX]
expire_in: 1 week


build:windows:
stage: build
image: asherd/agama-builder
image: asherd/agama-builder:windows
before_script:
- echo $AUTH_KEY > AUTH_KEY.json
- gcloud auth activate-service-account --key-file AUTH_KEY.json
- rm AUTH_KEY.json
- gsutil cp $STAGING/EasyDEX-GUI/$CI_COMMIT_REF_NAME/$EASYDEX_GUI_ARTIFACT . || gsutil cp $STAGING/EasyDEX-GUI/master/$EASYDEX_GUI_ARTIFACT .
- tar -xzf $EASYDEX_GUI_ARTIFACT --directory gui/EasyDEX-GUI/react
- rm $EASYDEX_GUI_ARTIFACT
- gsutil cp $STAGING/VerusCoin/$CI_COMMIT_REF_NAME/Windows/$AGAMA_ARTIFACTS_WINDOWS . || gsutil cp $STAGING/VerusCoin/master/Windows/$AGAMA_ARTIFACTS_WINDOWS .
- mkdir -p assets/bin/
- unzip $AGAMA_ARTIFACTS_WINDOWS -d assets/bin/ && ls assets/bin
- rm $AGAMA_ARTIFACTS_WINDOWS
- ./binary_artifacts_win.sh

- if [ -z "${VERUS_CLI_WINDOWS}" ]; then export VERUS_CLI_WINDOWS="Verus-CLI-Windows-v${AGAMA_VERSION}-beta.zip"; fi
- if [ -z "${UPSTREAM_CLI_BRANCH}" ]; then export CLI_BRANCH=$CI_COMMIT_REF_NAME; else export CLI_BRANCH=$UPSTREAM_CLI_BRANCH; fi
- echo "$AUTH_KEY" > AUTH_KEY.json &&
gcloud auth activate-service-account
--key-file AUTH_KEY.json &&
rm AUTH_KEY.json
- echo "fetching latest build from EasyDEX-GUI:$CI_COMMIT_REF_NAME"
- gsutil cp $STAGING/EasyDEX-GUI/$CI_COMMIT_REF_NAME/$EASYDEX_GUI_BUILD . ||
echo "No builds found in $CI_COMMIT_REF_NAME branch, fetching from $DEFAULT_EASYDEXGUI_BRANCH branch" &&
gsutil cp $STAGING/EasyDEX-GUI/$DEFAULT_EASYDEXGUI_BRANCH/$EASYDEX_GUI_BUILD .
- tar -xzf $EASYDEX_GUI_BUILD --directory gui/EasyDEX-GUI/react &&
rm $EASYDEX_GUI_BUILD
- echo "fetching builds from VerusCoin:$CLI_BRANCH" &&
gsutil cp $STAGING/VerusCoin/$CLI_BRANCH/Windows/$VERUS_CLI_WINDOWS . ||
echo "No matching artifacts found in $CLI_BRANCH branch, fetching from $DEFAULT_CLI_BRANCH branch" &&
gsutil cp $STAGING/VerusCoin/$DEFAULT_CLI_BRANCH/Windows/$VERUS_CLI_WINDOWS .
- mkdir -p assets/bin/
- unzip -qq $VERUS_CLI_WINDOWS -d assets/bin/
- rm $VERUS_CLI_WINDOWS
- mv assets/bin/verus-cli assets/bin/win64
script:
- npm install electron-packager -g
- npm install electron -g --unsafe-perm=true
- npm install
- ./buildscripts/electron-build-windows.sh
- cd build
- zip -r $AGAMA_WINDOWS_PORTABLE $ELECTRON_BUILD_WINDOWS
- mv $AGAMA_WINDOWS_PORTABLE ..
- npm install electron-packager -g
- npm install electron -g --unsafe-perm=true
- npm install
- npm run package-win
- cd build
- zip -r $AGAMA_WINDOWS $ELECTRON_BUILD_WINDOWS
- mv $AGAMA_WINDOWS ..
artifacts:
paths:
- $AGAMA_WINDOWS_PORTABLE
paths: [$AGAMA_WINDOWS]
expire_in: 1 week


build:mac:
stage: build
image: asherd/agama-builder
tags: ["High Sierra"]
before_script:
- echo "$AUTH_KEY" > AUTH_KEY.json
- gcloud auth activate-service-account --key-file AUTH_KEY.json
- rm AUTH_KEY.json
- gsutil cp $STAGING/EasyDEX-GUI/$CI_COMMIT_REF_NAME/$EASYDEX_GUI_ARTIFACT . || gsutil cp $STAGING/EasyDEX-GUI/master/$EASYDEX_GUI_ARTIFACT .
- tar -xzf $EASYDEX_GUI_ARTIFACT --directory gui/EasyDEX-GUI/react
- rm $EASYDEX_GUI_ARTIFACT
- gsutil cp $STAGING/VerusCoin/$CI_COMMIT_REF_NAME/MacOS/$AGAMA_ARTIFACTS_MACOS . || gsutil cp $STAGING/VerusCoin/master/MacOS/$AGAMA_ARTIFACTS_MACOS .
- mkdir -p assets/bin/
- tar -xzf $AGAMA_ARTIFACTS_MACOS --directory assets/bin/
- rm $AGAMA_ARTIFACTS_MACOS

script:
- npm install electron-packager -g
- npm install electron -g --unsafe-perm=true
- npm install
- ./buildscripts/electron-build-osx.sh
- cd build
- tar -czf $AGAMA_OSX_PORTABLE $ELECTRON_BUILD_OSX
- mv $AGAMA_OSX_PORTABLE ..
- if [ -z "${VERUS_CLI_MACOS}" ]; then export VERUS_CLI_MACOS="Verus-CLI-MacOS-v${AGAMA_VERSION}-beta.tar.gz"; fi
- if [ -z "${UPSTREAM_CLI_BRANCH}" ]; then export CLI_BRANCH=$CI_COMMIT_REF_NAME; else export CLI_BRANCH=$UPSTREAM_CLI_BRANCH; fi
- gsutil cp $STAGING/EasyDEX-GUI/$CI_COMMIT_REF_NAME/$EASYDEX_GUI_BUILD . ||
echo "No builds found in $CI_COMMIT_REF_NAME branch, fetching from $DEFAULT_EASYDEXGUI_BRANCH" &&
gsutil cp $STAGING/EasyDEX-GUI/$DEFAULT_EASYDEXGUI_BRANCH/$EASYDEX_GUI_BUILD .
- tar -xzf $EASYDEX_GUI_BUILD --directory gui/EasyDEX-GUI/react &&
rm $EASYDEX_GUI_BUILD
- echo "fetching builds from VerusCoin:$CLI_BRANCH" &&
gsutil cp $STAGING/VerusCoin/$CLI_BRANCH/MacOS/$VERUS_CLI_MACOS . ||
echo "No matching artifacts found in $CLI_BRANCH branch, fetching from $DEFAULT_VERUSCOIN_BRANCH branch" &&
gsutil cp $STAGING/VerusCoin/$DEFAULT_CLI_BRANCH/MacOS/$VERUS_CLI_MACOS .
- mkdir -p assets/bin/
- tar -xzf $VERUS_CLI_MACOS --directory assets/bin/
- rm $VERUS_CLI_MACOS
- mv assets/bin/verus-cli assets/bin/osx
script:
- npm install
- npm install electron-packager -g
- npm run package-mac
- npm run create-installer-mac
artifacts:
paths:
- $AGAMA_OSX_PORTABLE
paths: [$AGAMA_MACOS.dmg]
expire_in: 1 week



.test:
stage: test
image: node:8.11.3
script:
- npm install
- npm test


deploy:
Expand All @@ -120,13 +126,34 @@ deploy:
- build:linux
- build:windows
- build:mac
before_script:
- export AGAMA_LINUX_MD5=$(md5sum $AGAMA_LINUX | cut -d " " -f 1)
- export AGAMA_WINDOWS_MD5=$(md5sum $AGAMA_WINDOWS | cut -d " " -f 1)
- export AGAMA_MACOS_MD5=$(md5sum $AGAMA_MACOS.dmg | cut -d " " -f 1)
script:
- curl -F file=@"$AGAMA_LINUX"
-F channels="$AGAMA_POST_CHANNEL"
-F initial_comment="${POST_COMMENT} $AGAMA_LINUX_MD5"
-H "${SLACK_BOT_AUTH}"
"https://slack.com/api/files.upload"
- curl -F file=@"$AGAMA_WINDOWS"
-F channels="$AGAMA_POST_CHANNEL"
-F initial_comment="${POST_COMMENT} $AGAMA_WINDOWS_MD5"
-H "${SLACK_BOT_AUTH}"
"https://slack.com/api/files.upload"
- curl -F file=@"$AGAMA_MACOS.dmg"
-F channels="$AGAMA_POST_CHANNEL"
-F initial_comment="${POST_COMMENT} $AGAMA_MACOS_MD5"
-H "${SLACK_BOT_AUTH}"
"https://slack.com/api/files.upload"
- mkdir -p $CI_COMMIT_REF_NAME/Windows
- mkdir -p $CI_COMMIT_REF_NAME/Linux
- mkdir -p $CI_COMMIT_REF_NAME/MacOS
- mv $AGAMA_LINUX_PORTABLE $CI_COMMIT_REF_NAME/Linux
- mv $AGAMA_WINDOWS_PORTABLE $CI_COMMIT_REF_NAME/Windows
- mv $AGAMA_OSX_PORTABLE $CI_COMMIT_REF_NAME/MacOS
- mv $AGAMA_LINUX $CI_COMMIT_REF_NAME/Linux
- mv $AGAMA_WINDOWS $CI_COMMIT_REF_NAME/Windows
- mv $AGAMA_MACOS.dmg $CI_COMMIT_REF_NAME/MacOS
- echo $AUTH_KEY > AUTH_KEY.json
- gcloud auth activate-service-account --key-file AUTH_KEY.json
- gsutil rsync -r $CI_COMMIT_REF_NAME $STAGING/Agama/$CI_COMMIT_REF_NAME/


81 changes: 0 additions & 81 deletions .travis.yml

This file was deleted.

Binary file added assets/backgrounds/trianglify-8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions buildscripts/electron-build-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ electron-packager . --platform=linux --arch=x64 \
--ignore=version_build \
--prune=true \
--overwrite \
--buildVersion="$AGAMA_VERSION"-beta \
--version-string.CompanyName="VerusCoin" \
--version-string.FileDescription="Agama" \
--version-string.OriginalFilename="Agama" \
Expand Down
2 changes: 2 additions & 0 deletions buildscripts/electron-build-osx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ electron-packager . --platform=darwin \
--arch=x64 \
--icon=assets/icons/agama_app_icon.icns \
--out=build/ \
--ignore=Verus* \
--ignore=assets/bin/win64 \
--ignore=assets/bin/linux64 \
--ignore=react/node_modules \
Expand All @@ -27,6 +28,7 @@ electron-packager . --platform=darwin \
--ignore=version_build \
--prune=true \
--overwrite \
--buildVersion="$AGAMA_VERSION"-beta \
--version-string.CompanyName="VerusCoin" \
--version-string.FileDescription="Agama" \
--version-string.OriginalFilename="Agama" \
Expand Down
2 changes: 2 additions & 0 deletions buildscripts/electron-build-windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ electron-packager . --platform=win32 \
--arch=x64 \
--icon=assets/icons/agama_app_icon.ico \
--out=build/ \
--ignore=Verus* \
--ignore=assets/bin/osx \
--ignore=assets/bin/linux64 \
--ignore=react/node_modules \
Expand All @@ -27,6 +28,7 @@ electron-packager . --platform=win32 \
--ignore=version_build \
--prune=true \
--overwrite \
--buildVersion="$AGAMA_VERSION"-beta \
--version-string.CompanyName="VerusCoin" \
--version-string.FileDescription="Agama" \
--version-string.OriginalFilename="Agama" \
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@
"make-rpm": "node make-rpm.js",
"make-deb": "node make-deb.js",
"test": "mocha",
"package-mac": "electron-packager . agama --platform=darwin --arch=x64 --icon=assets/icons/agama_icons/agama_app_icon.icns --prune=true ---buildVersion=0.4.0-beta --out=build/ --ignore=assets/bin/win64 --ignore=assets/bin/linux64 --overwrite",
"package-win": "electron-packager . agama --overwrite --asar=true --platform=win32 --arch=x64 --icon=assets/icons/agama_icons/agama_app_icon.ico --out=build/ --buildVersion=0.4.0-beta --ignore=assets/bin/osx --ignore=assets/bin/linux64 --overwrite"
"package-linux": "./buildscripts/electron-build-linux.sh",
"package-mac": "./buildscripts/electron-build-osx.sh",
"package-win": "./buildscripts/electron-build-windows.sh",
"create-installer-mac": "electron-installer-dmg build/$ELECTRON_BUILD_MACOS/Agama.app $AGAMA_MACOS --icon=assets/icons/agama_icons/agama_app_icon.icns"
},
"repository": "https://github.com/KomodoPlatform/Agama/",
"homepage": "http://komodoplatform.com",
Expand Down
4 changes: 2 additions & 2 deletions routes/shepherd/electrum/keys.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module.exports = (shepherd) => {
pub: key.getAddress(),
priv: key.toWIF(),
};
}
};

shepherd.seedToWif = (seed, network, iguana) => {
let bytes;
Expand Down Expand Up @@ -68,7 +68,7 @@ module.exports = (shepherd) => {
shepherd.log(`seedtowif pub key ${keys.pub}`, true);*/

return keys;
}
};

shepherd.get('/electrum/wiftopub', (req, res, next) => {
if (shepherd.checkToken(req.query.token)) {
Expand Down
Loading

0 comments on commit e05f6b6

Please sign in to comment.