-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup-run.sh
More file actions
executable file
·48 lines (40 loc) · 1.66 KB
/
Copy pathsetup-run.sh
File metadata and controls
executable file
·48 lines (40 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPOS_DIR="${SCRIPT_DIR}/repos"
REMOTE_IMAGE="davidparry/codeql-query-server"
REPO_URL="git@github.com:davidparry/data-access.git"
REPO_BRANCH="security-problem"
echo "Pulling latest image: ${REMOTE_IMAGE} ..."
docker pull --platform linux/amd64 "${REMOTE_IMAGE}:latest"
echo "Creating repos directory at ${REPOS_DIR} ..."
mkdir -p "${REPOS_DIR}"
REPO_NAME=$(basename "${REPO_URL}" .git)
REPO_DIR="${REPOS_DIR}/${REPO_NAME}"
if [ -d "${REPO_DIR}/.git" ]; then
echo "Repo already cloned at ${REPO_DIR}, fetching latest ..."
git -C "${REPO_DIR}" fetch --all
git -C "${REPO_DIR}" checkout "${REPO_BRANCH}"
git -C "${REPO_DIR}" pull origin "${REPO_BRANCH}"
else
echo "Cloning ${REPO_URL} into ${REPOS_DIR} ..."
git -C "${REPOS_DIR}" clone "${REPO_URL}"
echo "Switching to branch ${REPO_BRANCH} ..."
git -C "${REPO_DIR}" checkout "${REPO_BRANCH}"
fi
echo "Starting services with docker compose ..."
cd "${SCRIPT_DIR}"
REPOS_PATH="${REPOS_DIR}" CODEQL_IMAGE="${REMOTE_IMAGE}" docker compose --env-file /dev/null up -d
BOLD='\033[1m'
GREEN='\033[0;32m'
CYAN='\033[0;36m'
YELLOW='\033[1;33m'
RESET='\033[0m'
echo ""
echo -e "${GREEN}${BOLD}Done. Services are running.${RESET}"
echo ""
echo -e "${CYAN}${BOLD}If you have Claude, the .mcp.json will work for you out of the box.${RESET}"
echo ""
echo -e "${YELLOW}${BOLD}Use this prompt:${RESET}"
echo -e "${YELLOW} use the analyze tool to inspect the repo: data-access pass this into the tool and read the output and suggest fixes from the report if the tool fails in anyway just report the failure nothing more dont do or change code ${RESET}"
echo ""