-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
42 lines (32 loc) · 1.22 KB
/
main.py
File metadata and controls
42 lines (32 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import logging
from logging.config import fileConfig
from configparser import ConfigParser
import os, os.path
from requests.auth import HTTPProxyAuth
import devopsworker, zipfileworker
# Load Configuration for reading parameters
Config = ConfigParser()
Config.read('.\\settings.ini')
# Logging config
if not os.path.exists("./logs/"):
os.makedirs("./logs/")
fileConfig('logging_config.ini')
logger = logging.getLogger()
# Artifacts save folder
if not os.path.exists("./BuildArtifacts/"):
os.makedirs("./BuildArtifacts/")
if __name__ == "__main__":
# Read Devops project details
org_name = Config.get('devops_paths', 'org_name')
project_name = Config.get('devops_paths', 'project_name')
basicpattoken = Config.get('devops_paths', 'basicpattoken')
# Read proxy details
proxy = Config.get('proxy_details', 'ip')
auth_user = Config.get('proxy_details', 'auth_user')
auth_password = Config.get('proxy_details', 'auth_password')
# Authentication for Proxy
proxy_auth = HTTPProxyAuth(auth_user, auth_password)
# Azure Devops Worker
devopsworker.dojob(org_name, project_name, basicpattoken, proxy, proxy_auth)
# Zipfile worker
zipfileworker.dojob("./BuildArtifacts/")