vvp -- VNF Validation Platform
[oom.git] / kubernetes / vvp / charts / vvp-imagescanner / resources / config / imagescanner / imagescannerconfig.py
1 # Copyright © 2018 Amdocs, AT&T, Bell Canada
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #       http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15 import os
16 from pathlib import Path
17 from awsauth import S3Auth
18 # A mapping from host names to Requests Authentication Objects; see
19 # http://docs.python-requests.org/en/master/user/authentication/
20 AUTHS = {}
21 if 'S3_HOST' in os.environ:
22     AUTHS[os.environ['S3_HOST']] = S3Auth(
23         os.environ['AWS_ACCESS_KEY_ID'],
24         os.environ['AWS_SECRET_ACCESS_KEY'],
25         service_url='https://%s/' % os.environ['S3_HOST']
26         )
27 LOGS_PATH = Path(os.environ['IMAGESCANNER_LOGS_PATH'])
28 STATUSFILE = LOGS_PATH/'status.txt'
29 # A dict passed as kwargs to jenkins.Jenkins constructor.
30 JENKINS = {
31   'url': 'http://jenkins:8080',
32   'username': 'admin',
33   'password': os.environ['SECRET_JENKINS_PASSWORD'],
34   }