cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
537
Views
6
Helpful
2
Replies

How to properly use <package-store> and <package> to pull packages from "git"?

juacosta
Cisco Employee
Cisco Employee

I created a NCS project  for my custom NSO package. I am trying to dynamically pull the dependencies of my package using the project-meta-data.xml. I have defined the following entries

<packages-store>

      <git>

        <repo>ssh://git@github.com/MyUser/net-auto-common.git</repo>

        <branch>develop</branch>

      </git>

    </packages-store>

  <package>

    <name>svc-notifications</name>

    <git/>

  </package>

<package>

    <name>svc-actions</name>

    <git/>

  </package>

When I do ncs-project update -v (included in NSO 4.4.1) , ncs-project fails indicating it cannot clone the repository. From the error, I figured out  ncs-project it is assuming my two packages svc-notifications and svc-actions are git submodules.


ncs-project error: {error,"failed to clone repository ~p\n",

                          ["git@github.com/MyUser/net-auto-common.git/svc-notifications.git"]}Trace: [{ncs_project,

                                                                                                         install_git_repo,

                                                                                                         3,

I have put both packages on its own repo and made them git submodules. Issue still exists.

However, if I declare the each package and specify each of its repos, ncs-project runs with no issues .

                                                                                           

<package>

    <name>svc-notifications</name>

      <git>

        <repo>ssh://git@github.com/MyUser/svc-notifications.git</repo>

        <branch>develop</branch>

      </git

  </package>

1 Accepted Solution

Accepted Solutions

frjansso
Cisco Employee
Cisco Employee

I believe this is what you want:

<packages-store>

      <git>

        <repo>ssh://git@github.com/MyUser</repo>

      </git>

</packages-store>

<package>

    <name>svc-notifications</name>

    <git>

      <branch>master</branch>

    </git>

  </package>

<package>

    <name>svc-actions</name>

    <git>

      <tag>v1.0.1</tag>

    </git>

  </package>

This will get github.com/MyUser/svc-notifications and github.com/MyUser/svc-actions

Please note you can also skip the packages-store and just do

<package>

    <name>svc-notifications</name>

    <git>

      <repo>ssh://git@github.com/MyUser/svc-notifications.git</repo>

      <branch>master</branch>

    </git>

  </package>

View solution in original post

2 Replies 2

frjansso
Cisco Employee
Cisco Employee

I believe this is what you want:

<packages-store>

      <git>

        <repo>ssh://git@github.com/MyUser</repo>

      </git>

</packages-store>

<package>

    <name>svc-notifications</name>

    <git>

      <branch>master</branch>

    </git>

  </package>

<package>

    <name>svc-actions</name>

    <git>

      <tag>v1.0.1</tag>

    </git>

  </package>

This will get github.com/MyUser/svc-notifications and github.com/MyUser/svc-actions

Please note you can also skip the packages-store and just do

<package>

    <name>svc-notifications</name>

    <git>

      <repo>ssh://git@github.com/MyUser/svc-notifications.git</repo>

      <branch>master</branch>

    </git>

  </package>

Fredrik

Thanks a lot for the reply. I tried your suggestion and it works. To summarize, the individual packages I want to use as dependencies must be on their own repo.

Is there any chance we can get the NSO Developer's Guide updated to include a note that describes that behavior. Also the ability to pull a code base by tag. Lastly, can we document what other attributes can be specified on  the <git> </git> grouping. It will be great.

--Juan