Comments (7)
Hi @kapik, can you replace single quote '
, with double quote "
in your docker-compose file?
from portainer-stack-utils.
Hey @tortuetorche ,
Same issue with double quote.
from portainer-stack-utils.
Hi @kapik. Please, could you provide some details about the execution environment, like the portainer-stack-utils script version and wether you are running the script from the Docker image or in your own bash interpreter? This would help to reproduce the error.
I tried to deploy your docker-compose file (using nginx:alpine as the image) against a Portainer 1.20.1 instance using the Docker image (bash 4.4) and I got a different error about the compose file version. After changing version: '2'
to version: '3'
it deployed sucessfully. But no substitution error 🤔
from portainer-stack-utils.
Hi @greenled,
I'm using the last version of portainer-stack-utils
(clone this week).
I use it on my laptop: macOS Mojave via my terminal (zsh).
I have the same error with version: '3'
of my compose file version.
And I use Portainer 1.20.1
.
I have ran the script with DEBUG=true
:
ACTION -> deploy
PORTAINER_USER -> MYUSER
PORTAINER_PASSWORD -> MYPWD
PORTAINER_URL -> http://XX.XX.XX.XX:XXXX
PORTAINER_STACK_NAME -> MyStack
DOCKER_COMPOSE_FILE -> docker-compose.yml
ENVIRONMENT_VARIABLES_FILE ->
PORTAINER_ENDPOINT -> 1
PORTAINER_PRUNE -> false
HTTPIE_VERIFY_SSL -> yes
VERBOSE_MODE -> false
DEBUG_MODE -> true
STRICT_MODE -> false
Get auth token response -> {
"jwt": "MYTOKEN"
}
Auth token -> MYTOKEN
Get stacks response -> [
{
"Id": 2,
"Name": "MyStack",
"Type": 1,
"EndpointId": 1,
"SwarmId": "xxxxxx",
"EntryPoint": "docker-compose.yml",
"Env": [],
"ProjectPath": "/data/compose/2",
"ResourceControl": {
"Id": 0,
"ResourceId": "",
"SubResourceIds": null,
"Type": 0,
"UserAccesses": null,
"TeamAccesses": null,
"Public": false
}
}
]
Stack MyStack -> {
"Id": 2,
"Name": "MyStack",
"Type": 1,
"EndpointId": 1,
"SwarmId": "xxxxxx",
"EntryPoint": "docker-compose.yml",
"Env": [],
"ProjectPath": "/data/compose/2",
"ResourceControl": {
"Id": 0,
"ResourceId": "",
"SubResourceIds": null,
"Type": 0,
"UserAccesses": null,
"TeamAccesses": null,
"Public": false
}
}
./psu: line 290: bad substitution: no closing `}' in "${docker_compose_file_content//"/'\"'}"
from portainer-stack-utils.
There you have it: zsh. I have not tested the script with zsh before, only bash. From the zsh documentation and this stack overflow question I see there are some diferences in the way parameter expansion works on both interpreters. I will investigate further.
Meanwhile, you could install bash or use the docker image. In the second case, the image is set to run the script as the entry point so it could be as simple as:
docker run -v /path/to/docker-compose.yml:/path/to/docker-compose.yml greenled/portainer-stack-utils:latest -a deploy -c /path/to/docker-compose.yml ...
from portainer-stack-utils.
@kapik would you prefer an executable binary made for your particular platform instead of a bash script? It would have zero dependencies (no bash, no jq, no httpie). It would "just work". I'm playing with the idea of reimplementing the tool in Go.
from portainer-stack-utils.
@kapik check out v2.0.0-alpha.2 release. It comes with binaries compiled for several platforms, macOS included. Beware it's still in an alpha stage, but it's stable enough to play around.
Will close this issue, as future v2.x
releases will be on a similar fashion.
from portainer-stack-utils.
Related Issues (20)
- Better flags HOT 8
- Action as an argument HOT 1
- Help included in the script HOT 2
- Branching model with better support for releases HOT 2
- Project rebranding HOT 9
- How do you use Portainer Stack Utils? HOT 7
- Migration to GitLab HOT 9
- Stack deploy with configs failed `read /data/compose/3: is a directory` HOT 3
- Definition of "breaking change" HOT 1
- Use Portainer API data structures HOT 1
- Deploy stack with configs/secrets from file, manage configs/secrets HOT 13
- Version included in the script
- Endpoint's Docker API proxy HOT 1
- Proxy command doesn't handle websockets
- Continuous integration HOT 19
- Docker image docs HOT 1
- Script as entrypoint HOT 1
- Custom stack environment variables HOT 5
- Releases HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from portainer-stack-utils.