run_command - run all the user defined commands in shell
See original GitHub issue[dhodovsk@shiny hello-world]$ ll .print_version.sh
-rwxrwxr-x. 1 dhodovsk dhodovsk 60 Jan 27 13:47 .print_version.sh
[dhodovsk@shiny hello-world]$ cat .packit.yaml
---
specfile_path: hello.spec
synced_files:
- hello.spec
upstream_project_name: hello
downstream_package_name: hello
actions:
create-archive:
- python3 setup.py sdist --dist-dir .
- .print_version.sh
[dhodovsk@shiny hello-world]$ packit srpm
Packit 0.8.1 is being used.
Input is a directory: /home/dhodovsk/repos/github.com/packit-service/hello-world
WARNING 'upstream_project_name' configuration key was renamed to 'upstream_package_name', please update your configuration file
Input directory is an upstream repository.
Using user-defined script for ActionName.create_archive: [['python3', 'setup.py', 'sdist', '--dist-dir', '.'], ['.print_version.sh']]
ERROR Preparing of the upstream to the SRPM build failed: [Errno 2] No such file or directory: '.print_version.sh': '.print_version.sh'
[dhodovsk@shiny hello-world]$
It works OK when its called using bash:
[dhodovsk@shiny hello-world]$ cat .packit.yaml
---
specfile_path: hello.spec
synced_files:
- hello.spec
upstream_project_name: hello
downstream_package_name: hello
actions:
create-archive:
- python3 setup.py sdist --dist-dir .
- bash .print_version.sh
[dhodovsk@shiny hello-world]$ packit srpm
Packit 0.8.1 is being used.
Input is a directory: /home/dhodovsk/repos/github.com/packit-service/hello-world
WARNING 'upstream_project_name' configuration key was renamed to 'upstream_package_name', please update your configuration file
Input directory is an upstream repository.
Using user-defined script for ActionName.create_archive: [['python3', 'setup.py', 'sdist', '--dist-dir', '.'], ['bash', '.print_version.sh']]
Created archive: /home/dhodovsk/repos/github.com/packit-service/hello-world/hello-0.1.0.tar.gz
SRPM is /home/dhodovsk/repos/github.com/packit-service/hello-world/hello-0.7.0.4.gace1326-1.fc30.src.rpm
SRPM: /home/dhodovsk/repos/github.com/packit-service/hello-world/hello-0.7.0.4.gace1326-1.fc30.src.rpm
If it is not possible, we should document it clearer in doc.
Issue Analytics
- State:
- Created 4 years ago
- Comments:15 (12 by maintainers)
Top Results From Across the Web
How To Execute a Command with a Shell Script in Linux
Creating and Running a Basic Shell Script · Press ESC · Type : (colon character) · Type wq · Press ENTER.
Read more >How to run command or code in parallel in bash shell under ...
Use the wait command built-in command with & . The xargs command. This page shows how to run commands or code in parallel...
Read more >How can one run user-defined commands in the ... - Ask Ubuntu
The easiest way I can think of is to create a script in ~/.local/bin (or in /usr/local/bin if the command should be available...
Read more >How can we run a command stored in a variable?
Simply declare a function with the command inside, and run the function as if it were a command. Expansions in commands within the...
Read more >Running commands in the shell - PowerShell | Microsoft Learn
The PowerShell call operator ( & ) lets you run commands that are stored in variables and represented by strings or script blocks....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Would introducing a shell and exec form for actions help resolving some of these problems? This would be similar to how ENTRYPOINT works in a Dockerfile.
This way if a command is provided in exec form, it would be also executed as such, if it’s provided in shell form it would be executed as such and the code wouldn’t have to deal with conversions.
As users wrote exec form for actions until now, I think there is no consistent way to suddenly take those commands and try to run it in shell.
Probably the above would require introducing versioning in package configuration, as the change would be backwards incompatible.
I’m not aware of any and I don’t know about anyone being bothered by the need to add “bash -c” for their commands to use a shell.
I have the feeling that on the long run solving this (supporting both exec and shell) would be nice. And it would nice if the solution would follow and already existing (and known) one. But we will need versioning for this in order to not to brake compatibility.
On the short term it’s not a priority, though.