README.md
changeset 123 032aaa29f498
parent 120 02e37d9e96a9
equal deleted inserted replaced
122:ef1c44f741e3 123:032aaa29f498
    45 
    45 
    46 ```
    46 ```
    47 ~/src
    47 ~/src
    48      /beremiz
    48      /beremiz
    49      /beremiz_public_dist
    49      /beremiz_public_dist
    50      /canfestival
       
    51      /matiec
    50      /matiec
    52      /Modbus
    51      /canfestival [optional]
       
    52      /Modbus      [optional]
       
    53      /open62541   [optional]
    53 ```
    54 ```
    54 
    55 
    55 Repositories can be cloned from https://hg.beremiz.org .
    56 Repositories can be cloned from https://hg.beremiz.org .
    56 
    57 
    57 Intermediate and final results are all placed in a single 'build directory'
    58 Intermediate and final results are all placed in a single 'build directory'
    65 
    66 
    66 Synopsis:
    67 Synopsis:
    67 
    68 
    68     ./rebuild_docker.sh [build directory]
    69     ./rebuild_docker.sh [build directory]
    69 
    70 
    70 Example:
       
    71 
       
    72 ```
       
    73 #!sh
       
    74 mkdir ~/src ~/build
       
    75 cd ~/src
       
    76 hg clone https://hg.beremiz.org/beremiz_public_dist
       
    77 cd beremiz_public_dist
       
    78 ./rebuild_docker.sh
       
    79 ```
       
    80 
    71 
    81 Source and Build Volumes :
    72 Source and Build Volumes :
    82  
    73  
    83  Role             | Docker Volume     | Host path in example | Rationale
    74  Role             | Docker Volume     | Host path in example | Rationale
    84 ------------------|-------------------|----------------------|------------------------------------------------
    75 ------------------|-------------------|----------------------|------------------------------------------------
   124 snapcraft.yaml does not rely on HG or GIT repos, but refers to local sources, this is responsibility of caller to prepare sources for snapcraft.
   115 snapcraft.yaml does not rely on HG or GIT repos, but refers to local sources, this is responsibility of caller to prepare sources for snapcraft.
   125 
   116 
   126 Reasons for this are :
   117 Reasons for this are :
   127  - no parameters or conditional variables exist to tell snapcraft.yaml where to get the source from
   118  - no parameters or conditional variables exist to tell snapcraft.yaml where to get the source from
   128  - building from local source should be always possible
   119  - building from local source should be always possible
   129  - revisions.txt must be updated in any case so that it is always possible to know what version wqas used to build resulting package
   120  - revisions.txt must be updated in any case so that it is always possible to know what version was used to build resulting package
   130  - when Snap is built from GitHub actions, Makefile isn't used at all, and GitHub action workflow organize sources and revisions.txt on its own.
   121  - when Snap is built from GitHub actions, Makefile isn't used at all, and GitHub action workflow organize sources and revisions.txt on its own.
   131 
   122 
   132 In the end, instead of just calling `snapcraft` to get a snap package, it is more complicated:
   123 In the end, instead of just calling `snapcraft` to get a snap package, it is more complicated:
   133 
   124 
   134 ```
   125 ```
   135 #!sh
   126 # assuming source repositories are cloned in ~/src 
   136 mkdir ~/src ~/build
   127 # and build happens in ~/build
   137 cd ~/src
   128 
   138 hg clone https://hg.beremiz.org/beremiz_public_dist
       
   139 cd ~/build
   129 cd ~/build
   140 make -f ~/src/beremiz_public_dist/Makefile DIST=snap
   130 make -f ~/src/beremiz_public_dist/Makefile DIST=snap
   141 
   131 
   142 ```
   132 ```
   143 Resulting snap package is sources/beremiz_${version}_${platform}.snap.
   133 Resulting snap package is sources/beremiz_${version}_${platform}.snap.
   144 It can be installed this way:
   134 It can be installed this way:
   145 
   135 
   146 ```
   136 ```
   147 sudo snap install sources/beremiz_1.3-beta2_amd64.snap --dangerous --devmode
   137 sudo snap install sources/beremiz_1.4-beta2_amd64.snap --dangerous --devmode
   148 ```
   138 ```
   149 
   139