• Hello,

    I am still testing out the Gitium plugin.

    I made some edits in the gitignore and CSS on my localhost website, committed and pushed it to the GIT-server. Now in my online website in Gitium I try to save my merged changes, but when I do I get the message: “Temporarily unavailable due to scheduled maintenance. Please try again in a few minutes.” all the time.

    I can delete the .maintenance file in the root of my online website, but everytime I try to get the commit on the online website it keeps saying “Temporarily unavailable due to scheduled maintenance. etc”.

    There is no .maintenance file in any of the (previous commits).

    How can we solve this?

Viewing 15 replies - 1 through 15 (of 21 total)
  • Plugin Author Presslabs

    (@presslabs)

    Hello @rodricus,

    We will check this problem and get back to you!

    Thanks,

    Plugin Author Presslabs

    (@presslabs)

    Hello @rodricus,

    I have reproduced the problem. It appears to occur only when you try to add changes to the website from the remote. As far as I can tell, you have not configured the webhook.

    Could you follow these steps and configure the web book to automatically deploy these changes to your website without the need to click on the save button?

    Webook configuration:

    Gitium uses the webhook to automatically deploy remote changes to your server. To configure it follow these steps:

    1. Go to your WordPress website and go to your Gitium Settings page;
    2. Copy the full Webhook URL that Gitium provides;
    3. In your Git Manager settings, go to Webhook section, add a new webhook and paste the webhook URL you have copied from Gitium.
    4. Press Add, no settings changes needed. The webook simply needs a ping, nothing more. The security key is already embedded in the final URL Gitium has generated for you.

    Now when you push to your repo, this webhook will automatically pull the changes to your remote server and deploy them.

    I’ll also look for a fix for this case when the webhook isn’t configured. Here is the problematic code:

    gitium_enable_maintenance_mode() or wp_die( __( 'Could not enable the maintenance mode!', 'gitium' ) );
    $this->git->add();
    $commitmsg = sprintf( __( 'Merged changes from %s on %s', 'gitium' ), get_site_url(), date( 'm.d.Y' ) );
    if ( isset( $gitium_commit_msg ) && ! empty( $gitium_commit_msg ) ) {
    $commitmsg = $gitium_commit_msg;
    }
    $current_user = wp_get_current_user();
    $commit = $this->git->commit( $commitmsg, $current_user->display_name, $current_user->user_email );
    if ( ! $commit ) {
    $this->redirect( __( 'Could not commit!', 'gitium' ) );
    }

    Your branch is behind \'origin/master\' by 1 commit, and can be fast-forwarded.
    (use "git pull" to update your local branch)
    nothing to commit, working tree clean'/n/n

    Commit failed.


    According to the above message, the code fails and does not reach the end of the code to disable maintenance.

    Thread Starter rodricus

    (@rodricus)

    Hello Presslabs,

    Thank you for your reply.

    I configured the webhook and notice that this works indeed, so that’s nice.

    But will you try to fix this issue with .maintenance file regardless?

    • This reply was modified 1 month, 1 week ago by rodricus.
    Plugin Author Presslabs

    (@presslabs)

    Yes, we are looking for a fix to avoid this problem. For the moment, you can add manually in the file /gitium/inc/class-gitium-submenu-status.php, on the function save_changes above this line https://github.com/presslabs/gitium/blob/master/gitium/inc/class-gitium-submenu-status.php#L113 the following code:

    gitium_disable_maintenance_mode();

    Hello @rodricus,

    Thank you for you patience!

    The issue has been solved on Github https://github.com/presslabs/gitium. Before we release this variant on wp.org, would you be able to test to see if it works correctly? From our end, we didn’t encounter anymore the .maintenance problem.

    Best regards,

    Thread Starter rodricus

    (@rodricus)

    Sure, thats okay. Thanks. Untill which time do I have to test it?

    I am not really a professional GIT-user, I am using GIT occasionelly, so I dont know how much value you can stick to me.

    Plugin Author Presslabs

    (@presslabs)

    Hi @rodricus,

    You just have to clone/download the repository(press on the green button which have the text code, then download zip). After you have the repository cloned, go inside of the folder and you should see another folder gitium, you can add that folder to your repository or create a archive of this folder and upload it in the wordpress admin area.

    Please let me know when you have been able to test it. There is no rush, you can do it when you have time.

    Best regards,

    Plugin Author Presslabs

    (@presslabs)

    Hi, @rodricus!

    Have you been able to test the new version?

    Thanks,

    Thread Starter rodricus

    (@rodricus)

    Sorry for my late reply.

    I uploaded the zip-file of Gitium of Github and configure it with Bitbucket. It said “Repository initialized successfully.”.

    I made a change on the live-site itself and when I press “Push changes”, it says:

    “Merge failed: Unauthorized fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.”

    Plugin Author Presslabs

    (@presslabs)

    Hi @rodricus,

    Where did you add the ssh key? Did you configure the plugin on the same website which was the previous version of gitium?

    Since the status showed that is connected to the repository, can you tell me what do you see on the status page?

    The message error indicates that it doesn’t have write permissions.

    Thanks,

    Thread Starter rodricus

    (@rodricus)

    Hello,

    “Did you configure the plugin on the same website which was the previous version of gitium?”

    Yes I Did.

    “Since the status showed that is connected to the repository, can you tell me what do you see on the status page?”

    connected to [email protected]:Rowdysign/git_test2.git

    “Where did you add the ssh key?”

    At Bitbucket repository settings – Access keys

    Plugin Author Presslabs

    (@presslabs)

    Hi @rodricus,

    Access keys from bitbucket seems to be read-only.

    I’m not familiar with Bitbucket, but you need to grant write access as well.

    Plugin Author Presslabs

    (@presslabs)

    Hi @rodricus,

    If you add the key into the workspace(Workspace Settings -> SSH Keys), it seems that there it has write access.

    Found this topic: https://community.atlassian.com/t5/Bitbucket-questions/How-to-add-an-Access-Key-with-Write-permission/qaq-p/842539

    Best,

    Thread Starter rodricus

    (@rodricus)

    Hello,

    Thanks for the article. I removed the Acces key at my repository. I generated a new SSH Key in the Gitium plugin and copy-pasted that into the Bitbucket Project settings Acces key (like stated in the article).

    Gitium then says the following: “Could not create initial commit -> On branch main nothing to commit, working tree clean”.

    I made some edits on my localhost website and committed and push it, but I don’t see them in Gitium anywhere.

    Plugin Author Presslabs

    (@presslabs)

    Hi @rodricus,

    Gitium then says the following: “Could not create initial commit -> On branch main nothing to commit, working tree clean”.

    I think this is normal because you were using a repo which has already content.

    I made some edits on my localhost website and committed and push it, but I don’t see them in Gitium anywhere.

    What do you see on the status page?

Viewing 15 replies - 1 through 15 (of 21 total)
  • You must be logged in to reply to this topic.