Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] How alexandrie update the crate-index? #15

Closed
Geobert opened this issue Oct 21, 2019 · 4 comments
Closed

[Question] How alexandrie update the crate-index? #15

Geobert opened this issue Oct 21, 2019 · 4 comments
Labels
C-question Category: Question

Comments

@Geobert
Copy link

Geobert commented Oct 21, 2019

Hi me again!

I manage to build a docker image with alexandrie (Dockerfile here) but I'm still wondering how some things are supposed to work.

I understand we need a git repo to store the crate-index, and when looking at crates.io one, there a lot of thing on the github repo.

What do I need to do?
Only the config.json file and alexandrie will populate our private github repo?

And on the [index] section, what other type are available?

@Hirevo Hirevo added the C-question Category: Question label Oct 21, 2019
@Hirevo
Copy link
Owner

Hirevo commented Oct 21, 2019

Hi !

Better documentation is definitely needed for this and should come very soon (tracked by #6).

Yes, you're totally right, you only need to create a config.json file manually.
Alexandrie will take care of creating the directories as needed (when crates are published).

For the [index] section, the supported types are the variants of the Index enum (found here).
Each variant in that enum is a different index manager.
So, the type field is the name of the chosen variant (in kebab-case).
And, depending on the type chosen, the other fields available are those of the struct stored in the variant.
Currently, only type = "command-line" is supported and the fields for it can be found here.

Using type = "command-line" requires having the git command to be available through the command line.
Implementing more ways to manage the index, including using libgit2 to not depend on the git command, is on the roadmap and tracked by #8.

@Geobert
Copy link
Author

Geobert commented Oct 21, 2019

Thanks for your answer !

What I don't understand, is how alexandrie has permission to write to the githab crate-index :)

PS: (I'm from Epita :D promo 2002)

@Hirevo
Copy link
Owner

Hirevo commented Oct 21, 2019

Alexandrie basically doesn't do anything related to push permissions.
The "command-line" index manager makes changes to a local clone of the index and assumes the git command is configured to be able to push to the remote repository (by having the necessary ssh keys configured, for example).
So, if doing a manual git push on the command line would work, then it will work for Alexandrie too.

Sorry for the delayed response.

PS: Ah, very nice fun-fact. Hi from Epitech (promo 2021) ! 🙋🏽‍♂️

@Geobert
Copy link
Author

Geobert commented Oct 21, 2019

Oh I understand now, it's doing push, and we need the command line to be configured…
So I need to adapt my Docker image to do that. Thank you!

@Geobert Geobert closed this as completed Oct 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-question Category: Question
Projects
None yet
Development

No branches or pull requests

2 participants