Skip to content

Instantly share code, notes, and snippets.

@ninp0
Last active July 28, 2020 18:45
Show Gist options
  • Save ninp0/2478ff7bbce0036a11f729d715923f28 to your computer and use it in GitHub Desktop.
Save ninp0/2478ff7bbce0036a11f729d715923f28 to your computer and use it in GitHub Desktop.
#!/bin/bash --login
target_repo="${1}"
uri_source_root="${2}"
usage() {
echo "USAGE: ${0} <target_repo_path> <repo_uri_root_source>"
echo "EXAMPLE: cd /tmp && git clone https://github.com/python/cpython && cd cpython && ${0} /tmp/cpython 'https://github.com/python/cpython/tree/master'"
exit 1
}
if [[ $# != 2 ]]; then
usage
fi
if [[ -d $target_repo ]]; then
docker run \
--name csi_scapm.$RANDOM \
--publish 127.0.0.1:3333:3333 \
--volume /tmp:/tmp \
--rm \
--interactive \
--tty 0dayinc/csi_scapm \
--login \
-c "csi_scapm --dir-path ${target_repo} --uri-source-root '${uri_source_root}' --max-threads 39 --start-reporting-server"
else
echo "${target_repo} Doesn't Exist!"
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment