You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by li...@apache.org on 2023/05/11 03:10:19 UTC
[skywalking-go] branch main updated: Fix container name inconsistency in file scenarios.tpl (#28)
This is an automated email from the ASF dual-hosted git repository.
liuhan pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/skywalking-go.git
The following commit(s) were added to refs/heads/main by this push:
new a2c5f8e Fix container name inconsistency in file scenarios.tpl (#28)
a2c5f8e is described below
commit a2c5f8e6746836e4d800feda1934a049c03385bf
Author: zheheBao <84...@users.noreply.github.com>
AuthorDate: Thu May 11 11:10:14 2023 +0800
Fix container name inconsistency in file scenarios.tpl (#28)
---
test/plugins/runner-helper/templates/scenarios.tpl | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/test/plugins/runner-helper/templates/scenarios.tpl b/test/plugins/runner-helper/templates/scenarios.tpl
index 0780f23..eb752d2 100644
--- a/test/plugins/runner-helper/templates/scenarios.tpl
+++ b/test/plugins/runner-helper/templates/scenarios.tpl
@@ -18,9 +18,20 @@
set -ex
+compose_version=$(docker-compose version --short)
+
+if [[ $compose_version =~ ^(v)?1 ]]; then
+ separator="_"
+elif [[ $compose_version =~ ^(v)?2 ]]; then
+ separator="-"
+else
+ echo "Unsupported Docker Compose version: $compose_version"
+ exit 1
+fi
+
project_name=$(echo "{{.Context.ScenarioName}}" |sed -e "s/\.//g" |awk '{print tolower($0)}')
-service_container_name="${project_name}_service_1"
-validator_container_name="${project_name}_validator_1"
+service_container_name="${project_name}${separator}service${separator}1"
+validator_container_name="${project_name}${separator}validator${separator}1"
docker-compose -p "${project_name}" -f "{{.DockerComposeFilePath}}" up -d --build
sleep 3