Skip to content

Commit 4fe736e

Browse files
committed
Modified syntax to kubernetes v14.0 CLI
1 parent c51eee2 commit 4fe736e

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

samples/features/sql-big-data-cluster/bootstrap-sample-db.cmd

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ if NOT EXIST tpcxbb_1gb.bak (
3636

3737
REM Copy the backup file, restore the database, create necessary objects and data file
3838
echo Copying sales database backup file to SQL Master instance...
39-
%DEBUG% kubectl cp tpcxbb_1gb.bak mssql-master-pool-0:/var/opt/mssql/data -c mssql-server -n %CLUSTER_NAMESPACE% || goto exit
39+
%DEBUG% kubectl cp tpcxbb_1gb.bak %CLUSTER_NAMESPACE%/mssql-master-pool-0:/var/opt/mssql/data -c mssql-server || goto exit
4040

4141
REM Download and copy the sample backup files
4242
if /i %AW_WWI_SAMPLES% EQU --install-extra-samples (
@@ -45,36 +45,36 @@ if /i %AW_WWI_SAMPLES% EQU --install-extra-samples (
4545
%DEBUG% curl -L -G "https://github.com/Microsoft/sql-server-samples/releases/download/adventureworks/AdventureWorks2016_EXT.bak" -o AdventureWorks2016_EXT.bak
4646
)
4747
echo Copying AdventureWorks2016_EXT database backup file to SQL Master instance...
48-
%DEBUG% kubectl cp AdventureWorks2016_EXT.bak mssql-master-pool-0:/var/opt/mssql/data -c mssql-server -n %CLUSTER_NAMESPACE% || goto exit
48+
%DEBUG% kubectl cp AdventureWorks2016_EXT.bak %CLUSTER_NAMESPACE%/mssql-master-pool-0:/var/opt/mssql/data -c mssql-server || goto exit
4949

5050
if NOT EXIST AdventureWorksDW2016_EXT.bak (
5151
echo Downloading AdventureWorksDW2016_EXT sample database backup file...
5252
%DEBUG% curl -L -G "https://github.com/Microsoft/sql-server-samples/releases/download/adventureworks/AdventureWorksDW2016_EXT.bak" -o AdventureWorksDW2016_EXT.bak
5353
)
5454
echo Copying AdventureWorksDW2016_EXT database backup file to SQL Master instance...
55-
%DEBUG% kubectl cp AdventureWorksDW2016_EXT.bak mssql-master-pool-0:/var/opt/mssql/data -c mssql-server -n %CLUSTER_NAMESPACE% || goto exit
55+
%DEBUG% kubectl cp AdventureWorksDW2016_EXT.bak %CLUSTER_NAMESPACE%/mssql-master-pool-0:/var/opt/mssql/data -c mssql-server || goto exit
5656

5757
if NOT EXIST WideWorldImporters-Full.bak (
5858
echo Downloading WideWorldImporters sample database backup file...
5959
%DEBUG% curl -L -G "https://github.com/Microsoft/sql-server-samples/releases/download/wide-world-importers-v1.0/WideWorldImporters-Full.bak" -o WideWorldImporters-Full.bak
6060
)
6161
echo Copying WideWorldImporters-Full database backup file to SQL Master instance...
62-
%DEBUG% kubectl cp WideWorldImporters-Full.bak mssql-master-pool-0:/var/opt/mssql/data -c mssql-server -n %CLUSTER_NAMESPACE% || goto exit
62+
%DEBUG% kubectl cp WideWorldImporters-Full.bak %CLUSTER_NAMESPACE%/mssql-master-pool-0:/var/opt/mssql/data -c mssql-server || goto exit
6363

6464
if NOT EXIST WideWorldImportersDW-Full.bak (
6565
echo Downloading WideWorldImportersDW sample database backup file...
6666
%DEBUG% curl -L -G "https://github.com/Microsoft/sql-server-samples/releases/download/wide-world-importers-v1.0/WideWorldImportersDW-Full.bak" -o WideWorldImportersDW-Full.bak
6767
)
6868
echo Copying WideWorldImportersDW-Full database backup file to SQL Master instance...
69-
%DEBUG% kubectl cp WideWorldImportersDW-Full.bak mssql-master-pool-0:/var/opt/mssql/data -c mssql-server -n %CLUSTER_NAMESPACE% || goto exit
69+
%DEBUG% kubectl cp WideWorldImportersDW-Full.bak %CLUSTER_NAMESPACE%/mssql-master-pool-0:/var/opt/mssql/data -c mssql-server || goto exit
7070
)
7171

7272
echo Configuring sample database(s)...
7373
%DEBUG% sqlcmd -S %SQL_MASTER_INSTANCE% -Usa -P%SQL_MASTER_SA_PASSWORD% -i "%STARTUP_PATH%bootstrap-sample-db.sql" -o "bootstrap.out" -I -b -v SA_PASSWORD="%KNOX_PASSWORD%" || goto exit
7474

7575
REM remove files copied into the pod:
7676
echo Removing database backup files...
77-
kubectl exec mssql-master-pool-0 -c mssql-server -i -t -- bash -c "rm -rvf /var/opt/mssql/data/*.bak"
77+
kubectl exec mssql-master-pool-0 -n %CLUSTER_NAMESPACE% -c mssql-server -i -t -- bash -c "rm -rvf /var/opt/mssql/data/*.bak"
7878

7979
for %%F in (web_clickstreams inventory customer) do (
8080
if NOT EXIST %%F.csv (

samples/features/sql-big-data-cluster/bootstrap-sample-db.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ then
4444
fi
4545

4646
echo Copying database backup file...
47-
$DEBUG kubectl cp tpcxbb_1gb.bak mssql-master-pool-0:/var/opt/mssql/data -c mssql-server -n $CLUSTER_NAMESPACE || (echo $ERROR_MESSAGE && exit 1)
47+
$DEBUG kubectl cp tpcxbb_1gb.bak $CLUSTER_NAMESPACE/mssql-master-pool-0:/var/opt/mssql/data -c mssql-server || (echo $ERROR_MESSAGE && exit 1)
4848
# $DEBUG rm tpcxbb_1gb.bak
4949

5050
if [ $AW_WWI_SAMPLES == --install-extra-samples ]
@@ -57,7 +57,7 @@ then
5757
$DEBUG curl -L -G "https://github.com/Microsoft/sql-server-samples/releases/download/adventureworks/$file" -o $file
5858
fi
5959
echo Copying $file database backup file to SQL Master instance...
60-
$DEBUG kubectl cp $file mssql-master-pool-0:/var/opt/mssql/data -c mssql-server -n $CLUSTER_NAMESPACE || (echo $ERROR_MESSAGE && exit 1)
60+
$DEBUG kubectl cp $file $CLUSTER_NAMESPACE/mssql-master-pool-0:/var/opt/mssql/data -c mssql-server || (echo $ERROR_MESSAGE && exit 1)
6161
done
6262

6363

@@ -69,7 +69,7 @@ then
6969
$DEBUG curl -L -G "https://github.com/Microsoft/sql-server-samples/releases/download/wide-world-importers-v1.0/$file" -o $file
7070
fi
7171
echo Copying $file database backup file to SQL Master instance...
72-
$DEBUG kubectl cp $file mssql-master-pool-0:/var/opt/mssql/data -c mssql-server -n $CLUSTER_NAMESPACE || (echo $ERROR_MESSAGE && exit 1)
72+
$DEBUG kubectl cp $file $CLUSTER_NAMESPACE/mssql-master-pool-0:/var/opt/mssql/data -c mssql-server || (echo $ERROR_MESSAGE && exit 1)
7373
done
7474
fi
7575

@@ -80,7 +80,7 @@ $DEBUG sqlcmd -S $SQL_MASTER_INSTANCE -Usa -P$SQL_MASTER_SA_PASSWORD -I -b < "$S
8080

8181
# remove files copied into the pod:
8282
echo Removing database backup files...
83-
kubectl exec mssql-master-pool-0 -c mssql-server -i -t -- bash -c "rm -rvf /var/opt/mssql/data/*.bak"
83+
kubectl exec mssql-master-pool-0 -n $CLUSTER_NAMESPACE -c mssql-server -i -t -- bash -c "rm -rvf /var/opt/mssql/data/*.bak"
8484

8585
for table in web_clickstreams inventory customer
8686
do

0 commit comments

Comments
 (0)