- Following commands start, stop and restart OEC:
sudo systemctl start oec sudo systemctl stop oec sudo systemctl restart oec
- Example usage with environment variables:
sudo systemctl set-environment OEC_CONF_SOURCE_TYPE=git sudo systemctl set-environment [email protected]:metehan2/test-private-conf.git sudo systemctl set-environment OEC_CONF_GIT_PRIVATE_KEY_FILEPATH=~/.ssh/id_rsa sudo systemctl set-environment OEC_CONF_GIT_FILEPATH=~/oec/config.json sudo systemctl start OEC
sudo systemctl set-environment OEC_CONF_SOURCE_TYPE=local sudo systemctl set-environment OEC_CONF_LOCAL_FILEPATH=~/opsgenie/oec.json sudo systemctl start OEC
- Commands for Windows will be added soon.
- Clone the repository with
git clone https://github.com/opsgenie/OEC.git
docker build . -t OEC
- Since OEC uses configuration files to run, you need to provide volumes to Docker container so that the files are accessible from the container. You also need to provide environment variables explained above to the container. Here is an example command to run docker container:
docker run -ti \ -v /Users/foo/Documents/bar:/home/opsgenie \ -e OEC_CONF_SOURCE_TYPE="local" \ -e OEC_CONF_LOCAL_FILEPATH="/home/opsgenie/OEC.yaml" \ OEC
Above command runs the container with two environment variables and creates a volume between “bar” folder in host machine and “opsgenie” folder in the container.
Since you are using docker container to run OEC, you need to give the file paths according to the container not to host machine.
- If you want to use the configuration from your repository, you need to add your ssh_known_hosts file to image by using a volume. You may also need to set SSH_KNOWN_HOSTS environment variable to your ssh_know_hosts file path in the image. Below is an example command to run OEC with using configuration file from a repository. The command also creates additional volume to access the log files from the host machine.
docker run -ti \ -v /Users/erenkizilay/Documents/dummyDir:/home/opsgenie \ -v /Users/erenkizilay/Documents/dummyDir:/var/log/opsgenie \ -v /Users/erenkizilay/.ssh/known_hosts:/etc/ssh/ssh_known_hosts \ -e OEC_CONF_SOURCE_TYPE="git" -e OEC_CONF_GIT_FILEPATH=/config.json \ -e OEC_CONF_GIT_PRIVATE_KEY_FILEPATH=/var/log/opsgenie/id_rsa \ -e [email protected]:erenkizilay/OEC-conf.git \ -e SSH_KNOWN_HOSTS=/etc/ssh/ssh_known_hosts \ OEC
Updated over 4 years ago