You are not logged in.

#1 2016-09-28 08:23:49

vegas
Member
Registered: 2014-05-25
Posts: 7

[SOLVED]Deployment Keys in PKGBUILD

Hi, I making my first attempt to write a PKGBUILD file. To fetch the desired software, one need a deployment key to grade the access to the git repository. So I want to serve this key along with the PKGBUILD file. During the makepkg process, the GIT_SSH_COMMAND variable should temporary be modified to use the key while downloading the sources. The easy way is to write a script and placing it inside the build() function. But I think it should be somewere between prepare() and build(), not inside build(). Any suggestions? Tank you!

Last edited by vegas (2016-09-28 14:16:13)

Offline

#2 2016-09-28 12:40:13

Lone_Wolf
Forum Moderator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,920

Re: [SOLVED]Deployment Keys in PKGBUILD

Since it changes the contents of $srcdir, the prepare() function seems appropriate.

There's another issue here though: Is that development key posted publicly or do you need to register ?
if the latter, there's a big chance you're not allowed to share the key.

Have you asked the repo owner about anonymous read-only access ?


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#3 2016-09-28 13:25:43

vegas
Member
Registered: 2014-05-25
Posts: 7

Re: [SOLVED]Deployment Keys in PKGBUILD

Thank you so far! I am the owner of the repo and currently I don't intend to share this project. But I need a sneak way to build test environments on different mashines.

I thought prepare is executed after downloading the sources. So I still need to run a script. It is not possible to add the key temporary in a appropriate location and then use the sources for fetching the repository?

Offline

#4 2016-09-28 13:45:40

Lone_Wolf
Forum Moderator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,920

Re: [SOLVED]Deployment Keys in PKGBUILD

The options for git-sources in PKGBUILD are rather limited and only allow specifying branch,commit or tag.

In theory you could write your own Download Agent that allows adding a key, but that's tricky to get right and not worth the work imo.
(especially for a first PKGBUILD )

That leaves 2 options : use shell code to download from the git repo ( before makepkg got VCS support all vcs packages worked that way) or do it manually outside of the PKGBUILD.

a few extra lines in the prepare function seems to be the easiest / most flexible solution.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#5 2016-09-28 13:55:26

vegas
Member
Registered: 2014-05-25
Posts: 7

Re: [SOLVED]Deployment Keys in PKGBUILD

Thanks a lot! I will try to fetch the repo inside of prepare.

The one thing left is how I mark this thread as solved?

Offline

#6 2016-09-28 14:11:19

Lone_Wolf
Forum Moderator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,920

Re: [SOLVED]Deployment Keys in PKGBUILD

yw, just edit the first post and change the title.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#7 2016-09-28 22:49:39

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: [SOLVED]Deployment Keys in PKGBUILD

If you are running makepkg as your user, then it will use git with your ~/.ssh/config and be able access the repo. I believe that may be used in some cases in the AUR right now actually.

Likewise with HTTPS, except makepkg will invoke git which will ask you for your authentication details.

...

Just use "git+ssh://git.example.com/repo.git" in the sources array.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

Board footer

Powered by FluxBB