Exemplo n.º 1
0
def _install_ss_repo_creds_boot(nexus_user, nexus_pass):
    conf = """
(configure-repositories!
 (fn [{:keys [url] :as repo-map}]
   (->> (condp re-find url
          #"^http://nexus\.sixsq\.com/"
          {:username "%(user)s"
           :password "%(pass)s"}
          #".*" nil)
        (merge repo-map))))
""" % {'user': nexus_user, 'pass': nexus_pass}
    fileAppendContent(_expanduser('~/.boot/profile.boot'), conf)
Exemplo n.º 2
0
def _install_git_creds(nexus_user, nexus_pass):
    tarball = _expanduser('~/git-creds.tgz')
    download_file(GIT_CREDS_URL, tarball, creds={'username': nexus_user,
                                                 'password': nexus_pass})
    _mkdir(SSH_DIR, 0700)
    _tar_extract(tarball, SSH_DIR)
    os.unlink(tarball)

    ssh_conf = _expanduser(os.path.join(SSH_DIR, 'config'))
    fileAppendContent(ssh_conf, "Host github.com\n\tStrictHostKeyChecking no\n")
    os.chmod(ssh_conf, 0644)

    _chown(SSH_DIR, os.getuid(), os.getgid(), recursive=True)