Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix passing arguments and variables to shell apps. #2288

Merged
merged 1 commit into from
Aug 19, 2024

Conversation

ShaneMcC
Copy link
Contributor

Fixes shell apps not getting any command line arguments.

This is a fix for #2229

This reverts d617280 and then adds in the extra missing arguments from Task/Template/Environment

@fiftin
Copy link
Collaborator

fiftin commented Aug 18, 2024

Hi @ShaneMcC did you test the PR?

@ShaneMcC
Copy link
Contributor Author

Hi @fiftin - Yes.

I have a test setup that sets vars in appropriate places (environment, task, template) and then a script which prints "${@}" and env | grep -v Semaphore_ and it looked like it was working:

==========
Args: --SecretExtra=secret --arg1 --arg2 --ExtraVar=value --varOne=1 VAR_TWO=2 --arg3
==========

==========
Env:
==========
HOSTNAME=4bd02ded3dee
ENV_VAR=value
PWD=/tmp/semaphore/repository_1_1
HOME=/tmp/semaphore
VIRTUAL_ENV=/opt/semaphore/apps/ansible/9.4.0/venv
SECRET_ENV=secret
SHLVL=2
ANSIBLE_VERSION=9.4.0
PATH=/opt/semaphore/apps/ansible/9.4.0/venv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
_=/usr/bin/env
==========

In this case, --varOne and VAR_TWO are survey vars. --arg3 is an arg passed to the task, --arg1 and --arg2 are part of the template.
--ExtraVar and --SecretExtra are part of the environment along with ENV_VAR and SECRET_ENV

@fiftin
Copy link
Collaborator

fiftin commented Aug 19, 2024

Thank you!

@fiftin fiftin merged commit c285829 into semaphoreui:develop Aug 19, 2024
11 checks passed
@fukuchii
Copy link

Hello, is this fix already in the latest docker image?

@yp-zhu
Copy link

yp-zhu commented Aug 29, 2024

yes, I pull the image from "develop" and worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants