Unverified Commit 1cab9815 authored by Oskar Roesler's avatar Oskar Roesler Committed by GitHub
Browse files

Merge pull request #4 from fmauch/config_distribute

Use default config and copy in-place at first run
parents b2c309b3 9179858c
......@@ -5,3 +5,4 @@ packages
repository/
failed.txt
success.txt
config.ini
......@@ -2,6 +2,7 @@ from aurci import sed
from github import Github
import os
import requests
import shutil
import yaml
import re
import configparser
......@@ -13,12 +14,19 @@ class Routines:
self.verbosity = verbosity
self.output = output
self.path = os.path.join("./packages/{0}".format(self.package))
config = configparser.ConfigParser()
config.read('config.ini')
config = self.get_config()
self.gh = Github(config['CI']['GH_OAUTH_TOKEN'])
self.gh_organization_name = config['CI']['GH_ORGANIZATION']
self.gh_organization = self.gh.get_organization(self.gh_organization_name)
@staticmethod
def get_config():
config = configparser.ConfigParser()
if not os.path.exists('config.ini'):
shutil.copy('config_example.ini', 'config.ini')
config.read('config.ini')
return config
def delete_package_line(self, file):
sed.rmlinematch(self.package, file)
......@@ -56,8 +64,7 @@ class Routines:
@staticmethod
def get_ros_distro():
config = configparser.ConfigParser()
config.read('config.ini')
config = Routines.get_config()
return config['CI']['GH_ORGANIZATION'].rstrip("arch")
@staticmethod
......
[CI]
GH_OAUTH_TOKEN =
GH_ORGANIZATION = ros-melodic-arch
\ No newline at end of file
[CI]
# Create OAUTH token as explained here: https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token
GH_OAUTH_TOKEN =
GH_ORGANIZATION = ros-melodic-arch
......@@ -3,4 +3,4 @@ GitPython
ConfigParser
yaml
requests
argparse
\ No newline at end of file
argparse
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment