Code Monkey home page Code Monkey logo

ci's Introduction

Hathora CLI for CI

This repo houses the CLI that can be used to deploy your game server builds to Hathora Cloud in your CI/CD pipelines.

Docs

For documentation on how to use this CLI, check out our docs.

Hathora CLI Upgrade Notes

This covers the relevant notes for users upgrading from previous CLI versions. We aim to cover compatibility changes that you must be aware of.

For more details about changes on each release please refer to the Official Release Notes.

Hathora CLI v0.2.0

Hathora CLI v0.2.0 now uses Hathora AppsV2, ProcessesV3, BuildsV3 and DeploymentsV3 APIs. Using these APIs for a given application implicitly migrates it to Global Builds.

Nothing in your CLI command needs to be changed to migrate. However, usage of old SDKs should be updated to the latest versions (AppsV2, ProcessesV3, BuildsV3 and DeploymentsV3). This should be done before upgrading your continuous deployment to use Global Builds (CLI v0.2.0).

When you create build with CLI v0.2.0, the following will be impacted on old APIs:

  • listing builds - new builds will not appear

When you create a deployment with CLI v0.2.0, the following will be impacted on old APIs:

  • listing applications - deployment id and build id returned will be invalid
  • listing deployments - new deployments will not appear
  • listing processes - deployment id returned will be invalid

Notes:

  • appId being passed into hathora build will now be ignored - it can safely be removed

Hathora CLI v0.1.x

Hathora CLI v0.1.x is no longer compatible with builds and application deployments created via the Hathora UI Console.

Development

Run the CLI locally

To run the CLI locally, execute the following:

go run hathora/main.go --help

Running tests

To run tests:

make test

Building binaries

To build a CLI binary, you can run the following:

make build

The target OS and architecture can be specified by setting the OS and ARCH environment variables, respectively. For example, to build a binary for the linux OS and the amd64 architecture, you can do the following:

TARGETOS=linux TARGETARCH=amd64 make build

Note

When building on windows you'll want the built binaries to include the .exe suffix. To achieve this, you can use the BINARY_SUFFIX variable, e.g.:

TARGETOS=windows TARGETARCH=amd64 BINARY_SUFFIX=.exe make build

The binary will be available in the bin directory.

./bin/hathora-* --help

Rebuilding binaries

To quickly rebuild a CLI binary, you can use:

make clean && make build

Regenerating the SDK

The SDK can be regenerated based on the OpenAPI spec hosted at https://hathora.dev/swagger.json. To do this, run the following command from the root of the project. You must have the speakeasy CLI installed.

make sdk-clean
rm internal/sdk/go.mod

ci's People

Contributors

gwprice115 avatar msaxon avatar drewfead avatar zlangbert avatar jared-gs avatar tarunipaleru avatar natgabb avatar

Stargazers

Andrew Ettensohn avatar Justin Chu avatar  avatar  avatar

Watchers

Siddharth Dhulipalla avatar Justin Chu avatar  avatar Harsh Pandey avatar  avatar

Forkers

geode-hathora

ci's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.