From 2f7c34f646fc22a7cfe07cf3ad38e836f92c015e Mon Sep 17 00:00:00 2001
From: Recolic K <bensl@microsoft.com>
Date: Wed, 8 Jun 2022 15:34:25 +0800
Subject: [PATCH] new smb url format

---
 README.md    |  4 ++--
 antidote-cis | 10 ++++++----
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/README.md b/README.md
index dd407b4..d1636fb 100644
--- a/README.md
+++ b/README.md
@@ -21,13 +21,13 @@ Just copy `antidote-cis` and `antidote.config.sh` to your PATH. It's usually `/u
 
 ### 2 - Read and modify config file
 
-Read and modify `antidote.config.sh`. You must set `cis_cookie` and `smb_namespace`, and you may also want to modify `cis_namespace`, `cis_default_workflow_name`, `cis_default_workflow_parameter` to yours. 
+Read and modify `antidote.config.sh`. You **must** set `cis_cookie` or `cis_bearer` to access CIS API. You may also want to set `cis_namespace`, `cis_default_workflow_name`, `cis_default_workflow_parameter`, `smb_*` to your own value. 
 
 If you're familiar to CIS, you should know how to set them.
 
 ### 3 - Ready for use
 
-Please run `antidote-cis` to read help message before using. Also fully read this README to avoid misunderstanding. 
+You **must run** `antidote-cis` to read help message before using. It's also suggested to go through this README to avoid misunderstanding. 
 
 ## FAQ
 
diff --git a/antidote-cis b/antidote-cis
index 90b5429..514087e 100755
--- a/antidote-cis
+++ b/antidote-cis
@@ -51,6 +51,8 @@ function upload_to_smb_share () {
     local_wf_dir="$2"
 
     # if local_wf_dir is already a samba url, we do nothing and return. 
+    [[ "${local_wf_dir:0:6}" = smb:// ]] && echo "${local_wf_dir:4}" && return 0
+    # TODO: Deprecate the old confusing format in the future. 
     [[ "${local_wf_dir:0:2}" = \\\\ ]] || [[ "${local_wf_dir:0:2}" = // ]] && echo "$local_wf_dir" && return 0
 
     # The workflow builder should copy all xaml file to there. 
@@ -346,7 +348,7 @@ function subcmd_xmldownload () {
 }
 
 # Initialization
-antidote_version="1.1.10"
+antidote_version="1.1.11"
 subcmd="$1"
 shift
 
@@ -390,7 +392,7 @@ Antidote-CIS version $antidote_version, maintained by Recolic Keghart <root@reco
 
 Usage:
        $0 push path/to/your/workflow/dir [BootstrapCAWorkflow] [v4.1.1]
-       $0 push //existing-samba-share/your/workflow/dir [BootstrapCAWorkflow] [v4.1.1]
+       $0 push smb://YOUR_HOSTNAME/shared_folder/your/workflow/dir [BootstrapCAWorkflow] [v4.1.1]
        $0 push cis:// [BootstrapCAWorkflow] [v4.1.1]
        $0 release [BootstrapCAWorkflow] [v4.1.1]
        $0 setdef [BootstrapCAWorkflow] [v4.1.1]
@@ -421,8 +423,8 @@ The workflow_parameters in command line would overwrite workflow_parameters in a
 
 Examples: 
 antidote-cis push ../bin/net472 BootstrapCAWorkflow
-antidote-cis push //reddog/builds/branches/git_azure_deployment_builder_master/1.11/MyWorkflow MyWorkflow 1.11
-antidote-cis push //RECOLICPC/mybuild
+antidote-cis push smb://reddog/builds/branches/git_azure_deployment_builder_master/1.11/MyWorkflow MyWorkflow 1.11
+antidote-cis push smb://RECOLICPC/mybuild
 antidote-cis setdef BootstrapCAWorkflow
 antidote-cis cloudrun BootstrapCAWorkflow
 antidote-cis cloudrun BuildDomainControllerWorkflow jihyan.9.24.2 IsFirstDC=true UserNameKey=unkey PasswordKey=pwkey @SubscriptionId=420f71ab-35f2-4550-9de6-7c8fab764b4d @Region=westus2
-- 
GitLab