-
Notifications
You must be signed in to change notification settings - Fork 293
Mount the entire user SSH directory into build container #489
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,12 +8,14 @@ const { | |
removeSync, | ||
readFile, | ||
copySync, | ||
ensureFileSync, | ||
appendFileSync, | ||
writeFileSync, | ||
statSync, | ||
pathExistsSync | ||
} = require('fs-extra'); | ||
const { quote } = require('shell-quote'); | ||
const { sep } = require('path'); | ||
const { sep, resolve } = require('path'); | ||
|
||
const { getUserCachePath, sha256Path } = require('./lib/shared'); | ||
|
||
|
@@ -579,6 +581,35 @@ test( | |
{ skip: !hasPython(2) } | ||
); | ||
|
||
test( | ||
'dockerSsh mounts entire ssh folder into docker', | ||
t => { | ||
process.chdir('tests/base'); | ||
const path = npm(['pack', '../..']); | ||
npm(['i', path]); | ||
// create a known_hosts file with the rsa fingerprint of github | ||
// the plugin should mount the entire .ssh directory into the container | ||
const known_hosts_file = resolve(process.env.HOME, `./.ssh/known_hosts`); | ||
ensureFileSync(known_hosts_file); | ||
appendFileSync( | ||
known_hosts_file, | ||
'github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==' | ||
); | ||
// verify this by installing a requirement via git+ssh | ||
sls([ | ||
'--dockerizePip=true', | ||
'--dockerSsh=true', | ||
'--fileName=requirements-w-git-ssh.txt', | ||
'package' | ||
]); | ||
const zipfiles = listZipFiles('.serverless/sls-py-req-test.zip'); | ||
// check if the requirement is actually in the archive | ||
t.true(zipfiles.includes(`boto3/__init__.py`), 'boto3 is packaged via ssh'); | ||
t.end(); | ||
}, | ||
{ skip: !canUseDocker() } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Have you tested this on Windows? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nope, not sure if its gonna work on Windows. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Then the skip section should be skipping the test on Windows, and you can create an issue noting that this functionality doesn't work on Windows yet. |
||
); | ||
|
||
test( | ||
'py2.7 can package flask with slim & dockerizePip & slimPatterns options', | ||
async t => { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
flask | ||
bottle | ||
git+ssh://[email protected]/boto/boto3.git#egg=boto3 |
Uh oh!
There was an error while loading. Please reload this page.