Skip to content

Commit

Permalink
Merge pull request #36 from FactomProject/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
carryforward committed Sep 17, 2019
2 parents 7819099 + 83f4500 commit 75a5a54
Show file tree
Hide file tree
Showing 48 changed files with 1,505 additions and 5,567 deletions.
106 changes: 81 additions & 25 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ jobs:
working_directory: /go/src/github.com/FactomProject/enterprise-wallet

docker:
- image: docker:17.06.0-ce-git
- image: factominc/elixir_python

steps:
- checkout
Expand Down Expand Up @@ -177,42 +177,73 @@ jobs:
docker build -t enterprise-wallet-alpine -f Dockerfile.alpine .
docker build -t enterprise-wallet -f Dockerfile .
# Push, depending on branch/tag
- run:
name: Push master / develop to DockerHub
command: |
# Login to DockerHub
docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
if [ "${CIRCLE_BRANCH}" == "master" ]; then
# If there is a tag, use it
if [ "$CIRCLE_TAG" != "" ]; then
docker tag enterprise-wallet factominc/enterprise-wallet:${CIRCLE_TAG}
docker push factominc/enterprise-wallet:${CIRCLE_TAG}
docker tag enterprise-wallet-alpine factominc/enterprise-wallet:${CIRCLE_TAG}-alpine
docker push factominc/enterprise-wallet:${CIRCLE_TAG}-alpine
fi
# If there is a tag, use it
if [ "$CIRCLE_TAG" != "" ]; then
docker tag enterprise-wallet-alpine factominc/enterprise-wallet:${TAG}-alpine
docker push factominc/enterprise-wallet:${TAG}-alpine
docker tag enterprise-wallet factominc/enterprise-wallet:${TAG}
docker push factominc/enterprise-wallet:${TAG}
fi
if [ "${CIRCLE_BRANCH}" == "master" ]; then
# But tag it as alpine/latest anyhow
docker tag enterprise-wallet-alpine factominc/enterprise-wallet:alpine
docker push factominc/enterprise-wallet:alpine
# Tag master as latest
docker tag enterprise-wallet factominc/enterprise-wallet:latest
docker push factominc/enterprise-wallet:latest
docker tag enterprise-wallet-alpine factominc/enterprise-wallet:alpine
docker push factominc/enterprise-wallet:alpine
fi
elif [ "${CIRCLE_BRANCH}" == "develop" ]; then
# If there is a tag, use it
if [ "$CIRCLE_TAG" != "" ]; then
docker tag enterprise-wallet-alpine factominc/enterprise-wallet:${TAG}-alpine-develop
docker push factominc/enterprise-wallet:${TAG}-alpine-develop
docker tag enterprise-wallet factominc/enterprise-wallet:${TAG}-develop
docker push factominc/enterprise-wallet:${TAG}-develop
fi
if [ "${CIRCLE_BRANCH}" == "develop" ]; then
# But tag it as alpine-develop/develop anyhow
docker tag enterprise-wallet-alpine factominc/enterprise-wallet:alpine-develop
docker push factominc/enterprise-wallet:alpine-develop
# Tag develop as develop anyhow
docker tag enterprise-wallet factominc/enterprise-wallet:develop
docker push factominc/enterprise-wallet:develop
docker tag enterprise-wallet-alpine factominc/enterprise-wallet:alpine-develop
docker push factominc/enterprise-wallet:alpine-develop
fi
docker logout
- run:
name: Push images to AWS ECR
command: |
# Login to AWS ECR
login="$(aws ecr get-login --no-include-email --region $AWS_REGION)"
${login}
# If there is a tag, use it
if [ "$CIRCLE_TAG" != "" ]; then
docker tag enterprise-wallet ${AWS_REPO_BASE_URI}/enterprise-wallet:${CIRCLE_TAG}
docker push ${AWS_REPO_BASE_URI}/enterprise-wallet:${CIRCLE_TAG}
docker tag enterprise-wallet-alpine ${AWS_REPO_BASE_URI}/enterprise-wallet:${CIRCLE_TAG}-alpine
docker push ${AWS_REPO_BASE_URI}/enterprise-wallet:${CIRCLE_TAG}-alpine
fi
if [ "${CIRCLE_BRANCH}" == "master" ]; then
# Tag master as latest
docker tag enterprise-wallet ${AWS_REPO_BASE_URI}/enterprise-wallet:latest
docker push ${AWS_REPO_BASE_URI}/enterprise-wallet:latest
docker tag enterprise-wallet-alpine ${AWS_REPO_BASE_URI}/enterprise-wallet:alpine
docker push ${AWS_REPO_BASE_URI}/enterprise-wallet:alpine
fi
if [ "${CIRCLE_BRANCH}" == "develop" ]; then
# Tag develop as develop anyhow
docker tag enterprise-wallet ${AWS_REPO_BASE_URI}/enterprise-wallet:develop
docker push ${AWS_REPO_BASE_URI}/enterprise-wallet:develop
docker tag enterprise-wallet-alpine ${AWS_REPO_BASE_URI}/enterprise-wallet:alpine-develop
docker push ${AWS_REPO_BASE_URI}/enterprise-wallet:alpine-develop
fi
docker logout
Expand Down Expand Up @@ -243,14 +274,39 @@ workflows:
version: 2
build:
jobs:
- build
- build:
filters:
tags:
only: /.*/
- test:
filters:
tags:
only: /.*/
requires:
- build
- coveralls:
filters:
tags:
only: /.*/
requires:
- test
- docker_build:
filters:
tags:
only: /.*/
context: org-global
requires:
- test

