Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

submodule files are not available for pipeline after git submodule update executed successfully

Mykhail Martsyniuk November 25, 2020

Hello, community!

 

In a nutshell i have a following test pipeline that drives me crazy:

image: atlassian/default-image:2

pipelines:
default:
- step:
name: 'Init submodule'
script:
- git submodule update --init --recursive
- git submodule status
- step:
name: 'Do something with submodule'
script:
- ls test-lib -al
- step:
name: 'do just clone'
script:
- git clone git@bitbucket.org:mykha/submobule-test-lib.git
- ls submobule-test-lib/*

 What im facing is that first step is executed correctly and has an output like:

+ git submodule update --init --recursive
Submodule 'test-lib' (git@bitbucket.org:mykha/submobule-test-lib.git) registered for path 'test-lib'

Cloning into 'test-lib'...

Warning: Permanently added the RSA host key for IP address '104.192.141.1' to the list of known hosts.

Submodule path 'test-lib': checked out '15755730500ea84a78ef065621ed899f550df6cb'

The commit hash is valid and submodule has some files pushed on it..

But the 2nd step returns empty list of files.

At the same time if i do just a git clone of the same submodule repo (at step 3) it works just fine.  My assumption is that all ssh keys and repo access are just fine.. the problem happens with submodule file tree only.

Am i doing something wrong? Does anyone faced something similar?

 

Update: actually this is how steps are defined in bitbucket pipelines. Submodules are not fetched automatically for each step. My bad =(

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events