GitLab
GitLab 이슈 및 머지 리퀘스트에서 Dropstone 사용하기.
Dropstone은 GitLab CI/CD 파이프라인 또는 GitLab Duo를 통해 GitLab 워크플로우와 통합됩니다.
두 경우 모두 Dropstone은 GitLab 러너에서 실행됩니다.
GitLab CI
Dropstone은 일반 GitLab 파이프라인에서 작동합니다. CI 컴포넌트로 파이프라인에 빌드할 수 있습니다.
여기서는 Dropstone용 커뮤니티 제작 CI/CD 컴포넌트를 사용합니다: nagyv/gitlab-dropstone.
기능
- 작업별 사용자 지정 구성: 사용자 지정 구성 디렉터리(예:
./config/#custom-directory)로 Dropstone을 구성하여 Dropstone 호출별로 기능을 활성화하거나 비활성화할 수 있습니다. - 최소 설정: CI 컴포넌트가 백그라운드에서 Dropstone을 설정하므로 Dropstone 구성과 초기 프롬프트만 만들면 됩니다.
- 유연성: CI 컴포넌트는 동작을 사용자 지정할 수 있는 여러 입력을 지원합니다.
설정
-
Dropstone 인증 JSON을 설정 > CI/CD > 변수 아래에 파일 형식 CI 환경 변수로 저장합니다. "마스킹 및 숨김"으로 표시해야 합니다.
-
.gitlab-ci.yml파일에 다음을 추가합니다.include: - component: $CI_SERVER_FQDN/nagyv/gitlab-dropstone/dropstone@2 inputs: config_dir: ${CI_PROJECT_DIR}/dropstone-config auth_json: $DROPSTONE_AUTH_JSON # Dropstone 인증 JSON의 변수 이름 command: optional-custom-command message: "여기에 프롬프트 입력"
더 많은 입력 및 사용 사례는 이 컴포넌트의 문서를 확인하세요.
GitLab Duo
Dropstone은 GitLab 워크플로우와 통합됩니다.
댓글에서 @dropstone을 언급하면 Dropstone이 GitLab CI 파이프라인 내에서 작업을 실행합니다.
기능
- 이슈 분류: Dropstone에게 이슈를 조사하고 설명해 달라고 요청하세요.
- 수정 및 구현: Dropstone에게 이슈를 수정하거나 기능을 구현해 달라고 요청하세요. 변경 사항이 포함된 새 브랜치를 만들고 머지 리퀘스트를 생성합니다.
- 보안: Dropstone은 GitLab 러너에서 실행됩니다.
설정
Dropstone은 GitLab CI/CD 파이프라인에서 실행됩니다. 설정에 필요한 항목은 다음과 같습니다:
Tip
최신 지침은 GitLab 문서를 확인하세요.
- GitLab 환경 구성
- CI/CD 설정
- Dropstone API 키 받기 (Quickstart 참조)
- 서비스 계정 생성
- CI/CD 변수 구성
- 플로우 구성 파일 생성. 예:
image: node:22-slim
commands:
- echo "Installing Dropstone"
- curl -fsSL https://dropstone.io/install | bash
- echo "Installing glab"
- export GITLAB_TOKEN=$GITLAB_TOKEN_DROPSTONE
- apt-get update --quiet && apt-get install --yes curl wget gpg git && rm --recursive --force /var/lib/apt/lists/*
- curl --silent --show-error --location "https://raw.githubusercontent.com/upciti/wakemeops/main/assets/install_repository" | bash
- apt-get install --yes glab
- echo "Configuring glab"
- echo $GITLAB_HOST
- echo "Creating Dropstone auth configuration"
- mkdir --parents ~/.local/share/dropstone
- |
cat > ~/.local/share/dropstone/auth.json << EOF
{
"dropstone": {
"type": "api",
"key": "$DROPSTONE_API_KEY"
}
}
EOF
- echo "Configuring git"
- git config --global user.email "dropstone@gitlab.com"
- git config --global user.name "Dropstone"
- echo "Testing glab"
- glab issue list
- echo "Running Dropstone"
- |
dropstone run "
You are an AI assistant helping with GitLab operations.
Context: $AI_FLOW_CONTEXT
Task: $AI_FLOW_INPUT
Event: $AI_FLOW_EVENT
Please execute the requested task using the available GitLab tools.
Be thorough in your analysis and provide clear explanations.
Use the glab CLI to access data from GitLab. The glab CLI is already authenticated.
If you are asked to summarize an MR or issue, or provide more information,
post back a note to the MR/Issue so the user can see it.
"
- git checkout --branch $CI_WORKLOAD_REF origin/$CI_WORKLOAD_REF
- echo "Checking for git changes and pushing if any exist"
- |
if ! git diff --quiet || ! git diff --cached --quiet || [ -n "$(git ls-files --others --exclude-standard)" ]; then
echo "Git changes detected, adding and pushing..."
git add .
if git diff --cached --quiet; then
echo "No staged changes to commit"
else
echo "Committing changes to branch: $CI_WORKLOAD_REF"
git commit --message "Dropstone changes"
echo "Pushing changes up to $CI_WORKLOAD_REF"
git push "https://gitlab-ci-token:$GITLAB_TOKEN@$GITLAB_HOST/$CI_PROJECT_PATH.git" $CI_WORKLOAD_REF
echo "Changes successfully pushed"
fi
else
echo "No git changes detected, skipping push"
fi
variables:
- DROPSTONE_API_KEY
- GITLAB_TOKEN_DROPSTONE
- GITLAB_HOST
자세한 지침은 GitLab Duo Agent Platform 문서를 참조하세요.
예시
GitLab에서 Dropstone을 사용할 수 있는 몇 가지 예시입니다.
Tip
@dropstone 외에 다른 트리거 문구를 구성할 수 있습니다.
-
이슈 설명
GitLab 이슈에 다음 댓글을 추가하세요.
@dropstone explain this issueDropstone이 이슈를 읽고 명확한 설명으로 답변합니다.
-
이슈 수정
GitLab 이슈에서 다음과 같이 말하세요:
@dropstone fix thisDropstone이 새 브랜치를 만들고 변경 사항을 구현한 후 변경 사항이 포함된 머지 리퀘스트를 엽니다.
-
머지 리퀘스트 검토
GitLab 머지 리퀘스트에 다음 댓글을 남기세요.
@dropstone review this merge requestDropstone이 머지 리퀘스트를 검토하고 피드백을 제공합니다.