npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

unity-build

v0.1.1

Published

A command line tool to trigger Unity Cloud Build jobs.

Downloads

10

Readme

Unity Build Script

A simple command line tool that triggers builds in Unity Cloud Build using it's REST API located at https://build-api.cloud.unity3d.com

NPM

Installation

This script was built using Node.js command line tools, so you need to have it installed.

Then you can use npm to install the command line tool:

$ npm install unity-build -g

You can download this repository and link the script to your /bin path as well:

$ git clone https://github.com/halzate93/unity-build-script.git
$ cd unity-build-script
$ npm link

Usage

You need to provide the details of the project you want to build:

  • Organization Id: It's the name of the organization in Unity ID.
  • Project Id: It's the unique identifier of the project, you can find it in the project's cloud build site.
  • Target Id: You can specify which target to trigger, if you don't provide any it defaults to _all.

Also you need to provide your API key, you can find it in your profile in Cloud Build.

You can pass these as command line parameters:

$ unity-build -k <your_api_key> -o <your_organization> -p <your_project_id> -t <your_target_id>

You can run the help command to see what every option does:

$ unity-build --help

  Usage: unity-build [options]

  Options:

    -h, --help                  output usage information
    -V, --version               output the version number
    -v, --verbose               Verbose the request process
    -p, --project [project_id]  Set the project id that should be built
    -o, --org [org_id]          Set the organization id that contains the project to build
    -k, --key [api_key]         Set your api key to use as credentials to log into Cloud Build
    -t, --target [target]       Set the build target, defaults to [_all] if missing

Using environment variables

A better option would be to store the parameters in environment variables:

$ export CLOUD_BUILD_API_KEY=<your_api_key>
$ export ORGANIZATION_ID=<your_org_id>
$ export PROJECT_ID=<your_project_id>

If you want these to stay between sesions you should store them on the config file according to your platform specifics.

Then you can just run it like this:

$ unity-build

Command line arguments have priority over environment variables.

Using global config file

Another option would be to modify the default configuration file:

$ cd $HOME/.unity_build/
$ cat default.json 
{
  "api_key": "",
  "domain": "https://build-api-builders.cloud.unity3d.com/api/v1",
  "org_id": "",
  "project_id": "",
  "target": "_all",
  "clean": false,
  "delay": 0
}

Environment variables have priority over this configuration file

Run with verbose

If something isn't working, you can run the script with the --verbose option. Which will print information related to the request.

$ unity-build -v

Automation

You can use a program like cron or setup a task on a hosted machine to trigger your builds daily, weekly or at specific times. To see more on this take a look at this instruction on how to do it on heroku.