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. GitHub Pages
  3. GitHub Pages not sourcing the env.sh file

GitHub Pages not sourcing the env.sh file

Scheduled Pinned Locked Moved GitHub Pages
8 Posts 3 Posters 459 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
    shaunsund
    wrote on last edited by
    #1

    Hello,

    I was using the main branch of a website repo and noticed it wouldn't publish pages.

    Turns out the app isn't sourcing the env.sh file as the output below shows after editing the env.sh file and restarting the app.

    Connecting...
    root@e0458cac-c74c-450f-9784-4ef0999b34cb:/app/code# echo $BUILD_BRANCH
    
    root@e0458cac-c74c-450f-9784-4ef0999b34cb:/app/code# cat ../data/env.sh 
    #!/bin/bash
    
    export BUILD_BRANCH=main
    root@e0458cac-c74c-450f-9784-4ef0999b34cb:/app/code# echo $BUILD_BRANCH
    
    root@e0458cac-c74c-450f-9784-4ef0999b34cb:/app/code# source ../data/env.sh 
    root@e0458cac-c74c-450f-9784-4ef0999b34cb:/app/code# echo $BUILD_BRANCH
    main
    root@e0458cac-c74c-450f-9784-4ef0999b34cb:/app/code# 
    
    

    Thanks!

    J 1 Reply Last reply
    1
    • S shaunsund

      Hello,

      I was using the main branch of a website repo and noticed it wouldn't publish pages.

      Turns out the app isn't sourcing the env.sh file as the output below shows after editing the env.sh file and restarting the app.

      Connecting...
      root@e0458cac-c74c-450f-9784-4ef0999b34cb:/app/code# echo $BUILD_BRANCH
      
      root@e0458cac-c74c-450f-9784-4ef0999b34cb:/app/code# cat ../data/env.sh 
      #!/bin/bash
      
      export BUILD_BRANCH=main
      root@e0458cac-c74c-450f-9784-4ef0999b34cb:/app/code# echo $BUILD_BRANCH
      
      root@e0458cac-c74c-450f-9784-4ef0999b34cb:/app/code# source ../data/env.sh 
      root@e0458cac-c74c-450f-9784-4ef0999b34cb:/app/code# echo $BUILD_BRANCH
      main
      root@e0458cac-c74c-450f-9784-4ef0999b34cb:/app/code# 
      
      

      Thanks!

      J Offline
      J Offline
      joseph
      Staff
      wrote on last edited by
      #2

      @shaunsund the file is sourced in the start up script (ref: https://git.cloudron.io/packages/githubpages-app/-/blob/master/start.sh?ref_type=heads#L14 ) . Did you restart the app after you added the export ?

      S 1 Reply Last reply
      0
      • J joseph

        @shaunsund the file is sourced in the start up script (ref: https://git.cloudron.io/packages/githubpages-app/-/blob/master/start.sh?ref_type=heads#L14 ) . Did you restart the app after you added the export ?

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

        @joseph I restarted the app several times.

        A fresh restart gives me:

        Reconnecting...
        root@e0458cac-c74c-450f-9784-4ef0999b34cb:/app/code# echo $BUILD_BRANCH
        
        root@e0458cac-c74c-450f-9784-4ef0999b34cb:/app/code# source /app/data/env.sh 
        root@e0458cac-c74c-450f-9784-4ef0999b34cb:/app/code# echo $BUILD_BRANCH
        main
        root@e0458cac-c74c-450f-9784-4ef0999b34cb:/app/code# 
        

        Something seems off with the start script - at least when it sources the env.sh file at the start of the container.

        1 Reply Last reply
        1
        • S Offline
          S Offline
          shaunsund
          wrote on last edited by shaunsund
          #4

          @joseph Looking at the Dockerfile, perhaps the BUILD_BRANCH variable is being erased when supervisord is exec'd?

          1 Reply Last reply
          0
          • J Offline
            J Offline
            joseph
            Staff
            wrote on last edited by
            #5

            @shaunsund indeed. looks like it is not sourced in the git hooks. cc @girish

            1 Reply Last reply
            0
            • S Offline
              S Offline
              shaunsund
              wrote on last edited by
              #6

              @joseph Yeah. The git hook would be a better place to read the env.sh

              1 Reply Last reply
              0
              • girishG Offline
                girishG Offline
                girish
                Staff
                wrote on last edited by
                #7

                @shaunsund looks like a bug, I will make a new package with a fix

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  shaunsund
                  wrote on last edited by
                  #8

                  @girish Thanks!

                  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