Skip to content

Commit 1c860b1

Browse files
committed
Add test for update_sdk.sh
1 parent 641a3bc commit 1c860b1

File tree

6 files changed

+69
-2
lines changed

6 files changed

+69
-2
lines changed

.github/workflows/maven-deploy-cm.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ jobs:
7575
-D includeExamples="y" \
7676
-D includeFormsenrollment="y"
7777
# Set global git configuration
78+
- name: Test SDK update
79+
run: |
80+
archetype/src/main/archetype/dispatcher.cloud/test/test_dispatcher_sdk_update.sh sitesdemo archetype/src/main/archetype/dispatcher.cloud/test/dummy_sdk
7881
- name: Set git config
7982
run: |
8083
git config --global credential.helper cache

src/main/archetype/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ local.properties
2020
# External tool builders
2121
.externalToolBuilders/
2222

23+
# Escape dummy_sdk bin folder
24+
!dispatcher.cloud/test/dummy_sdk/bin
25+
2326
# Locally stored "Eclipse launch configurations"
2427
*.launch
2528

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/sh
2+
3+
# Copyright 2022 Adobe Systems Incorporated
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
version=2.0.110
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
3+
# Copyright 2022 Adobe Systems Incorporated
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
18+
if [ -n "$1" ]; then
19+
echo "Updated SDK!"
20+
else
21+
echo "Failed to update SDK!"
22+
exit 1
23+
fi
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
3+
# Copyright 2022 Adobe Systems Incorporated
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
siteDir="$1"
18+
sdkDir="$2"
19+
dispatcherDir="$siteDir/dispatcher"
20+
21+
"$dispatcherDir/update_sdk.sh" "$sdkDir"

src/main/archetype/dispatcher.cloud/update_sdk.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ if [[ ! -e "${sdkPath}/bin/docker_run.sh" ]]; then
3434
exit -1
3535
fi
3636

37-
sdkVersion=$(cat ${sdkPath}/bin/docker_run.sh | grep version= | cut -f2 -d '=')
37+
dispatcherVersion=$(cat ${sdkPath}/bin/docker_run.sh | grep version= | cut -f2 -d '=')
3838

3939
if [[ -z "$sdkPath" ]]; then
4040
echo "Cannot evaluate SDK. Is it a valid path to a dispatcher SDK?"
4141
usage
4242
exit -1
4343
fi
4444

45-
echo "Attempting to upgrade to dispatcher SDK version $sdkVersion..."
45+
echo "Attempting to upgrade to dispatcher SDK version $dispatcherVersion..."
4646

4747
if [[ ! -e "${sdkPath}/bin/update_maven.sh" ]]; then
4848
echo "The dispatcher SDK version that you have chosen does not yet support updates."

0 commit comments

Comments
 (0)