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

fix: Add test for wrapping init script with single quotes#2979

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
kylecarbs merged 1 commit intomainfromsinglequotes
Jul 13, 2022
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletionprovisionersdk/agent_test.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -46,7 +46,10 @@ func TestAgentScript(t *testing.T) {
}
script = strings.ReplaceAll(script, "${ACCESS_URL}", srvURL.String()+"/")
script = strings.ReplaceAll(script, "${AUTH_TYPE}", "token")
output, err := exec.Command("sh", "-c", script).CombinedOutput()
// This is intentionally ran in single quotes to mimic how a customer may
// embed our script. Our scripts should not include any single quotes.
// nolint:gosec
output, err := exec.Command("sh", "-c", "sh -c '"+script+"'").CombinedOutput()
t.Log(string(output))
require.NoError(t, err)
// Ignore debug output from `set -x`, we're only interested in the last line.
Expand Down
4 changes: 2 additions & 2 deletionsprovisionersdk/scripts/bootstrap_linux.sh
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -16,8 +16,8 @@ cd "$BINARY_DIR"
# This could fail for a number of reasons, many of which are likely transient.
# So just keep trying!
while :; do
# Try a number of different download tools, as we don'tknow what we'll
# have available
# Try a number of different download tools, as we don notknow what we
#willhave available.
status=""
if command -v curl >/dev/null 2>&1; then
curl -fsSL --compressed "${BINARY_URL}" -o "${BINARY_NAME}" && break
Expand Down
4 changes: 2 additions & 2 deletionsprovisionersdk/scripts/bootstrap_windows.ps1
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
# Sleep for a while in case the underlying provider deletes the resource on error.
trap {
Write-Error'=== Agent script exited with non-zero code. Sleeping 24h to preserve logs...'
Write-Error"=== Agent script exited with non-zero code. Sleeping 24h to preserve logs..."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I'm curious how folks would be usingsh -c on Windows, but I suppose it's good to remain consistent 👍

Start-Sleep -Seconds 86400
}

Expand All@@ -25,7 +25,7 @@ while ($true) {
}
}

# If the below fails, retrying probablywon't help.
# If the below fails, retrying probablywill not help.
Set-MpPreference -DisableRealtimeMonitoring $true -ExclusionPath $env:TEMP\sshd.exe
$env:CODER_AGENT_AUTH = "${AUTH_TYPE}"
$env:CODER_AGENT_URL = "${ACCESS_URL}"
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp