Skip to content

Commit

Permalink
[Python] python track1 new pipeline (#16489)
Browse files Browse the repository at this point in the history
* exception handle and encode problem

* Update autorest_tools.py
  • Loading branch information
msyyc authored Mar 5, 2021
1 parent 561abe2 commit c891c27
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
19 changes: 13 additions & 6 deletions scripts/automation_generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,19 @@ sudo npm install -g n
sudo n 10.15.0
export PATH=/usr/local/n/versions/node/10.15.0/bin:$PATH

# generate code and package
python -m packaging_tools.auto_codegen "$1" "$TMPDIR/venv-sdk/auto_temp.json" 2>&1
TEMP_FILE="$TMPDIR/venv-sdk/auto_temp.json"
# generate code
python -m packaging_tools.auto_codegen "$1" "$TEMP_FILE" 2>&1
echo "[Generate] codegen done!!!"
python -m packaging_tools.auto_package "$TMPDIR/venv-sdk/auto_temp.json" "$2" 2>&1
echo "[Generate] generate done!!!"
if [ ! -f "$TEMP_FILE" ]; then
echo "[Autorest]$TEMP_FILE does not exist!!!Error happened during codegen"
exit 1
fi

# package
python -m packaging_tools.auto_package "$TEMP_FILE" "$2" 2>&1
echo "[Generate] generate done!!!"
if [ ! -f "$2" ]; then
echo "[Autorest]$2 does not exist!!!"
fi
echo "[Autorest]$2 does not exist!!!Error happened during package"
exit 1
fi
2 changes: 0 additions & 2 deletions tools/azure-sdk-tools/packaging_tools/auto_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ def change_log_generate(package_name):
def main(generate_input, generate_output):
with open(generate_input, "r") as reader:
data = json.load(reader)
if not data:
return

sdk_folder = '.'
result = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import shutil
import subprocess


_LOGGER = logging.getLogger(__name__)


Expand Down Expand Up @@ -130,7 +129,8 @@ def execute_simple_command(cmd_line, cwd=None, shell=False, env=None):
universal_newlines=True,
cwd=cwd,
shell=shell,
env=env)
env=env,
encoding='utf-8')
output_buffer = []
for line in process.stdout:
output_buffer.append(line.rstrip())
Expand Down

0 comments on commit c891c27

Please sign in to comment.