Changed how git clone works
Some checks failed
Some checks failed
This commit is contained in:
parent
66a1220aaa
commit
a0c5bca0ae
1 changed files with 9 additions and 7 deletions
|
@ -64,16 +64,18 @@ jobs:
|
|||
echo "DinD container setup complete"
|
||||
fi
|
||||
|
||||
- name: Checkout code to DinD container
|
||||
- name: Checkout code to workspace
|
||||
run: |
|
||||
# Create workspace directory in DinD container
|
||||
docker exec ci-dind mkdir -p /workspace
|
||||
# Create workspace directory
|
||||
mkdir -p /workspace
|
||||
|
||||
# Checkout code directly into DinD container using the Forgejo repository that triggered the build
|
||||
docker exec ci-dind sh -c "cd /workspace && ls -la && rm -rf * .* 2>/dev/null || true && ls -la && git clone ${{ env.GITEA_SERVER_URL }}/${{ env.GITEA_REPOSITORY }}.git temp-repo && cp -r temp-repo/. . && rm -rf temp-repo"
|
||||
# Clone the repository to workspace
|
||||
git clone "${{ env.GITEA_SERVER_URL }}/${{ env.GITEA_REPOSITORY }}" /workspace
|
||||
cd /workspace
|
||||
git checkout "${{ env.GITEA_SHA }}"
|
||||
|
||||
# Copy docker-compose.test.yml to DinD container (in case it's not in the repo)
|
||||
docker cp docker-compose.test.yml ci-dind:/workspace/ || true
|
||||
# Copy workspace to DinD container
|
||||
docker cp /workspace/. ci-dind:/workspace/
|
||||
|
||||
# Start testing environment using dedicated compose file inside DinD
|
||||
docker exec ci-dind docker compose -f /workspace/docker-compose.test.yml up -d
|
||||
|
|
Loading…
Add table
Reference in a new issue