scheduled-workflow:
triggers:
- schedule:
cron: "0 5 * * *"
filters:
branches:
only: develop
jobs:
- build
- test:
requires:
- build
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Don't copy the glide vendor directory
vendor
12 changes: 10 additions & 2 deletions display.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,7 @@ func HandleGETRequests(w http.ResponseWriter, r *http.Request) {
w.Write(jsonError("Error occurred"))
case "related-transactions":
if on, server := MasterWallet.FactomdOnline(); !on {
errorMsg := fmt.Sprintf("Unable to connect to factomd instance. The wallet is at '%s' for it's factomd instance. If this is set locally "+
"you must download the latest factomd and run it until it is synced", server)
errorMsg := fmt.Sprintf("Unable to connect to the factomd instance. Make sure there is an active, fully synced factomd at %s", server)
w.Write(jsonError(errorMsg))
return
}
Expand Down Expand Up @@ -666,6 +665,8 @@ func HandlePOSTRequests(w http.ResponseWriter, r *http.Request) {
r.Name = name
w.Write(jsonResp(r))
case "send-transaction":
MasterWallet.BalanceCache.Clear()

trans := new(SendTransStruct)

jsonElement := r.FormValue("json")
Expand Down Expand Up @@ -713,6 +714,13 @@ func HandlePOSTRequests(w http.ResponseWriter, r *http.Request) {
MasterSettings.CoinControl = st.Bools[2]
MasterSettings.ImportExport = st.Bools[3]

if loc, err := SanitizeFactomdLocation(st.FactomdLocation); err != nil {
w.Write(jsonError(err.Error()))
return
} else {
st.FactomdLocation = loc
}

fdChange := false
if len(st.FactomdLocation) > 0 && st.FactomdLocation != MasterSettings.FactomdLocation {
MasterSettings.FactomdLocation = st.FactomdLocation
Expand Down
6 changes: 3 additions & 3 deletions display_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ func TestSendEntryCreditsTransaction(t *testing.T) {
err = json.Unmarshal(data, respR)
if err != nil || respR.Error != "none" {

t.Errorf("Error occured making transaction, %s", respR)
t.Errorf("Error occured making transaction, %v", respR)
} else {
// lets send it
data, _ = handlePostRequestHelper("send-transaction", jsonToSend)
Expand Down Expand Up @@ -419,7 +419,7 @@ func TestSendEntryCreditsTransaction(t *testing.T) {
}

if fail {
t.Errorf("ECBuy: Tried %d times -- Balance is incorrect. Balance found is: %f, it should be %d\n CurrAmt: %d, TotalAdded: %d", trys, respA.Content.Balance, totalSent+currAmt, currAmt, totalSent)
t.Errorf("ECBuy: Tried %d times -- Balance is incorrect. Balance found is: %d, it should be %d\n CurrAmt: %d, TotalAdded: %d", trys, respA.Content.Balance, totalSent+currAmt, currAmt, totalSent)
}
}

Expand Down Expand Up @@ -487,7 +487,7 @@ func TestConstructTransaction(t *testing.T) {
data, _ = handlePostRequestHelper("make-transaction", jsonToSend)
err = json.Unmarshal(data, respR)
if err != nil || respR.Error != "none" {
t.Errorf("Error occured making transaction, %s", respR)
t.Errorf("Error occured making transaction, %v", respR)
} else {
if sts.TransType == "nosig" {
continue
Expand Down
2 changes: 1 addition & 1 deletion electron-wrapper/app/choose.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ body {
}

button {
width: 50%%;
width: 50%;
background-color: #4CAF50;
color: white;
padding: 14px 20px;
Expand Down
3 changes: 3 additions & 0 deletions electron-wrapper/app/loading/css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -826,3 +826,6 @@ aside.light-theme footer .wallet-type .wallet-icon img {
.pointer {
cursor: pointer;
}
.home .logo img, .loading .logo img {
height: 59px;
}

0 comments on commit 75a5a54

Please sign in to comment.