Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf581724

Browse files
bpmctkylecarbs
andauthored
feat: arm(v7/64) builds for releases and agent scripts (#1337)
* feat: build armv7 linux releases* upload ARM binaries to bin* Only build arm 7 for Linux* add ARM agent scripts* fix: specify armv7 to match tf provider* append arm version to slim builds* use descript armv7 binary* Add script mappings for each architectureCo-authored-by: kylecarbs <kyle@carberry.com>
1 parenta169542 commitf581724

File tree

2 files changed

+48
-25
lines changed

2 files changed

+48
-25
lines changed

‎.goreleaser.yaml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,18 @@ builds:
3232
["-s -w -X github.com/coder/coder/buildinfo.tag={{ .Version }}"]
3333
env:[CGO_ENABLED=0]
3434
goos:[darwin, linux, windows]
35-
goarch:[amd64]
35+
goarch:[amd64, arm, arm64]
36+
goarm:["7"]
37+
# Only build arm 7 for Linux
38+
ignore:
39+
-goos:windows
40+
goarm:'7'
41+
-goos:darwin
42+
goarm:'7'
3643
hooks:
3744
# The "trimprefix" appends ".exe" on Windows.
3845
post:|
39-
cp {{.Path}} site/out/bin/coder-{{ .Os }}-{{ .Arch }}{{ trimprefix .Name "coder" }}
46+
cp {{.Path}} site/out/bin/coder-{{ .Os }}-{{ .Arch }}{{if .Arm }}v{{ .Arm }}{{ end }}{{trimprefix .Name "coder" }}
4047
4148
-id:coder-linux
4249
dir:cmd/coder
@@ -45,7 +52,8 @@ builds:
4552
["-s -w -X github.com/coder/coder/buildinfo.tag={{ .Version }}"]
4653
env:[CGO_ENABLED=0]
4754
goos:[linux]
48-
goarch:[amd64, arm64]
55+
goarch:[amd64, arm, arm64]
56+
goarm:["7"]
4957

5058
-id:coder-windows
5159
dir:cmd/coder

‎provisionersdk/agent.go

Lines changed: 37 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,56 @@
11
package provisionersdk
22

3-
import"fmt"
3+
import (
4+
"fmt"
5+
"strings"
6+
)
47

58
var (
6-
// A mapping of operating-system ($GOOS) to architecture ($GOARCH)
7-
// to agent install and run script. ${DOWNLOAD_URL} is replaced
8-
// with strings.ReplaceAll() when being consumed.
9-
agentScripts=map[string]map[string]string{
10-
// On Windows, VS Code Remote requires a parent process of the
11-
// executing shell to be named "sshd", otherwise it fails. See:
12-
// https://github.com/microsoft/vscode-remote-release/issues/5699
13-
"windows": {
14-
"amd64":`$ProgressPreference = "SilentlyContinue"
15-
Invoke-WebRequest -Uri ${ACCESS_URL}bin/coder-windows-amd64.exe -OutFile $env:TEMP\sshd.exe
9+
// On Windows, VS Code Remote requires a parent process of the
10+
// executing shell to be named "sshd", otherwise it fails. See:
11+
// https://github.com/microsoft/vscode-remote-release/issues/5699
12+
windowsScript=`$ProgressPreference = "SilentlyContinue"
13+
Invoke-WebRequest -Uri ${ACCESS_URL}bin/coder-windows-${ARCH}.exe -OutFile $env:TEMP\sshd.exe
1614
Set-MpPreference -DisableRealtimeMonitoring $true -ExclusionPath $env:TEMP\sshd.exe
1715
$env:CODER_AGENT_AUTH = "${AUTH_TYPE}"
1816
$env:CODER_AGENT_URL = "${ACCESS_URL}"
19-
Start-Process -FilePath $env:TEMP\sshd.exe -ArgumentList "agent" -PassThru`,
20-
},
21-
"linux": {
22-
"amd64":`#!/usr/bin/env sh
17+
Start-Process -FilePath $env:TEMP\sshd.exe -ArgumentList "agent" -PassThru`
18+
19+
linuxScript=`#!/usr/bin/env sh
2320
set -eu pipefail
2421
export BINARY_LOCATION=$(mktemp -d -t tmp.coderXXXXX)/coder
25-
curl -fsSL ${ACCESS_URL}bin/coder-linux-amd64 -o $BINARY_LOCATION
22+
curl -fsSL ${ACCESS_URL}bin/coder-linux-${ARCH} -o $BINARY_LOCATION
2623
chmod +x $BINARY_LOCATION
2724
export CODER_AGENT_AUTH="${AUTH_TYPE}"
2825
export CODER_AGENT_URL="${ACCESS_URL}"
29-
exec $BINARY_LOCATION agent`,
30-
},
31-
"darwin": {
32-
"amd64":`#!/usr/bin/env sh
26+
exec $BINARY_LOCATION agent`
27+
28+
darwinScript=`#!/usr/bin/env sh
3329
set -eu pipefail
3430
export BINARY_LOCATION=$(mktemp -d -t tmp.coderXXXXX)/coder
35-
curl -fsSL ${ACCESS_URL}bin/coder-darwin-amd64 -o $BINARY_LOCATION
31+
curl -fsSL ${ACCESS_URL}bin/coder-darwin-${ARCH} -o $BINARY_LOCATION
3632
chmod +x $BINARY_LOCATION
3733
export CODER_AGENT_AUTH="${AUTH_TYPE}"
3834
export CODER_AGENT_URL="${ACCESS_URL}"
39-
exec $BINARY_LOCATION agent`,
35+
exec $BINARY_LOCATION agent`
36+
37+
// A mapping of operating-system ($GOOS) to architecture ($GOARCH)
38+
// to agent install and run script. ${DOWNLOAD_URL} is replaced
39+
// with strings.ReplaceAll() when being consumed. ${ARCH} is replaced
40+
// with the architecture when being provided.
41+
agentScripts=map[string]map[string]string{
42+
"windows": {
43+
"amd64":windowsScript,
44+
"arm64":windowsScript,
45+
},
46+
"linux": {
47+
"amd64":linuxScript,
48+
"arm64":linuxScript,
49+
"armv7":linuxScript,
50+
},
51+
"darwin": {
52+
"amd64":darwinScript,
53+
"arm64":darwinScript,
4054
},
4155
}
4256
)
@@ -48,6 +62,7 @@ func AgentScriptEnv() map[string]string {
4862
env:=map[string]string{}
4963
foroperatingSystem,scripts:=rangeagentScripts {
5064
forarchitecture,script:=rangescripts {
65+
script:=strings.ReplaceAll(script,"${ARCH}",architecture)
5166
env[fmt.Sprintf("CODER_AGENT_SCRIPT_%s_%s",operatingSystem,architecture)]=script
5267
}
5368
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp