Skip to content

Commit

Permalink
[#491] Migrate SetUpTestFirebase
Browse files Browse the repository at this point in the history
  • Loading branch information
blyscuit committed Aug 4, 2023
1 parent 1385fce commit d7c50a8
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Scripts/Swift/SetUpTestFirebase.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
static let ConstantTeamId = "<#teamId#>"
static let ConstantStagingFirebaseAppId = "<#stagingFirebaseAppId#>"
static let ConstantFirebaseTesterGroups = "<#group1#>, <#group2#>"
static let ConstantMatchRepo = "[email protected]:{organization}\/{repo}.git"
let envMatchRepo = ProcessInfo.processInfo.environment["MATCH_REPO"]
let envStagingFirebaseAppId = ProcessInfo.processInfo.environment["STAGING_FIREBASE_APP_ID"]
let envTeamId = ProcessInfo.processInfo.environment["TEAM_ID"]
let matchRepoEscaped = envMatchRepo.replacingOccurrences(of: "/", with: "\/")
let firebaseTesterGroup = "nimble"
let fileManager = FileManager.default
let workingDirectory = fileManager.currentDirectoryPath
try? safeShell("LC_ALL=C find \(workingDirectory) -type f -exec sed -i \"\" \"s/\(ConstantTeamId)/\(envTeamId)/g\" {} +")
try? safeShell("LC_ALL=C find \(workingDirectory) -type f -exec sed -i \"\" \"s/\(ConstantStagingFirebaseAppId)/\(envStagingFirebaseAppId)/g\" {} +")
try? safeShell("LC_ALL=C find \(workingDirectory) -type f -exec sed -i \"\" \"s/\(ConstantFirebaseTesterGroups)/\(firebaseTesterGroup)/g\" {} +")
try? safeShell("LC_ALL=C find \(workingDirectory) -type f -exec sed -i \"\" \"s/\(ConstantMatchRepo)/\(matchRepoEscaped)/g\" {} +")

0 comments on commit d7c50a8

Please sign in to comment.