Skip to content

Commit

Permalink
[Docs] Minor read me adjusments
Browse files Browse the repository at this point in the history
  • Loading branch information
LucianoPAlmeida committed Sep 21, 2021
1 parent e256380 commit 493bfda
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

[![license](https://img.shields.io/github/license/mashape/apistatus.svg)](https://opensource.org/licenses/MIT)
[![Build Status](https://github.com/LucianoPAlmeida/variable-injector/workflows/CI/badge.svg?branch=master)](https://github.com/LucianoPAlmeida/variable-injector/actions)
[![Swift](https://img.shields.io/badge/Swift-5.4-orange.svg)](https://swift.org)
[![Xcode](https://img.shields.io/badge/Xcode-12.5-blue.svg)](https://developer.apple.com/xcode)
[![Swift](https://img.shields.io/badge/Swift-5.5-orange.svg)](https://swift.org)
[![Xcode](https://img.shields.io/badge/Xcode-13.0-blue.svg)](https://developer.apple.com/xcode)
[![SPM](https://img.shields.io/badge/SPM-orange.svg)](https://swift.org/package-manager/)

Variable injector is a very simple project with the goal of inject CI pipelines environment variables values into **Swift** code static values before compilation and Continuous deployment to a specific environment(Development, Testing or Production) where we can define the values injected for each build and deployment e.g. an API URL that the App uses and is different for each environment. Also, it allows us to not expose our production keys and values in statically in our code.
Expand All @@ -26,7 +26,7 @@ For a detailed example of using this, check out the article [Continuous Integrat
**Note**
If you having issues with XCode 11 use the version 0.3.3 of the tool.

You should have a class or struct with your environment variables declaration following the $(VAR_NAME) pattern.
You should have a `class` or `struct` with your environment variables declaration following the $(VAR_NAME) pattern.
Example:
```swift
struct CI {
Expand All @@ -38,10 +38,10 @@ Example:
With the environments static declarations matching the pattern

```sh
variable-injector --file ${SRCROOT}/Envirionment/CI.swift
variable-injector --file ${SRCROOT}/Environment/CI.swift

```
If environment variables with those names, as in the example you have the `SERVICE_PROD_KEY` and `OTHER_PROD_KEY` are defined on the build machine for this pipeline the injector you replace the string literal with the envirionment variable value.
If environment variables with those names, as in the example you have the `SERVICE_PROD_KEY` and `OTHER_PROD_KEY` are defined on the build machine for this pipeline the injector you replace the string literal with the environment variable value.

Example of the file after the substitution.

Expand Down Expand Up @@ -71,14 +71,14 @@ fi
We can ignore patterns that match $(ENV_VAR) to avoid the replace.

```sh
variable-injector --file ${SRCROOT}/Envirionment/CI.swift --ignore OTHER_PROD_KEY
variable-injector --file ${SRCROOT}/Environment/CI.swift --ignore OTHER_PROD_KEY

```

And also, to see the logs of variables, values and source output you can use `--verbose`

**IMPORTANT**
The verbose mode you print the values of your environment variables on the logs. So you may be careful and use it only for debug porpuses.
The verbose mode you print the values of your environment variables on the logs. So you may be careful and use it only for debug proposes.

```sh
variable-injector --file ${SRCROOT}/Environment/CI.swift --verbose
Expand Down

0 comments on commit 493bfda

Please sign in to comment.