Skip to content

Commit

Permalink
chore(appium): update scripts for shuttle changes
Browse files Browse the repository at this point in the history
  • Loading branch information
luisecm committed Jan 26, 2024
1 parent 50ff179 commit 1dc11b9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 16 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ui-test-automation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ jobs:
chmod +x ./utils/replace_node.sh
./utils/replace_node.sh
- name: Output contents from mod.rs file
run: cat ./common/src/warp_runner/mod.rs
- name: Output contents from Makefile modified file
run: cat ./Makefile

- name: Build executable 🖥️
run: make dmg
Expand Down Expand Up @@ -148,8 +148,8 @@ jobs:
- name: Replace Warp Peer ID in Uplink 🚀
run: .\utils\replace_node.ps1

- name: Output contents from mod.rs file
run: Get-Content .\common\src\warp_runner\mod.rs
- name: Output contents from modified Makefile file
run: Get-Content .\Makefile

- name: Build executable 🖥️
run: cargo build --release -F production_mode
Expand Down
14 changes: 6 additions & 8 deletions utils/replace_node.ps1
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# Contents of replace_node.ps1
# Read the values from .\warp\peerID.txt
$localPeerID = Select-String -Path .\warp\peerID.txt -Pattern 'Local PeerID: ([^\s]+)' | ForEach-Object { $_.Matches.Groups[1].Value }

# Read the values from ./warp/peerID
$localPeerId = Select-String -Path .\warp\peerID.txt -Pattern 'Local PeerID: ([^\s]*)' | ForEach-Object { $_.Matches.Groups[1].Value }

# Update the values in ./common/src/warp_runner/mod.rs and store in a temporary file
(Get-Content .\common\src\warp_runner\mod.rs) -replace '12D3KooWJSes8386p2T1sMeZ2DzsNJThKkZWbj4US6uPMpEgBTHu', $localPeerId `
-replace '/ip4/104.236.194.35/tcp/34053', '/ip4/127.0.0.1/tcp/4444' |
Set-Content -Path .\common\src\warp_runner\mod.rs
# Update the values in .\common\src\warp_runner\mod.rs and store in a temporary file
(Get-Content .\Makefile) -replace 'cargo build --release -F production_mode', 'SHUTTLE_ADDR_POINT=/ip4/127.0.0.1/tcp/4444/p2p/ cargo build --release -F production_mode' -replace ' cargo build --release -F production_mode', "$localPeerID cargo build --release -F production_mode" | Set-Content -Path temp_file

# Replace the original mod.rs with the modified content
Move-Item -Path temp_file -Destination .\Makefile
8 changes: 4 additions & 4 deletions utils/replace_node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
local_peer_id=$(grep -o 'Local PeerID: [^[:space:]]*' ./warp/peerID.txt | awk '{print $NF}')

# Update the values in ./common/src/warp_runner/mod.rs and store in a temporary file
sed -e "s/12D3KooWJSes8386p2T1sMeZ2DzsNJThKkZWbj4US6uPMpEgBTHu/$local_peer_id/g" \
-e "s#/ip4/104.236.194.35/tcp/34053#/ip4/127.0.0.1/tcp/4444#" \
./common/src/warp_runner/mod.rs > temp_file
sed -e "s#cargo build --release -F production_mode#SHUTTLE_ADDR_POINT=/ip4/127.0.0.1/tcp/4444/p2p/ cargo build --release -F production_mode#"
-e "s/ cargo build --release -F production_mode/$local_peer_id cargo build --release -F production_mode/g" \
./Makefile > temp_file

# Replace the original mod.rs with the modified content
mv temp_file ./common/src/warp_runner/mod.rs
mv temp_file ./Makefile

0 comments on commit 1dc11b9

Please sign in to comment.