Exemple #1
0
def check_dockerised_jenkins_pem():
    """
        Check if the jenkins dockerised has created jenkinskey.pem private keys
    """
    # Check if both files are been added to home derectory
    if not os.path.isfile(get_jenkins_pem()):
        sys.exit("File jenkinskey.pem missing. Aborting! ")

    # Copy the pem keys and give relavant permissions to a dockerkeys Location. This is different from Scenario 1.
    subprocess.call('cp -f {0} {1}sshkeys/dockerkeys'.format(
        get_jenkins_pem(), get_script_folder()).split(' '))
    subprocess.call(
        'sudo chmod 400 {0}sshkeys/dockerkeys/jenkinskey.pem'.format(
            get_script_folder()).split(' '))
def check_jenkins_pem():
    """
        Check if the user has provided jenkinskey.pem private keys
    """
    # Check if both files are been added to home derectory
    if not os.path.isfile(get_jenkins_pem()):
        sys.exit(
            "File jenkinskey.pem is not present in your home (~/) folder, kindly add and run the installer again! "
        )

    # Copy the pem keys and give relavant permissions to a dockerkeys location. This is different from Scenario 1.
    subprocess.call('cp -f {0} {1}sshkeys/dockerkeys'.format(
        get_jenkins_pem(), get_script_folder()).split(' '))
    subprocess.call(
        'sudo chmod 400 {0}sshkeys/dockerkeys/jenkinskey.pem'.format(
            get_script_folder()).split(' '))