github.com/criteo/command-launcher@v0.0.0-20230407142452-fb616f546e98/gh-pages/content/en/docs/quickstart/build-from-source.md (about) 1 --- 2 title: "Build from source" 3 description: "Build command launcher from source" 4 lead: "Build command launcher from source" 5 date: 2022-10-02T17:34:04+02:00 6 lastmod: 2022-10-02T17:34:04+02:00 7 draft: false 8 images: [] 9 menu: 10 docs: 11 parent: "quickstart" 12 identifier: "build-from-source-818500deb2b1cbde4714cb2bda54ecaa" 13 weight: 120 14 toc: true 15 --- 16 17 ## Why does the binary name matter? 18 19 Command launcher is designed for both enterprise and individual usage. According to your context, you might want to call it differently. For example, at Criteo, we call it "Criteo Dev Toolkit". The binary name is used for several default configurations, for example, command launcher home `$HOME/.[APP_NAME]`, additional resources environment prefix `[APP_NAME]_`, etc. 20 21 The default pre-built binary is call `cola` (**Co**mmand **La**uncher), which means that the default home folder is `$HOME/.cola` and the resources environment variables are all starts with `COLA_`. 22 23 Another pre-built binary is called `cdt` (Criteo Dev Toolkit), its home folder will be `$HOME/.cdt`, and its commands can access the resource environment variables with both prefix `COLA_` and `CDT_`. 24 25 > For compatibility concern, we highly recommend to reference resources in your command with prefix `COLA_` 26 27 To use a different name, you need to build command launcher from source and pass the desired short and long name to the build scripts. 28 29 ## Build from source 30 31 Requirements: golang >= 1.17 32 33 You can build the command launcher with your prefered name (in the example: `Command Launcher`, a.k.a `cola`). 34 35 ```shell 36 go build -o cola -ldflags='-X main.version=dev -X main.appName=cola -X "main.appLongName=Command Launcher"' main.go 37 ``` 38 39 Or simply call the `build.sh` scripts 40 41 ```shell 42 ./build.sh [version] [app name] [app long name] 43 ``` 44 45 ## Run tests 46 47 Run unit tests 48 49 ```shell 50 go test -v ./... 51 ``` 52 53 Run all integration tests 54 55 ```shell 56 ./test/integration.sh 57 ``` 58 59 You can run one integration test by specify the name of the integration test file (without the .sh extension). The integration tests can be found in [`test/integration`](https://github.com/criteo/command-launcher/tree/main/test/integration) folder, for example: 60 61 ```shell 62 ./test/integration.sh test-remote 63 ```