Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gableroux/travis-multiline-env-example
📚Convert mutli line environment variable to file with Travis-ci in project settings
https://github.com/gableroux/travis-multiline-env-example
environment-variables example file travis-ci
Last synced: 26 days ago
JSON representation
📚Convert mutli line environment variable to file with Travis-ci in project settings
- Host: GitHub
- URL: https://github.com/gableroux/travis-multiline-env-example
- Owner: GabLeRoux
- Created: 2018-05-13T04:35:15.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-09-14T18:15:37.000Z (over 6 years ago)
- Last Synced: 2024-10-26T14:18:26.129Z (2 months ago)
- Topics: environment-variables, example, file, travis-ci
- Homepage: https://github.com/travis-ci/travis-ci/issues/7715#issuecomment-362536708
- Size: 3.91 KB
- Stars: 5
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: ReadMe.md
Awesome Lists containing this project
README
# Travis-CI multiline env variables example
[![Build Status](https://travis-ci.com/GabLeRoux/travis-multiline-env-example.svg?branch=master)](https://travis-ci.com/GabLeRoux/travis-multiline-env-example)
I needed to generate a file based on an environment variable which contains multiple lines. Note: `gitlab-ci` does support this out of the boxs. I just needed to do the same with Travis. :v:
## The solution
As described in [travis-ci#7715](https://github.com/travis-ci/travis-ci/issues/7715#issuecomment-362536708), we can replace end lines by `\n` and wrap the environment variable in settings with `"$(echo -e '` and `')"`.
### Example:
Expected content
```xml
```
The above content with endlines replaced:
```xml
\n \n \n \n
```What we actually need to add in Travis environment variables settings:
```xml
"$(echo -e '\n \n \n \n')"
```:white_check_mark: [Confirmed working here](https://travis-ci.com/GabLeRoux/travis-multiline-env-example)