github.com/jonsyu1/godel@v0.0.0-20171017211503-64567a0cf169/docs/Update-gödel.md (about)

     1  Summary
     2  -------
     3  The version of gödel used by a project can be updated by updating the `godel/config/godel.properties` file, running
     4  `./godelw update` and checking in the updated files.
     5  
     6  Tutorial start state
     7  --------------------
     8  
     9  * `$GOPATH/src/github.com/nmiyake/echgo` exists and is the working directory
    10  * Project contains `godel` and `godelw`
    11  * Project contains `main.go`
    12  * Project contains `.gitignore` that ignores IDEA files
    13  * Project contains `echo/echo.go`, `echo/echo_test.go` and `echo/echoer.go`
    14  * `godel/config/dist.yml` is configured to build `echgo`
    15  * Project is tagged as 0.0.1
    16  * `godel/config/dist.yml` is configured to create distributions for `echgo`
    17  * Project is tagged as 0.0.2
    18  * Go files have license headers
    19  * `godel/config/generate.yml` is configured to generate string function
    20  * `godel/config/exclude.yml` is configured to ignore all `.+_string.go` files
    21  * `integration_test` contains integration tests
    22  * `godel/config/test.yml` is configured to specify the "integration" tag
    23  * `docs` contains documentation
    24  * `.circleci/config.yml` exists
    25  * Project is tagged as 1.0.0
    26  
    27  ([Link](https://github.com/nmiyake/echgo/tree/25d27eb1763e55f228282594691798ca0c2bbe28))
    28  
    29  Update gödel
    30  ------------
    31  
    32  The version of gödel used by a project can be updated by updating the `godel/config/godel.properties` file and running
    33  the `./godelw update` command.
    34  
    35  Updating gödel requires knowing the distribution URL for the target version. Although it is optional, it is recommended
    36  to have the SHA-256 checksum of the distribution as well to ensure the integrity of the update.
    37  
    38  Information for the latest release can be found on gödel's [Bintray page](https://bintray.com/palantir/releases/godel).
    39  This page also displays the SHA-256 checksum for the distribution:
    40  
    41  ![SHA checksum](images/tutorial/sha_checksum.png)
    42  
    43  The tutorial used version 0.26.0 of gödel, but version 0.27.0 also exists. Update the version of gödel used by the
    44  project by running the following:
    45  
    46  ```
    47  ➜ echo 'distributionURL=https://palantir.bintray.com/releases/com/palantir/godel/godel/0.27.0/godel-0.27.0.tgz
    48  distributionSHA256=0869fc0fb10b4cdd179185c0e59e28a3568c447a2a7ab3d379d6037900a96bf3' > godel/config/godel.properties
    49  ➜ ./godelw update
    50  Getting package from https://palantir.bintray.com/releases/com/palantir/godel/godel/0.27.0/godel-0.27.0.tgz...
    51   10.74 MB / 10.74 MB [======================================================================================] 100.00% 4s
    52  ```
    53  
    54  The `./godelw update` operation compares the project's current version of gödel with the version specified in
    55  `godel/config/godel.properties`. If the versions do not match, it downloads the version specified in the properties file
    56  and updates the files in the project as necessary.
    57  
    58  Updating gödel will typically update the `godelw` wrapper file and may add new configuration files to the `godel/config`
    59  directory. All existing configuration will remain unmodified.
    60  
    61  Check in the update by running the following:
    62  
    63  ```
    64  ➜ git add godelw godel
    65  ➜ git commit -m "Update godel to 0.27.0"
    66  [master 3825f36] Update godel to 0.27.0
    67   2 files changed, 5 insertions(+), 5 deletions(-)
    68  ```
    69  
    70  The `godelw` wrapper ensures that the required version of gödel is present on the system (downloading it if necessary)
    71  on every invocation, so when other developers (or the CI system) checks out a version of the project that updates the
    72  version of gödel that is used, the first `./godelw` command they invoke will ensure that the updated version is
    73  available. This ensures that all gödel operations are always using the correct version of the program.
    74  
    75  Tutorial end state
    76  ------------------
    77  
    78  * `$GOPATH/src/github.com/nmiyake/echgo` exists and is the working directory
    79  * Project contains `godel` and `godelw`
    80  * Project contains `main.go`
    81  * Project contains `.gitignore` that ignores IDEA files
    82  * Project contains `echo/echo.go`, `echo/echo_test.go` and `echo/echoer.go`
    83  * `godel/config/dist.yml` is configured to build `echgo`
    84  * Project is tagged as 0.0.1
    85  * `godel/config/dist.yml` is configured to create distributions for `echgo`
    86  * Project is tagged as 0.0.2
    87  * Go files have license headers
    88  * `godel/config/generate.yml` is configured to generate string function
    89  * `godel/config/exclude.yml` is configured to ignore all `.+_string.go` files
    90  * `integration_test` contains integration tests
    91  * `godel/config/test.yml` is configured to specify the "integration" tag
    92  * `docs` contains documentation
    93  * `.circleci/config.yml` exists
    94  * Project is tagged as 1.0.0
    95  * `godelw` is updated to 0.27.0
    96  
    97  ([Link](https://github.com/nmiyake/echgo/tree/3825f36b06ee50703ad10e01068ceb13e7719acd))
    98  
    99  Tutorial next step
   100  ------------------
   101  [Other commands](https://github.com/palantir/godel/wiki/Other-commands)