Releases: yoanbernabeu/GoJelastic
v0.2.1 - Fix Build
Full Changelog: v0.2.0...v0.2.1
v0.2.0 - 🐛 Bug Fix: Exit Code on Error
Issue Resolved
This release fixes a critical bug (#10) where the CLI returned exit code 0 (success) even when an error occurred during Jelastic API calls.
Behavior before the fix ❌
$ GoJelastic redeployContainerById \
--appid $JELASTIC_APPID \
--token $JELASTIC_TOKEN \
--url $JELASTIC_URL \
--nodeid $JELASTIC_NODEID \
--tag $(git describe --tags --abbrev=0)
# Error response
{
"error": "The [ jem docker fetch ] operation has failed: Authentication failed",
"result": 4095,
"source": "JEL"
}
$ echo $?
0 # ❌ Returns 0 instead of 1Behavior after the fix ✅
$ GoJelastic redeployContainerById \
--appid $JELASTIC_APPID \
--token $JELASTIC_TOKEN \
--url $JELASTIC_URL \
--nodeid $JELASTIC_NODEID \
--tag $(git describe --tags --abbrev=0)
# Error response (written to stderr)
{
"error": "The [ jem docker fetch ] operation has failed: Authentication failed",
"result": 4095,
"source": "JEL"
}
$ echo $?
1 # ✅ Returns 1 correctly🎯 Impact
This fix is critical for the following use cases:
✅ CI/CD Pipelines
Pipelines can now properly detect failures:
GitLab CI / GitHub Actions
deploy:
script:
- |
./GoJelastic redeployContainerById \
--appid $JELASTIC_APPID \
--token $JELASTIC_TOKEN \
--url $JELASTIC_URL \
--nodeid $JELASTIC_NODEID \
--tag $CI_COMMIT_TAG
# The pipeline will now fail if deployment fails ✅✅ Shell Scripts
if ./GoJelastic startEnv --appid myapp --token $TOKEN --url $URL; then
echo "✅ Environment started successfully"
else
echo "❌ Failed to start environment (exit code: $?)"
exit 1
fi✅ Automation
./GoJelastic stopEnv --appid myapp --token $TOKEN --url $URL || exit 1
./GoJelastic startEnv --appid myapp --token $TOKEN --url $URL || exit 1
echo "✅ Restart successful"🔧 Technical Details
Changes Made
-
New
JelasticResponsestruct- Automatically parses JSON responses from the API
- Detects
resultanderrorfields
-
checkResponseForErrors()function- Automatically checks every API response
- Exits with code 1 if
result != 0orerroris not empty - Writes errors to
stderrinstead ofstdout
-
Transparent integration
- All commands automatically benefit from the fix
- No behavior change for successful commands
- 100% backward compatible
Error Detection Conditions
The CLI now returns exit code 1 if:
result != 0ORerroris not empty in the JSON response
📦 Update
Installation from Binary
# Linux/Darwin with wget
wget -qO- https://raw.githubusercontent.com/yoanbernabeu/GoJelastic/main/install.sh | bash
# Linux/Darwin with curl
curl -sL https://raw.githubusercontent.com/yoanbernabeu/GoJelastic/main/install.sh | bashBuild from Source
git clone git@github.com:yoanbernabeu/GoJelastic.git
cd GoJelastic
git checkout [VERSION]
go build -o GoJelastic✅ Testing
- ✅ Successful compilation without errors
- ✅ No regression on existing commands
- ✅ Backward compatible with existing scripts
🙏 Acknowledgments
Thanks to everyone who reported this bug and contributed to its identification. This fix significantly improves the reliability of GoJelastic in production environments and CI/CD pipelines.
Note: This release contains only bug fixes. No new features have been added.
v0.1.6 - Swaps external IP addresses between source and target nodes
v0.1.5 - Fix JPS URL
v0.1.4 - Improve Documentation + Install Custom JPS
What's Changed
- v0.1.4 by @yoanbernabeu in #6
- Improve and fix documentation
- Add install command for custom JPS Manifest file
Full Changelog: v0.1.3...v0.1.4
v0.1.3 - New commands and installation simplification
What's Changed
- V0.1.3 - New commands and installation simplification by @yoanbernabeu in #5
- documentation generation command
- Gets extended account billing history by period
- Gets the information about all environments of a user
- Provides information about firewall rules for the environment
- Gets information about the user
- Sends an email with the link to reset the account password
- Installation simplification for Linux/Darwin environments
- JSON formatting in terminal return
Full Changelog: v0.1.2...v0.1.3
v0.1.2 - Lots of new command lines and documentation
v0.1.1 - Using a Configuration File for Token and URL Storage
v0.1.0 - Welcome GoJelastic !
The official Jelastic command-line interface (CLI) is written in Java, which can make it heavy and inconvenient to use in continuous integration/continuous deployment (CI/CD) environments.
Rewriting the CLI in Go will make it lighter and more portable, allowing it to be easily incorporated into CI/CD pipelines and used on a variety of systems without the need for additional dependencies.
This will make it easier for developers to manage and deploy applications on Jelastic, improving efficiency and streamlining the development process.