Skip to content

Update godel

Nick Miyake edited this page Apr 2, 2021 · 4 revisions

Summary

The version of gödel used by a project can be updated by running ./godelw update.

Tutorial start state

  • ${GOPATH}/src/${PROJECT_PATH} exists, is the working directory and is initialized as a Git repository and Go module
  • Project contains godel and godelw
  • Project contains main.go
  • Project contains .gitignore that ignores GoLand files
  • Project contains echo/echo.go, echo/echo_test.go and echo/echoer.go
  • godel/config/dist-plugin.yml is configured to build echgo2
  • Project is tagged as 0.0.1
  • godel/config/dist-plugin.yml is configured to create distributions for echgo
  • Project is tagged as 0.0.2
  • dockerctx directory exists and godel/config/dist-plugin.yml is configured to build Docker images for the product
  • Go files have license headers
  • godel/config/godel.yml is configured to add the go-generate plugin
  • godel/config/generate-plugin.yml is configured to generate string function
  • godel/config/godel.yml is configured to ignore all .+_string.go files
  • integration_test contains integration tests
  • godel/config/test-plugin.yml is configured to specify the "integration" tag
  • docs contains documentation
  • .circleci/config.yml exists
  • Project is tagged as 1.0.0

Update gödel

The version of gödel used by a project can be updated by running the ./godelw update command.

The ./godelw update operation compares the project's current version of gödel with the latest released version according to GitHub. The query for the latest release is performed at most once per hour by default. The --cache-duration flag can be used to modify this. If the current version does not match the latest version, it downloads the latest version and updates the files in the project as necessary.

Updating gödel will typically update the godelw wrapper file and may add new configuration files to the godel/config directory. Updating gödel will also run the upgrade-configuration command, which will upgrade the configuration for all of the loaded plugins if necessary. Any files that are updated are always backed up first.

Currently, the tutorial uses the latest available version, so the update task has no effect.

The godelw wrapper ensures that the required version of gödel is present on the system (downloading it if necessary) on every invocation, so when other developers (or the CI system) checks out a version of the project that updates the version of gödel that is used, the first ./godelw command they invoke will ensure that the updated version is available. This ensures that all gödel operations are always using the correct version of the program.

Tutorial end state

  • ${GOPATH}/src/${PROJECT_PATH} exists, is the working directory and is initialized as a Git repository and Go module
  • Project contains godel and godelw
  • Project contains main.go
  • Project contains .gitignore that ignores GoLand files
  • Project contains echo/echo.go, echo/echo_test.go and echo/echoer.go
  • godel/config/dist-plugin.yml is configured to build echgo2
  • Project is tagged as 0.0.1
  • godel/config/dist-plugin.yml is configured to create distributions for echgo
  • Project is tagged as 0.0.2
  • dockerctx directory exists and godel/config/dist-plugin.yml is configured to build Docker images for the product
  • Go files have license headers
  • godel/config/godel.yml is configured to add the go-generate plugin
  • godel/config/generate-plugin.yml is configured to generate string function
  • godel/config/godel.yml is configured to ignore all .+_string.go files
  • integration_test contains integration tests
  • godel/config/test-plugin.yml is configured to specify the "integration" tag
  • docs contains documentation
  • .circleci/config.yml exists
  • Project is tagged as 1.0.0
  • godelw is updated to the latest version

Tutorial next step

Other commands

More

Update to a specific version

The --version flag can be used to upgrade gödel to a specific version.

Provide a checksum

The --checksum flag can be used to specify the expected checksum for the update.

Sync installation to contents of godel/config/godel.properties

The --sync flag can be used to specify that the update operation should update gödel to match the values specified in the godel/config/godel.properties file. The file should be edited to match the desired state first.

Updating gödel in this manner requires knowing the distribution URL for the target version. Although it is optional, it is recommended to have the SHA-256 checksum of the distribution as well to ensure the integrity of the update.