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

Use https to clone build system repos #15

Merged
merged 2 commits into from
Feb 29, 2024

Conversation

metalefty
Copy link
Member

While here, remove duplicate entry for alma-tests-cacher.

Resolves: AlmaLinux/build-system#182

While here, remove duplicate entry for alma-tests-cacher.

Resolves: AlmaLinux/build-system#182
Copy link
Contributor

@zklevsha zklevsha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I not sure that we should switch to https to be honest
Dev deploy is created mainly for development env, and contributing with ssh remote is more convinient because we can push without password authentication

Maybe we can add addtional variable clone_with_ssh = true/false and based on that variable generate correct remote urls?

@metalefty
Copy link
Member Author

I use HTTPS to clone and I add SSH URL to push in my environment.

% git remote -v
origin  https://github.com/AlmaLinux/albs-web-server.git (fetch)
origin  git@github.com:AlmaLinux/albs-web-server.git (push)

One of the reasons why I made this pull request is you added HTTPS URL recently. I thought you prefer HTTPS rather than SSH.

@zklevsha
Copy link
Contributor

I dont have strong opinion on https vs ssh, but maybe yours example will be the best solution i.e.
fetch with https and push ssh:

origin  https://github.com/AlmaLinux/albs-web-server.git (fetch)
origin  git@github.com:AlmaLinux/albs-web-server.git (push)

I did not found how we can update remote with ansible git module, but we always can use command module for updating origin

@codyro
Copy link
Member

codyro commented Feb 13, 2024

I did not found how we can update remote with ansible git module, but we always can use command module for updating origin

I'm not sure if this will work, but with the git_config module you may be able to do something like this:

(untested)

- name: Update git repository
  hosts: all
  tasks:
    - name: Update repository fetch url
      community.general.git_config:
        repo: ./somerepo
        name: remote.origin.url
        value: https://github.com/codyro/somerepo.git
        scope: local

    - name: Update repository push url
      community.general.git_config:
        repo: ./somerepo
        name: remote.origin.pushurl
        value: git@github.com:codyro/somerepo.git
        scope: local

@metalefty
Copy link
Member Author

Added a task to set pushurl as @codyro mentioned. I confirmed it works for me.

@Korulag Korulag merged commit 0adf197 into AlmaLinux:master Feb 29, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

albs-deploy: use https to clone build system repos
4 participants