Skip to content

Commit

Permalink
add dotenv
Browse files Browse the repository at this point in the history
  • Loading branch information
grdsdev committed Jan 17, 2025
1 parent bf75703 commit 36a027a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,5 @@ iOSInjectionProject/
# Environment
.env
Secrets.swift
DotEnv.swift
lcov.info
temp_coverage
15 changes: 0 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,24 +38,9 @@ endif

TEST_RUNNER_CI = $(CI)

export SECRETS
define SECRETS
enum DotEnv {
static let SUPABASE_URL = "$(SUPABASE_URL)"
static let SUPABASE_ANON_KEY = "$(SUPABASE_ANON_KEY)"
static let SUPABASE_SERVICE_ROLE_KEY = "$(SUPABASE_SERVICE_ROLE_KEY)"
}
endef

xcodebuild:
$(XCODEBUILD)

load-env:
@. ./scripts/load_env.sh

dot-env:
@echo "$$SECRETS" > Tests/IntegrationTests/DotEnv.swift

test-integration:
cd Tests/IntegrationTests && supabase start && supabase db reset
swift test --filter IntegrationTests
Expand Down
17 changes: 17 additions & 0 deletions Tests/IntegrationTests/DotEnv.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import Foundation

enum DotEnv {
static var SUPABASE_URL: String {
ProcessInfo.processInfo.environment["SUPABASE_URL"] ?? "http://localhost:54321"
}

static var SUPABASE_ANON_KEY: String {
ProcessInfo.processInfo.environment["SUPABASE_ANON_KEY"]
?? "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0"
}

static var SUPABASE_SERVICE_ROLE_KEY: String {
ProcessInfo.processInfo.environment["SUPABASE_SERVICE_ROLE_KEY"]
?? "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImV4cCI6MTk4MzgxMjk5Nn0.EGIM96RAZx35lJzdJsyH-qQwv8Hdp7fsn3W0YpN81IU"
}
}

0 comments on commit 36a027a

Please sign in to comment.