Skip to content

Commit

Permalink
Merge pull request #69 from equinix/packet-binary
Browse files Browse the repository at this point in the history
Create packet binaries
  • Loading branch information
displague authored Oct 5, 2021
2 parents d0a1d02 + b5a09fb commit 1579a82
Show file tree
Hide file tree
Showing 6 changed files with 183 additions and 84 deletions.
33 changes: 31 additions & 2 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,41 @@ before:
hooks:
- go mod download
builds:
- env:
- id: docker-machine-driver-metal
env:
- CGO_ENABLED=0
- GO111MODULE=on
binary: docker-machine-driver-metal
ldflags:
- -X github.com/equinix/docker-machine-driver-metal/pkg/drivers/metal/metal.version={{.Version}}
- -s -w -X github.com/equinix/docker-machine-driver-metal/pkg/drivers/metal.version={{.Version}}
goos:
- windows
- darwin
- linux
goarch:
- amd64
- arm
- arm64
goarm:
- 6
- 7
ignore:
- goos: windows
goarch: arm
- goos: windows
goarch: arm64
- goos: darwin
goarch: arm64
- goos: darwin
goarch: arm
- id: docker-machine-driver-packet
env:
- CGO_ENABLED=0
- GO111MODULE=on
binary: docker-machine-driver-packet
ldflags:
- -s -w -X github.com/equinix/docker-machine-driver-metal/pkg/drivers/metal.version={{.Version}}
- -s -w -X github.com/equinix/docker-machine-driver-metal/pkg/drivers/metal.driverName=packet
goos:
- windows
- darwin
Expand Down
21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,17 @@ docker-machine create --driver metal

You can find the supported arguments by running `docker-machine create -d metal --help` (Equinix Metal specific arguments are shown below):

| Argument | Default | Description | Environment | Config |
| --------------------------- | -------------- | ---------------------------------------------------------------------------- | ----------- | ---------- |
| `--metal-api-key` | | Equinix Metal API Key | `METAL_AUTH_TOKEN` | `token` or `auth-token`
| Argument | Default | Description | Environment | Config |
| --------------------------- | -------------- | ---------------------------------------------------------------------------- | ------------------------ | ----------------------- |
| `--metal-api-key` | | Deprecated API Key flag (use auth token) | `METAL_API_KEY` |
| `--metal-auth-token` | | Equinix Metal Authentication Token | `METAL_AUTH_TOKEN` | `token` or `auth-token` |
| `--metal-billing-cycle` | `hourly` | Equinix Metal billing cycle, hourly or monthly | `METAL_BILLING_CYCLE` |
| `--metal-facility-code` | | Equinix Metal facility code | `METAL_FACILITY_CODE` |`facility`
| `--metal-facility-code` | | Equinix Metal facility code | `METAL_FACILITY_CODE` | `facility` |
| `--metal-hw-reservation-id` | | Equinix Metal Reserved hardware ID | `METAL_HW_ID` |
| `--metal-metro-code` | | Equinix Metal metro code ("dc" is used if empty and facility is not set) | `METAL_METRO_CODE` |`metro`
| `--metal-os` | `ubuntu_20_04` | Equinix Metal OS | `METAL_OS` |`operating-system`
| `--metal-plan` | `c3.small.x86` | Equinix Metal Server Plan | `METAL_PLAN` |`plan`
| `--metal-project-id` | | Equinix Metal Project Id | `METAL_PROJECT_ID` |`project`
| `--metal-metro-code` | | Equinix Metal metro code ("dc" is used if empty and facility is not set) | `METAL_METRO_CODE` | `metro` |
| `--metal-os` | `ubuntu_20_04` | Equinix Metal OS | `METAL_OS` | `operating-system` |
| `--metal-plan` | `c3.small.x86` | Equinix Metal Server Plan | `METAL_PLAN` | `plan` |
| `--metal-project-id` | | Equinix Metal Project Id | `METAL_PROJECT_ID` | `project` |
| `--metal-spot-instance` | | Request a Equinix Metal Spot Instance | `METAL_SPOT_INSTANCE` |
| `--metal-spot-price-max` | | The maximum Equinix Metal Spot Price | `METAL_SPOT_PRICE_MAX` |
| `--metal-termination-time` | | The Equinix Metal Instance Termination Time | `METAL_TERMINATION_TIME` |
Expand All @@ -40,6 +41,8 @@ You can find the supported arguments by running `docker-machine create -d metal

Where denoted, values may be loaded from the environment or from the `~/.config/equinix/metal.yaml` file which can be created with the [Equinix Metal CLI](https://github.com/equinix/metal-cli#metal-cli).

In order to support existing installations, a Packet branded binary is also available with each release. When the `packet` binary is used, all `METAL` environment variables and `metal` arguments should be substituted for `PACKET` and `packet`, respectively.

### Example usage

This creates the following:
Expand Down Expand Up @@ -108,7 +111,7 @@ To monitor the Docker debugging details and the Equinix Metal API calls:
go build
PACKNGO_DEBUG=1 PATH=`pwd`:$PATH docker-machine \
--debug create -d metal \
--metal-api-key=$METAL_AUTH_TOKEN \
--metal-auth-token=$METAL_AUTH_TOKEN \
--metal-project-id=$METAL_PROJECT \
foo
```
Expand Down
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ require (
github.com/carmo-evan/strtotime v0.0.0-20200108203155-3136cf889e3b
github.com/docker/docker v0.0.0-20180805161158-f57f260b49b6 // indirect
github.com/docker/machine v0.16.2
github.com/google/go-cmp v0.3.0 // indirect
github.com/packethost/packngo v0.17.0
github.com/packethost/packngo v0.19.1
github.com/pkg/errors v0.8.1 // indirect
github.com/sirupsen/logrus v1.6.0 // indirect
github.com/stretchr/testify v1.5.1
Expand Down
9 changes: 5 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ github.com/docker/docker v0.0.0-20180805161158-f57f260b49b6 h1:6mGj2QkqSqEV8KFY6
github.com/docker/docker v0.0.0-20180805161158-f57f260b49b6/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/machine v0.16.2 h1:jyF9k3Zg+oIGxxSdYKPScyj3HqFZ6FjgA/3sblcASiU=
github.com/docker/machine v0.16.2/go.mod h1:I8mPNDeK1uH+JTcUU7X0ZW8KiYz0jyAgNaeSJ1rCfDI=
github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ=
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8=
github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/packethost/packngo v0.17.0 h1:fGPlj9NDt6ejOrAMfUgx955oCaR1QBKA9pec14m0L38=
github.com/packethost/packngo v0.17.0/go.mod h1:YrtUNN9IRjjqN6zK+cy2IYoi3EjHfoWTWxJkI1I1Vk0=
github.com/packethost/packngo v0.19.1 h1:zuZasgaV4qHMeQ+djENj21w8vhgpoZO2h1a09buVjD8=
github.com/packethost/packngo v0.19.1/go.mod h1:/UHguFdPs6Lf6FOkkSEPnRY5tgS0fsVM+Zv/bvBrmt0=
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
Expand All @@ -38,6 +38,7 @@ golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9 h1:YTzHMGlqJu67/uEo1lBv0n3wBXhXNeUbB1XfN2vmTm0=
golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
Expand Down
Loading

0 comments on commit 1579a82

Please sign in to comment.