Skip to content

Commit 1579a82

Browse files
authored
Merge pull request #69 from equinix/packet-binary
Create packet binaries
2 parents d0a1d02 + b5a09fb commit 1579a82

File tree

6 files changed

+183
-84
lines changed

6 files changed

+183
-84
lines changed

.goreleaser.yml

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,41 @@ before:
44
hooks:
55
- go mod download
66
builds:
7-
- env:
7+
- id: docker-machine-driver-metal
8+
env:
89
- CGO_ENABLED=0
910
- GO111MODULE=on
1011
binary: docker-machine-driver-metal
1112
ldflags:
12-
- -X github.com/equinix/docker-machine-driver-metal/pkg/drivers/metal/metal.version={{.Version}}
13+
- -s -w -X github.com/equinix/docker-machine-driver-metal/pkg/drivers/metal.version={{.Version}}
14+
goos:
15+
- windows
16+
- darwin
17+
- linux
18+
goarch:
19+
- amd64
20+
- arm
21+
- arm64
22+
goarm:
23+
- 6
24+
- 7
25+
ignore:
26+
- goos: windows
27+
goarch: arm
28+
- goos: windows
29+
goarch: arm64
30+
- goos: darwin
31+
goarch: arm64
32+
- goos: darwin
33+
goarch: arm
34+
- id: docker-machine-driver-packet
35+
env:
36+
- CGO_ENABLED=0
37+
- GO111MODULE=on
38+
binary: docker-machine-driver-packet
39+
ldflags:
40+
- -s -w -X github.com/equinix/docker-machine-driver-metal/pkg/drivers/metal.version={{.Version}}
41+
- -s -w -X github.com/equinix/docker-machine-driver-metal/pkg/drivers/metal.driverName=packet
1342
goos:
1443
- windows
1544
- darwin

README.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,17 @@ docker-machine create --driver metal
2222

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

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

4142
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).
4243

44+
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.
45+
4346
### Example usage
4447

4548
This creates the following:
@@ -108,7 +111,7 @@ To monitor the Docker debugging details and the Equinix Metal API calls:
108111
go build
109112
PACKNGO_DEBUG=1 PATH=`pwd`:$PATH docker-machine \
110113
--debug create -d metal \
111-
--metal-api-key=$METAL_AUTH_TOKEN \
114+
--metal-auth-token=$METAL_AUTH_TOKEN \
112115
--metal-project-id=$METAL_PROJECT \
113116
foo
114117
```

go.mod

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ require (
77
github.com/carmo-evan/strtotime v0.0.0-20200108203155-3136cf889e3b
88
github.com/docker/docker v0.0.0-20180805161158-f57f260b49b6 // indirect
99
github.com/docker/machine v0.16.2
10-
github.com/google/go-cmp v0.3.0 // indirect
11-
github.com/packethost/packngo v0.17.0
10+
github.com/packethost/packngo v0.19.1
1211
github.com/pkg/errors v0.8.1 // indirect
1312
github.com/sirupsen/logrus v1.6.0 // indirect
1413
github.com/stretchr/testify v1.5.1

go.sum

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ github.com/docker/docker v0.0.0-20180805161158-f57f260b49b6 h1:6mGj2QkqSqEV8KFY6
1111
github.com/docker/docker v0.0.0-20180805161158-f57f260b49b6/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
1212
github.com/docker/machine v0.16.2 h1:jyF9k3Zg+oIGxxSdYKPScyj3HqFZ6FjgA/3sblcASiU=
1313
github.com/docker/machine v0.16.2/go.mod h1:I8mPNDeK1uH+JTcUU7X0ZW8KiYz0jyAgNaeSJ1rCfDI=
14-
github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY=
15-
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
14+
github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ=
15+
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
1616
github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8=
1717
github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
18-
github.com/packethost/packngo v0.17.0 h1:fGPlj9NDt6ejOrAMfUgx955oCaR1QBKA9pec14m0L38=
19-
github.com/packethost/packngo v0.17.0/go.mod h1:YrtUNN9IRjjqN6zK+cy2IYoi3EjHfoWTWxJkI1I1Vk0=
18+
github.com/packethost/packngo v0.19.1 h1:zuZasgaV4qHMeQ+djENj21w8vhgpoZO2h1a09buVjD8=
19+
github.com/packethost/packngo v0.19.1/go.mod h1:/UHguFdPs6Lf6FOkkSEPnRY5tgS0fsVM+Zv/bvBrmt0=
2020
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
2121
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
2222
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
@@ -38,6 +38,7 @@ golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7w
3838
golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9 h1:YTzHMGlqJu67/uEo1lBv0n3wBXhXNeUbB1XfN2vmTm0=
3939
golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
4040
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
41+
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
4142
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
4243
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
4344
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=

0 commit comments

Comments
 (0)