Download
We're evolving to serve you better! This current forum has transitioned to read-only mode. For new discussions, support, and engagement, we've moved to GitHub Discussions.

Git synchronization with gitlab

  • #11036
    Avatar photo[anonymous]

    Hi,

    I have just read that both github and gitlab synchronizations will be deprecated in favor of git https://getpublii.com/docs/host-static-website-git-repository.html. Does this mean that it will not possible anymore to have a website hosted by github and gitlab? If not, how can I reconfigure my website to use git with gitlab?

    Thank you

    #11037
    Avatar photo[anonymous]

    Hi,

    In Publii v.0.46 (probably at January-February 2024) we will remove Github Pages and Gitlab Pages. It is because sync via git is much more efficient and faster than using just API.

    In the repository URL you must put URL with the following scheme: https://gitlab.com/USERNAME/REPOSITORY_NAME.git

    Other options in my opinion are self-explaining

    #11053
    Avatar photo[anonymous]

    Bummer. The “Test connection” still fails, and synchronization doesn’t go further than “Compressing objects.”

    #11057
    Avatar photo[anonymous]
    Tomasz Dziuda wrote:

    Hi,

    In Publii v.0.46 (probably at January-February 2024) we will remove Github Pages and Gitlab Pages. It is because sync via git is much more efficient and faster than using just API.

    In the repository URL you must put URL with the following scheme: https://gitlab.com/USERNAME/REPOSITORY_NAME.git

    Other options in my opinion are self-explaining

    Ok. Does I still need to create a .gitlab-ci.yml file? Or should I create an empty repository with the URL above https://gitlab.com/USERNAME/REPOSITORY_NAME.git?

    Thank you

    P.S. I saw too many issues with this new method. I will try again with 0.46 version.

    #11058
    Avatar photo[anonymous]

    Problems remain. I can’t upload my site.

    Then again, the ‘old’ connector for Github doesn’t work for me either, even though I strictly followed all the steps in these tutorials:

    https://getpublii.com/docs/host-static-website-github-pages.html

    https://getpublii.com/docs/host-static-website-git-repository.html

    The only thing I can think of, is: I’m totally new to Github, never uploaded anything in the past. Perhaps there are extra things I should do to “activate” my account or so…

    Anyway, all may web sites are hosted on Netlify and that works fine for me, so I’m not concerned. Was just eager to have explore a backup option for the future.

    Keep up the good work guys! I still love you and got several friends started with Publii.

    (Tomasz: if it can help you, I’d be happy to share my Github password with you privately; there’s nothing on my Github anyway 🙂 )

    #11062
    Avatar photo[anonymous]

    Regarding .gitlab-ci.yml file – please put it in Tools -> File Manager – the main difference according to the old config is script which creates public directory from the repository contents

    pages:
      stage: deploy
      script:
        - mkdir .public
        - cp -r * .public
        - mv .public public
      artifacts:
        paths:
          - public
      only:
        - main
    #11065
    Avatar photo[anonymous]

    Hi,

    I reverted back to the previous gitlab page synchronization https://getpublii.com/docs/host-static-website-gitlab-pages.html. Now publii can synchronize with the server, however the website is broken. Should I need to change something else in the configuration? Or is there something broken in the update?

    Thank you

    #11084
    Avatar photo[anonymous]

    Hi,

    I repeated the procedure described here several times https://getpublii.com/docs/host-static-website-gitlab-pages.html, however I still cannot synchronize my website properly. The connection test returns good status, while I always get such error during synching. What can I do?

    Thank you

    #11088
    Avatar photo[anonymous]

    @alfredo – please try to use Git sync anyway – please remember to add .gitlab-ci.yml file to Tools -> File Manager -> root files

    For me it is working fine

    #11093
    Avatar photo[anonymous]
    Tomasz Dziuda wrote:

    @alfredo – please try to use Git sync anyway – please remember to add .gitlab-ci.yml file to Tools -> File Manager -> root files

    For me it is working fine

    I tried again following your suggestion (new file .gitlab-ci.yml inside file manager->root). I was now able to upload the website via git, however the public folder is not present and I am still unable to see the website. There are no errors, except that the connection test never returns a result.

    #11094
    Avatar photo[anonymous]

    @alfredo – the public catalog is created dynamically during the gitlab-pages deployment process and it is not visible on your repository directly – it can finish later than the sync process – please check pipelines in your repository

    #11105
    Avatar photo[anonymous]

    Hi,

    I deleted all files in the repository and I tried the synchronization procedure again. Now I get the following error and I am not able to upload any file.

    #11128
    Avatar photo[anonymous]

    Hi,

    a week has passed and I am still trying to upload my website which is offline. I tried many times with both gitlab and git synchronisation but it didn’t work.

    With gitlab I get this error, deployment-process.log:

    [Fri, 24 Nov 2023 05:41:38 GMT] (!) COMMIT ERROR: {"name":"HTTPError","code":"ERR_NON_2XX_3XX_RESPONSE","timings":{"start":1700804488944,"socket":1700804488968,"lookup":1700804488969,"connect":1700804488987,"secureConnect":1700804489087,"upload":1700804498268,"response":1700804498712,"end":1700804498714,"phases":{"wait":24,"dns":1,"tcp":18,"tls":100,"request":9181,"firstByte":444,"download":2,"total":9770}},"description":"error code: 520"}

    With git the following error, deployment-process.log:

     Git debug: add = .gitlab-ci.yml
     Git debug: git add done
     Git debug: changes exists =  true
     Git debug: commit done
    [Fri, 24 Nov 2023 05:36:51 GMT] ERROR: PushRejectedError: Push rejected because it was not a simple fast-forward. Use "force: true" to override.
    

    The files are uploaded correctly in the public folder except .gitlab-ci.yml which is missing (whereas it is present in Publii->file manager->root).I think there is a problem with Publii as both methods do not work.

    Thank you

    P.S. I tried to manually upload .gitlab-ci.yml, but the pipeline still does not start.

    commit

    #11146
    Avatar photo[anonymous]

    @alfredo – please try to remove output directory for your site and create an empty one manually. Then please try to use the sync again. It seems that you have a sync issue due fact that you have removed files from the repository manually

    #11167
    Avatar photo[anonymous]

    Hi,

    I repeated again the procedure with a fresh repository. Now Publii always synchronizes without any problem. The file .gitlab-ci.yml is present in the root folder of the repository. However, the pipeline does not start both automatically and manually.

    Run pipeline

    Pipeline

    Pipeline editor: the checking never stops.

    Error-2

    What can I do?

    Thank you

    #11230
    Avatar photo[anonymous]

    I am also having a problem synchronising my Gitlab website using the “GIT”repository server type.
    Synchronising via server type “Gitlab” occasionally works, so I stil have an non-reliable alternative.

    The directory I am using with Gitlab is: “https://gitlab.com/h-intveen/wtg”
    When I use “Gitlab”repository server type” Publii syncs the site files to the “https://gitlab.com/h-intveen/wtg/public” folder.
    So the “public” folder already exists.
    I have 2FA enabled and created an access token “wtg” with role “owner” and all permission  levels enabled.

    I try to use publli settings:
    + Repository URL: https://gitlab.com/h-intveen/wtg.git
    + Username: h-intveen@gitlab.com
    + Password/Token: <the “wtg” access token”>

    “Test connection” shows “Checking connection…” but never gives results.
    “Sync your website” results in HTTP Error: 404 Not Found, logs:

    deployment-process.log
    Git debug: add = januari-2024.html

    Git debug: commit done
    [Fri, 01 Dec 2023 15:33:07 GMT] ERROR: HttpError: HTTP Error: 404 Not Found
    ​

    There are no errors in the other files.

    I have also tried disabling 2FA  and using my Gitlab password in “Password/Token” but that resulted in the same error.
    So either I don’t know the correct settings, or publii syncing causes the error.

    When I try “Sync your website” again, it passes but no files are synced: that is clearly an error.
    Looks like there are still issues to be solved before removing Gitlab….

    #11239
    Avatar photo[anonymous]
    h.intveen wrote:

    When I try “Sync your website” again, it passes but no files are synced: that is clearly an error. Looks like there are still issues to be solved before removing Gitlab….

    Hi,

    After two weeks I still have my website offline because of this change. I tried everything: the old version 0.43.1 with gitlab, but I have problems, the new version 0.44.1 with gitlab doesn’t work well, but I managed to get it working with git. Now it always synchronises my website, however the gitlab pipeline does not work.

    I wonder how to solve the problem.

    #11244
    Avatar photo[anonymous]

    @alfredo Hi bro,

    Can you tell me how you managed to sync your website with gitlab?

    I did everything I could, searched everywhere on the interent, reconfigured almost 5 times but still nothing works at all.

    Github repo works very well but gitlab repo doesnt work at all.

    Test connection just says checking connection… and doesnt do anything after that.

    I waited almost half an hour just to check the connection but still nothing happened.

    I tried syncing directly but still nothing works as I said earlier.

    I get this error. connection failed: http 404

    I attached the ss please check it and give me some suggestion on how to fix this issue.

    I’m really frustrated with this issue.

    Somebody please help me.

    #11246
    Avatar photo[anonymous]
    [anonymous] wrote:

    Test connection just says checking connection… and doesnt do anything after that.

    This is the same in my case. I can tell you what I did:

    1. I manually deleted all the files in the gitlab repository.
    2. I changed the configuration in Publii from gitlab to git, by using same account details (author, including email address) and https://gitlab.com/repository/repository.git.
    3. Manually added the .gitlab-ci.yml file in Publii->file manager->root.

    However, gitlab is not able to run the pipeline even if everything seems ok and my website has been down for over two weeks. I hope they are going to release an update that will fix the problems.

    #11247
    Avatar photo[anonymous]

    git method is not working at all with gitlab.

    So I decied to switch back to github and did the setup.

    And now the github repo is also not working.

    It says unathorised 401 even though all the login details are correct.

    Its’ been 4-5 hrs I’m troubleshooting this issue.

    Netlify server is the only method that worked very well without any error. I’ve hosted 4 sites using this method.

    But other methods always give me some kind of errors even though I follow the exact same steps from the publii docs.

    Now I’ve pending 2 projects that has github repo.

    IDK if I should use publii for git or not since it’s not really helping me at all.

    I really hope they fix this git method since it’s not working for many people (I checked the forum too).

    #11248
    Avatar photo[anonymous]

    The only thing that still works sometimes is my old setup with server type “Gitlab”.
    Many times it throws errors 404 or 520, but occasionally it still works.

    I can’t get the new server type “GIT Repositiory” to work with Gitlab, as detailed in my above december 1st post.

    #11269
    Avatar photo[anonymous]

    Yes I can also confirm that GIT sync has still some bugs, here’s my situation.

    Initially I used GitHub to sync, and it worked flawlessly. Then I tried Git in 0.44.1, I managed to sync my existing repo in GitHub using Git, even if (as others stated) “Test Connections” never completes. But! At least the sync is working fine.

    Anyway, I am in the process of finding out how to sync my website elsewhere, not on GitHub. Reason: https://sfconservancy.org/blog/2022/jun/30/give-up-github-launch/

    I would like to use GitLab pages, maybe CodeBerg or SourceHut are even more suitable for what I am looking for, but in this thread I see there are issues in using something not GitHub.

    Can I ask someone skilled in this to create a mini-guide about hosting our Publii site on alternatives more FOSS friendly? Maybe this guide will end up in the Publii documentation.

    #11297
    Avatar photo[anonymous]

    Hi,

    I read that you were working on releasing a fix. Do you have any news as my site has been offline for almost 3 weeks?

    Thank you

    #11303
    Avatar photo[anonymous]

    alfredo – I will investigate all cases in the nearest days. Please remember that you can always generate the manual deployment and put the files via web interface on github/gitlab.

    That’s why we have created the manual deployment method – to avoid situation when due issues with sync it is impossible to publish changes

    #11308
    Avatar photo[anonymous]

    Hello,

    in my case the synchronisation works fine. I found the source of the error, main instead of master in the .gitlab-ci.yml file:

    pages:
      stage: deploy
      script:
        - mkdir .public
        - cp -r * .public
        - mv .public public
      artifacts:
        paths:
          - public
      only:
        - main->master
    #11339
    Avatar photo[anonymous]

    @alfredo – right – I have used new name for the main branch, while older repositories can still use “master” 🙂

    @shivam @h.intveen @aaart – I have tested both Github and Gitlab integration using Git deployment method and it was working fine for me. In fact I cannot reproduce situation when “Test connection” is not working and sync returns 404 or 401 error. I suppose that some people are doing something what breaks the integration but at this moment I do not know what it is :/