From f17331151a6abb0b835465e0913c34db37c87489 Mon Sep 17 00:00:00 2001 From: Keijo Raamat Date: Thu, 30 Sep 2021 15:03:13 +0300 Subject: [PATCH] create tag with python --- .github/workflows/build_base_image.yml | 29 ++++++++++++-------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build_base_image.yml b/.github/workflows/build_base_image.yml index dd0eb85..8a6f88a 100644 --- a/.github/workflows/build_base_image.yml +++ b/.github/workflows/build_base_image.yml @@ -16,23 +16,20 @@ jobs: - uses: actions/checkout@v2 - name: Set image tag - shell: bash + shell: python run: | - IFS=$'\n' - read -d '' -r -a lines < .tool-versions - erlang_line="${lines[0]}" - ruby_line="${lines[1]}" - echo $erlang_line - echo $ruby_line - echo 'HERE 1' - erlang=(${erlang_line// / }) - echo $erlang - echo 'HERE 2' - ruby=(${ruby_line// / }) - ERLANG_VER=${erlang[1]} - RUBY_VER=${ruby[1]} - echo $ERLANG_VER - echo "TAG=internetee/erlang-ruby:'$ERLANG_VER'-'$RUBY_VER'" >> $GITHUB_ENV + import os + versions = {} + try: + with open(".tool-versions", "r") as f: + for line in f: + (key, val) = line.split() + versions[key] = val + except: + print("Something is not right") + print("internetee/erlang-ruby:" + versions["erlang"] + "-" + versions["ruby"]) + print(os.environ["GITHUB_ENV"]) + #echo "TAG=internetee/erlang-ruby:'$ERLANG_VER'-'$RUBY_VER'" >> $GITHUB_ENV - name: Build image run: |