Skip to content

Commit

Permalink
Mac OS fix (#30)
Browse files Browse the repository at this point in the history
* fix Mac OS bugs

* fix tutorial paths

* fix sed issue on mac

* bump version to 0.2.0b1
  • Loading branch information
daigotanaka authored Aug 6, 2020
1 parent 03ef42b commit 2eed133
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 11 deletions.
6 changes: 6 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
## History

### 0.2.0b1 (2020-08-05)

- Mac OS: fix a bug in parsing Docker build JSON log
- Mac OS: fix sed -u issue
- Fix typos in tutorial

### 0.2.0b0 (2020-08-05)

- Beta
Expand Down
2 changes: 1 addition & 1 deletion handoff/config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION = "0.2.0b0"
VERSION = "0.2.0b1"

import os, re
from handoff import utils
Expand Down
12 changes: 8 additions & 4 deletions handoff/services/container/docker/impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,13 @@ def build(project_dir, new_version=None, docker_file=None, nocache=False):
for line in cli.build(path=build_dir,
tag=image_name + ":" + new_version,
nocache=nocache):
msg = json.loads(line.decode("utf-8"))
if msg.get("stream") and msg["stream"] != "\n":
logger.info(msg["stream"])
for subline in line.decode("utf-8").split("\n"):
try:
msg = json.loads(subline)
except json.decoder.JSONDecodeError:
continue
if msg.get("stream") and msg["stream"] != "\n":
logger.info(msg["stream"])


def run(version=None, extra_env=dict()):
Expand Down Expand Up @@ -138,7 +142,7 @@ def push(username, password, registry, version=None):
version, stream=True):
try:
msg = json.loads(line.decode("utf-8"))
except Exception:
except json.decoder.JSONDecodeError:
continue
total = 0
current = 0
Expand Down
2 changes: 1 addition & 1 deletion handoff/test_projects/scripts/aws_get_started/06_fargate
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ At the bottom of the page, you see:
| Name | Container Runtime ID | Status | Image | ..... |
| :---------------- | :------------------- | :----------- | :---- | :---- |
| singer_excha... | 1371.... | PROVISIONING | xxxxx | ..... |
| singer_excha... | 1371.... | PROVISIONING | xxxxx | ..... |
Expand the section by clicking on a dark side-way trible ">" by the Task name.
Expand Down
8 changes: 4 additions & 4 deletions handoff/test_projects/scripts/funcs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ Run() {
if [[ -z $2 ]]; then STYLE=$DIM; else STYLE=$2; fi
if [[ ! -z $3 ]];then h=$3; else if [[ ! -z $HEADTAIL_LIMIT ]]; then h=$HEADTAIL_LIMIT; else h=0; fi; fi
if [[ ! $MODE = "auto" ]]; then echo -e $STYLE$QUOTE; else echo $BEGINQUOTE; echo; fi
if [[ $h -lt 1 ]]; then eval "$1"; else eval "$1" | (sed -u ${h}q; t=`tail -n $h`; if [[ `echo "$t" | wc -l` -gt 1 ]]; then echo .; echo .; echo .; echo "$t"; fi); fi
if [[ $h -lt 1 ]]; then eval "$1"; else eval "$1" | (head -n ${h}; t=`tail -n $h`; if [[ `echo "$t" | wc -l` -gt 1 ]]; then echo .; echo .; echo .; echo "$t"; fi); fi
# if [[ $h -lt 1 ]]; then eval "$1"; else eval "$1" | (sed -u ${h}q; t=`tail -n $h`; if [[ `echo "$t" | wc -l` -gt 1 ]]; then echo .; echo .; echo .; echo "$t"; fi); fi
if [[ ! $MODE = "auto" ]]; then echo -e $QUOTE$RESET; else echo $QUOTE; fi
}

Expand Down Expand Up @@ -90,7 +91,6 @@ fi
Choose() {
echo $1
IFS=$'\n' read -r -d '' -a OPTIONS < <( eval $1 )
# IFS=$'\n' read -r -d '' -a OPTIONS < <( ls $PROJECT_DIR/scripts | grep -v funcs && printf '\0' )
i=1
for s in ${OPTIONS[@]}; do echo "- [$i] $s"; i=$((i+1)); done

Expand Down Expand Up @@ -118,7 +118,7 @@ if [[ ! $REPLY =~ ^[Nn]$ ]]
then
echo "OK!"
echo
$PROJECT_DIR/scripts/03_set_up_aws_account
scripts/aws_get_started/03_set_up_aws_account
exit 0
fi
fi
Expand Down Expand Up @@ -169,7 +169,7 @@ if [[ $REPLY =~ ^[Nn]$ ]]
then
echo "OK!"
echo "Remember that you can continue by"
echo -e $GREEN $PROJECT_DIR/begin$RESET
echo -e $GREEN ./projects/start$RESET
echo
echo "bye!"
exit 0
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python
from setuptools import setup

VERSION="0.2.0b0"
VERSION="0.2.0b1"

with open("README.md", "r") as fh:
long_description = fh.read()
Expand Down

0 comments on commit 2eed133

Please sign in to comment.