lngyeen / MySurveyChallenge

0 stars 0 forks source link

[Feature] Supporting multiple application environments #29

Closed blyscuit closed 5 months ago

blyscuit commented 5 months ago

Issue

In a real world development we will use more than 1 environments. Current application supports only Production environment.

Acceptance Criteria

lngyeen commented 5 months ago

Hello @blyscuit I already implement in this PR ;) https://github.com/lngyeen/MySurveyChallenge/pull/43

Basically I will create another xcconfig file, so we will have 2 xcconfig files, one for dev and one for prod, fill in the values corresponding to each environment into these files. Like this picture:

Screenshot 2024-04-22 at 3 22 25 PM

I will go to the project section and create 2 more configurations (Dev-Debug and Dev-Release) and rename the existing configurations to Prod-Debug and Prod-Release for easy distinction.

Screenshot 2024-04-22 at 3 22 41 PM

And then create another scheme for Dev and select the corresponding configuration in the Edit Scheme section. As shown below:

Screenshot 2024-04-22 at 3 24 40 PM

Regarding app secrets, there are 2 approaches. 1: If we do not use CI/CD tools, we can create xcconfig files as placeholders (containing only keys, not values). Add them to git ignore to avoid having to push thoes values to the remote repository. And we will share secrets only within the team, developer will manually copy these secrets into xcconfig files manually. 2: We can use secret storage services from CI/CD services. When we run the pipeline, you can write a small script to get these secrets and fill them into the corresponding xcconfig files right before building the project.

blyscuit commented 5 months ago

The feature works now. Minor note, the new update seems to break fastfile testLane.

lngyeen commented 5 months ago

The feature works now. Minor note, the new update seems to break fastfile testLane.

I fixed ;) https://github.com/lngyeen/MySurveyChallenge/pull/45