Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. LAMP
  3. "git push" (ci/cd) workflow for the LAMP app

"git push" (ci/cd) workflow for the LAMP app

Scheduled Pinned Locked Moved LAMP
5 Posts 3 Posters 1.2k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S Offline
      S Offline
      simon
      wrote on last edited by
      #1

      With traditional Webhosting we deploy our Websites with gitlab runner and git push.
      When I think about Website Hosting via Cloudron I also need a continuous delivery workflow.
      So what are the options?

      With the official LAMP App I see only a cron based workflow, like @murgero describes in https://forum.cloudron.io/post/4654
      Of course, it would be better to be able to trigger an update script differently. For example, as with the surfer app via CLI and token. https://docs.cloudron.io/apps/surfer/#cicd-integration
      Are there for the LAMP App perhaps already possibilities here or is something like this planned for the future?

      The alternative would probably be a costum app, but here I lack the experience so far. Seems to me also much overhead for the desired feature.
      But maybe I am wrong?

      girishG 1 Reply Last reply
      0
      • S simon

        With traditional Webhosting we deploy our Websites with gitlab runner and git push.
        When I think about Website Hosting via Cloudron I also need a continuous delivery workflow.
        So what are the options?

        With the official LAMP App I see only a cron based workflow, like @murgero describes in https://forum.cloudron.io/post/4654
        Of course, it would be better to be able to trigger an update script differently. For example, as with the surfer app via CLI and token. https://docs.cloudron.io/apps/surfer/#cicd-integration
        Are there for the LAMP App perhaps already possibilities here or is something like this planned for the future?

        The alternative would probably be a costum app, but here I lack the experience so far. Seems to me also much overhead for the desired feature.
        But maybe I am wrong?

        girishG Do not disturb
        girishG Do not disturb
        girish
        Staff
        wrote on last edited by
        #2

        @simon Yeah, agreed. Instead of making a custom app, I would much prefer to implement it in the app or Cloudron itself.

        Can you tell me a bit more about your git push workflow? I guess the runner would deploy the site with SSH keys? How does the Website Hosting side look like for this setup? Do you simply just "git init" and ssh+git takes care of git push working (or do you have some specialized software to managed ssh deploy keys etc) ?

        S 1 Reply Last reply
        0
        • girishG girish

          @simon Yeah, agreed. Instead of making a custom app, I would much prefer to implement it in the app or Cloudron itself.

          Can you tell me a bit more about your git push workflow? I guess the runner would deploy the site with SSH keys? How does the Website Hosting side look like for this setup? Do you simply just "git init" and ssh+git takes care of git push working (or do you have some specialized software to managed ssh deploy keys etc) ?

          S Offline
          S Offline
          simon
          wrote on last edited by
          #3

          @girish

          Do you simply just "git init" and ssh+git takes care of git push working (or do you have some specialized software to managed ssh deploy keys etc) ?

          yes, all quite simple. git + ssh key, no special software. It's a simple shell runner.
          After the git push we log in again via SSH to trigger an install script. Of course this could be done in another way.

          $ git push ssh://user@example.com:/var/www/vhosts/site/httpdocs/site HEAD:refs/heads/master --tags
          $ ssh user@example.com "cd /var/www/vhosts/site/httpdocs/site  && git checkout -f master && chmod +x .bin/publish-tag && .bin/publish-tag"
          

          "publish-tag" is a bash script, with some CMS specific installation routines like composer install and drush commands (in case of Drupal as CMS) or some php artisan commands for Laravel based projects.

          1 Reply Last reply
          0
          • nebulonN Offline
            nebulonN Offline
            nebulon
            Staff
            wrote on last edited by
            #4

            I guess there are a few ways we could implement this. Besides the actual git push to get things deployed, the question then is how to run post-deployment scripts and how the main process if any is run.

            We could follow what heroku is doing here with procfiles or we could have a very simple git hook, which simply runs an executable/shell script at a well-defined path (say ./start.sh) after git push.

            Also similar to the github pages, some stacks like nodejs, rails, ... could be pre-installed. However that might complicate updating those without breaking existing ones a lot.

            girishG 1 Reply Last reply
            0
            • nebulonN nebulon

              I guess there are a few ways we could implement this. Besides the actual git push to get things deployed, the question then is how to run post-deployment scripts and how the main process if any is run.

              We could follow what heroku is doing here with procfiles or we could have a very simple git hook, which simply runs an executable/shell script at a well-defined path (say ./start.sh) after git push.

              Also similar to the github pages, some stacks like nodejs, rails, ... could be pre-installed. However that might complicate updating those without breaking existing ones a lot.

              girishG Do not disturb
              girishG Do not disturb
              girish
              Staff
              wrote on last edited by
              #5

              @nebulon I think for a start just making ssh based git push/pull work with hooks on the Github Pages and LAMP app is good enough. I think for rest of the "complicated" apps, we have to really make some container based PaaS, where we build the container as well (just like Heroku). That's a really long term feature.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Bookmarks
                • Search