Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/msabramo/jprops2bash
Convert Java properties file to bash env var script
https://github.com/msabramo/jprops2bash
Last synced: about 1 month ago
JSON representation
Convert Java properties file to bash env var script
- Host: GitHub
- URL: https://github.com/msabramo/jprops2bash
- Owner: msabramo
- License: mit
- Created: 2015-06-02T05:44:16.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-06-05T17:43:34.000Z (over 9 years ago)
- Last Synced: 2024-11-09T04:49:13.236Z (about 2 months ago)
- Language: Python
- Size: 141 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
jprops2bash
===========Convert Java properties file to bash env var script
Usage
-----It reads from stdin and writes to stdout:
::
$ cat > sample.properties
teamcity.agent.jvm.file.encoding=UTF-8
teamcity.agent.jvm.file.separator=/
teamcity.agent.jvm.os.arch=amd64
teamcity.agent.jvm.os.name=Linux
teamcity.agent.jvm.os.version=3.13.0-43-generic
teamcity.agent.jvm.path.separator=\:
teamcity.agent.jvm.specification=1.8
teamcity.agent.jvm.user.country=US
teamcity.agent.jvm.user.home=/home/teamcity
runParam.script.content=\#\!/bin/bash\n\nset -o errexit\n\# set -o xtrace\n\necho "*** \:\: \\"run pipeline script\\"$ jprops2bash < sample.properties
export TEAMCITY_AGENT_JVM_FILE_ENCODING='UTF-8'
export TEAMCITY_AGENT_JVM_FILE_SEPARATOR='/'
export TEAMCITY_AGENT_JVM_OS_ARCH='amd64'
export TEAMCITY_AGENT_JVM_OS_NAME='Linux'
export TEAMCITY_AGENT_JVM_OS_VERSION='3.13.0-43-generic'
export TEAMCITY_AGENT_JVM_PATH_SEPARATOR=':'
export TEAMCITY_AGENT_JVM_SPECIFICATION='1.8'
export TEAMCITY_AGENT_JVM_USER_COUNTRY='US'
export TEAMCITY_AGENT_JVM_USER_HOME='/home/teamcity'
export RUNPARAM_SCRIPT_CONTENT='#!/bin/bash\n\nset -o errexit\n# set -o xtrace\n\necho "*** :: \"run pipeline script\"'and if you wanted to set environment variables for all of these you
could do something like the following:::
$ env | grep TEAM
$ eval $(jprops2bash < sample.properties)
$ env | grep TEAM
TEAMCITY_AGENT_JVM_SPECIFICATION=1.8
TEAMCITY_AGENT_JVM_OS_NAME=Linux
TEAMCITY_AGENT_JVM_PATH_SEPARATOR=:
TEAMCITY_AGENT_JVM_FILE_SEPARATOR=/
TEAMCITY_AGENT_JVM_OS_ARCH=amd64
TEAMCITY_AGENT_JVM_USER_HOME=/home/teamcity
TEAMCITY_AGENT_JVM_FILE_ENCODING=UTF-8
TEAMCITY_AGENT_JVM_USER_COUNTRY=US
TEAMCITY_AGENT_JVM_OS_VERSION=3.13.0-43-generic