Closed AndyZe closed 1 month ago
I guess you'll tell me to set - export VERBOSE_OUTPUT=true
so we can see what's going on.
Edit: that doesn't give any new info.
My guess is, it's a permissions issue with cloning the other repos in our org.
OK, I've verified that it is a permissions issue with cloning the other repos in our org. Now need to find a way to circumvent this with Bitbucket...
I think what I need to do is place a private ssh key in the docker container somehow.
Another option could be to use a deploy token or other kind of token, and then use Git's insteadOf
functionality (docs). You can use that to essentially 'redirect' git clone
s of private repositories to URLs including the (deploy) token (so it would still be the same repository URL, it would now just have authentication information embedded).
In case you do that by generating a .gitconfig
file, you'd write that secret to disk, so consider the implications. You can however also pass Git config elements on the command line, for single invocations, which would avoid that. That would however perhaps be difficult to use with a vcs
based workflow.
Well I haven't tried what gavanderhoorn suggested yet. I'm not that desperate yet. I did try GIT_SSH_COMMAND
which seemed promising to me, but no luck still.
In bitbucket-pipelines.yml:
variables:
# Set SSH keys in industrial_ci container
- DOCKER_RUN_OPTS='-e GIT_SSH_COMMAND="ssh -i .my_repo_name/private_key"'
I still get this error when running. (Which is the same error without it.)
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
setup_upstream_workspace
...
Setting up openssh-client (1:8.9p1-3ubuntu0.10) ...
TRACE:workspace.sh:180 ici_guard vcs import --recursive --force /root/upstream_ws/src
=== /root/upstream_ws/src/aladdin_resources (git) ===
Could not determine ref type of version: no such identity: /opt/atlassian/pipelines/agent/ssh/id_rsa: No such file or directory
git@bitbucket.org: Permission denied (publickey).
fatal: Could not read from remote repository.
I haven't tried what gavanderhoorn suggested yet. I'm not that desperate yet.
it's not such an awful way to do this :) I've seen it used in production at pretty large orgs.
Is it the prettiest? No. But depending on the exact circumstances (ephemeral containers on self-hosted infrastructure fi) it could be an acceptable way to get this to work.
Proper SSH setup would indeed be better though.
OK, i got it working by cloning my private deps into the CI build/ folder before running the .industrial_ci/bitbucket.sh
script :+1:
image: docker:git
pipelines:
default:
- step:
size: 2x # More memory
services:
- docker
script:
- export DOCKER_IMAGE="ros:humble"
- apk add --update bash coreutils tar
# Move aladdin_monitors_1 files from build/ to build/aladdin_monitors_1 so we can clone deps in the same ws
- mkdir ./aladdin_monitors_1
- mv $(ls --ignore=aladdin_monitors_1) ./aladdin_monitors_1
# Clone deps
# After this, we should have several packages in this build folder
- git clone -b main git@bitbucket.org:my_org/aladdin_resources.git
# Other dependencies go in the upstream workspace
- export UPSTREAM_WORKSPACE="github:PickNikRobotics/bio_ik#ros2"
- git clone --quiet --depth 1 https://github.com/ros-industrial/industrial_ci .industrial_ci -b master
- .industrial_ci/bitbucket.sh ROS_DISTRO=humble
In
bitbucket-pipelines.yaml
, adding this line causes my pipeline to hang:Specifically, the log says it hangs here: