delucca
December 10, 2020, 10:23pm
1
Hi!
I’m trying to deploy with Waypoing by using a local shell script and unable to do so. Here is the error I’m getting:
» Deploying...
✓ Rendering templates...
❌ Executing command: bash ./deploy.sh -e develop -t 2e054f43d0ded6121d265559ff87b401c9af6f3d
│ /usr/bin/bash: ./deploy.sh: No such file or directory
! exit status 127
This is my waypoint.hcl
:
project = "business"
app "app" {
build {
use "pack" {
builder = "gcr.io/buildpacks/builder:v1"
}
registry {
use "aws-ecr" {
region = "sa-east-1"
repository = "business"
tag = gitrefpretty()
}
}
}
deploy{
use "exec" {
dir = "./.gitops"
command = ["bash", "./deploy.sh", "-e", "develop", "-t", gitrefpretty()]
}
}
}
Anyone knows what am I doing wrong?
Hey there @delucca - From what I see, it doesn’t look like the option dir
actually does anything, so I think it was attempting to run ./deploy.sh
in the dir where you ran waypoint, not inside ./.gitops
. You should be able to reference your deploy.sh
script with the full path:
command = ["bash", "./.gitops/deploy.sh", "-e", "develop", "-t", gitrefpretty()]
Here’s my example with a simple bash script:
brian@localghost:nodejs % cat waypoint.hcl ±[●●][main]
project = "example-nodejs"
app "example-nodejs" {
build {
use "pack" {}
registry {
use "docker" {
image = "nodejs-example"
tag = "1"
local = true
}
}
}
deploy {
use "exec" {
command = ["bash", "./test/hello.sh"]
}
}
}
brian@localghost:nodejs % tree test ±[●●][main]
test
└── hello.sh
0 directories, 1 file
brian@localghost:nodejs % cat test/hello.sh ±[●●][main]
echo "hello"
brian@localghost:nodejs % waypoint up ±[●●][main]
» Building...
Creating new buildpack-based image using builder: heroku/buildpacks:18
✓ Creating pack client
✓ Building image
│ [exporter] Adding 1/1 app layer(s)
│ [exporter] Reusing layer 'launcher'
│ [exporter] Reusing layer 'config'
│ [exporter] Adding label 'io.buildpacks.lifecycle.metadata'
│ [exporter] Adding label 'io.buildpacks.build.metadata'
│ [exporter] Adding label 'io.buildpacks.project.metadata'
│ [exporter] *** Images (059dc998151d):
│ [exporter] index.docker.io/library/example-nodejs:latest
│ [exporter] Reusing cache layer 'heroku/nodejs-engine:nodejs'
│ [exporter] Reusing cache layer 'heroku/nodejs-engine:toolbox'
✓ Injecting entrypoint binary to image
Generated new Docker image: example-nodejs:latest
✓ Tagging Docker image: example-nodejs:latest => nodejs-example:1
» Deploying...
✓ Rendering templates...
✓ Executing command: bash ./test/hello.sh
│ hello
» Releasing...
» Pruning old deployments...
Deployment: 01ES7CFD6G64ES6B5ACQX56FKX
Deployment: 01ES7CD3FMCAFBHF8SFCX9VCQH
The deploy was successful! A Waypoint deployment URL is shown below. This
can be used internally to check your deployment and is not meant for external
traffic. You can manage this hostname using "waypoint hostname."
URL: https://presumably-concise-ray.waypoint.run
Deployment URL: https://presumably-concise-ray--v4.waypoint.run
I see we document dir
here: https://www.waypointproject.io/plugins/exec#dir
It doesn’t seem like it’s working!
deploy {
use "exec" {
dir = "test"
command = ["bash", "./hello.sh"]
}
}
» Deploying...
✓ Rendering templates...
❌ Executing command: bash ./hello.sh
│ /bin/bash: ./hello.sh: No such file or directory
! exit status 127
Must be a bug, I’ll go ahead and open a GitHub issue and report back once it’s created! Thanks. (edit: That issue now lives here: https://github.com/hashicorp/waypoint/issues/903 )
delucca
December 11, 2020, 12:06am
4
Hi @briancain thanks for your assistance.
Indeed removing the dir
option fixed the issue
Also, thanks for creating the issue!
Sure thing @delucca ! I’ve also opened a pull request to fix this up, so it should be resolved in the next release. Thanks for bringing this to our attention!
1 Like