mirror of https://github.com/harness/drone.git
feat: [CDE-175]: Changing all shell commands from bash to sh. (#2244)
* feat: [CDE-175]: Changing all shell commands from bash to sh.unified-ui
parent
ba934bb4e2
commit
bb7433ef9a
|
@ -30,7 +30,7 @@ type Devcontainer struct {
|
|||
}
|
||||
|
||||
func (d *Devcontainer) ExecuteCommand(ctx context.Context, command string, detach bool) ([]byte, error) {
|
||||
cmd := []string{"/bin/bash", "-c", command}
|
||||
cmd := []string{"/bin/sh", "-c", command}
|
||||
|
||||
execConfig := dockerTypes.ExecConfig{
|
||||
User: "root",
|
||||
|
|
|
@ -553,8 +553,8 @@ func (e *EmbeddedDockerOrchestrator) createContainer(
|
|||
|
||||
_, err := dockerClient.ContainerCreate(ctx, &container.Config{
|
||||
Image: imageName,
|
||||
Entrypoint: []string{"/bin/bash"},
|
||||
Cmd: []string{"-c", "trap \"exit 0\" 15;\n sleep infinity & wait $!"},
|
||||
Entrypoint: []string{"/bin/sh"},
|
||||
Cmd: []string{"-c", "trap 'exit 0' 15; sleep infinity & wait $!"},
|
||||
ExposedPorts: exposedPorts,
|
||||
}, &container.HostConfig{
|
||||
PortBindings: portBindings,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/bin/bash
|
||||
#!/bin/sh
|
||||
|
||||
repo_url={{ .RepoURL }}
|
||||
devcontainer_present={{ .DevcontainerPresent }}
|
||||
|
@ -9,13 +9,13 @@ branch={{ .Branch }}
|
|||
repo_name=$(basename -s .git "$repo_url")
|
||||
|
||||
# Check if Git is installed
|
||||
if ! command -v git &>/dev/null; then
|
||||
if ! command -v git >/dev/null 2>&1; then
|
||||
echo "Git is not installed. Installing Git..."
|
||||
apt-get update
|
||||
apt-get install -y git
|
||||
fi
|
||||
|
||||
if ! command -v git &>/dev/null; then
|
||||
if ! command -v git >/dev/null 2>&1; then
|
||||
echo "Git is not installed. Exiting..."
|
||||
exit 1
|
||||
fi
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/bin/bash
|
||||
#!/bin/sh
|
||||
|
||||
echo "Installing VSCode Web"
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/bin/bash
|
||||
#!/bin/sh
|
||||
|
||||
echo "Running SSH Server"
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/bin/bash
|
||||
#!/bin/sh
|
||||
|
||||
echo "Running VSCode Web"
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/bin/bash
|
||||
#!/bin/sh
|
||||
|
||||
# Install SSH if it's not already installed
|
||||
if ! command -v sshd &> /dev/null; then
|
||||
if ! command -v sshd >/dev/null 2>&1; then
|
||||
echo "OpenSSH server is not installed. Installing..."
|
||||
apt-get update
|
||||
apt-get install -y openssh-server
|
||||
|
@ -14,7 +14,7 @@ password={{ .Password }}
|
|||
workingDir={{ .WorkingDirectory }}
|
||||
|
||||
# Check if the user already exists
|
||||
if id "$username" &> /dev/null; then
|
||||
if id "$username" >/dev/null 2>&1; then
|
||||
echo "User $username already exists."
|
||||
else
|
||||
# Create a new user
|
||||
|
|
Loading…
Reference in New Issue