40
votes
Accepted
How is Ansible different from simply running a provisioning bash shell in Vagrant?
I never used Ansible but since a few weeks, I try to figure out what good Ansible could be in comparison with shell scrips–Which proves, at least in my case, that the haunting ad-campaigns they run ...
25
votes
How is Ansible different from simply running a provisioning bash shell in Vagrant?
When you put it this way, even if Ansible has some inherent advantages, the benefits of using familiar tools (in this case shell scripting) must be outweighed. I don't think there's a clear cut answer ...
14
votes
How is Ansible different from simply running a provisioning bash shell in Vagrant?
The above answer covers part of it but misses one of the important elements: convergent design. I wrote some words a while ago about this in the context of Chef at https://coderanger.net/thinking/ but ...
5
votes
Accepted
Cassandra DB: store binary file record via shell
The only way to do it with cqlsh is wrap binary file into CSV file and run cqlsh --some_args -e 'COPY table_name FROM binary_wrapped.csv', but in order to do so you have to generate a new primary key ...
5
votes
docker-compose multiple services in a loop
Not in pure Docker Compose. If you have a plain-text templating engine you like (Mustache, Jinja, m4, ...) you can ask it to do this for you.
You tagged this as shell-script, and Compose can take ...
4
votes
How is Ansible different from simply running a provisioning bash shell in Vagrant?
It's 2019 and I've just spent a few days on an ansible learning curve and here is the absolute truth:
Ansible isn't worth the trouble.
it's not finished, it doesn't run on windows and the ...
3
votes
Accepted
Prevent ${PIPELINESTATUS[0]} from being evaluated in Jenkinsfile
There seems to be some syntax issues and also I would suggest to use bash instead if using sh shell.
Try the below code and see if this works properly.
(EDIT - Put shebang on first line to accept as ...
3
votes
Accepted
npm not found but installed from the shell script file in Dockerfile
The issue is that prereqs-ubuntu.sh uses bash to install the npm. While the RUN directive uses sh to run the commands.
Where is the npm installed
root@2cd4a6af90f4:/app# type npm
npm is /root/.nvm/...
3
votes
Accepted
The right way to Ansiblically deploy environments directly from Github:
There is no "right" or "wrong". If the commands work when you type them in, then they work, and we won't keep you from doing it.
Everything else is opinion. Sure, there are some best practices, for ...
3
votes
Accepted
Is there a php (or composer) command to change upload_max_filesize && post_max_size from terminal?
The reason; having a more a version-agnostic and more
backward-compatible directive in my server-environment-establishment
script, to change the values of these two variables.
If you're trying to ...
3
votes
How is Ansible different from simply running a provisioning bash shell in Vagrant?
One thing worth noting that you will have less issues in running your ansible playbooks on remote hosts too. As it's the main reason for running ansible. When you are using shell scripting you still ...
3
votes
Docker preserve images policy
I do not believe that there is a way to set this as a global policy. However, there is a simple command you can run that will "prune" or remove your unused images.
You will want to use docker image ...
3
votes
docker-compose multiple services in a loop
Using docker-compose version 3.3 extensions and with the long variants for ports & volumes:
version: '3.3'
services:
s1: &s
build: .
ports:
- published: 5001
target: 9000
...
3
votes
Suggestions for a good run command review console
I am looking for a way for our members to submit scripts without fussing too much about format or folder structure.
It sounds like you need some combination of testing and linting, perhaps with a few ...
2
votes
Shell Scripting
Please provide more information about the method and the result as Husyn asked, it may be more suited to programming SO if it is PHP related. Anyway:
<?php should be present at the start of any ...
2
votes
Accepted
replacing values in shell script using sed
Negation to the rescue:
sed -i "s/server.address=[^\ ].*\ /server.address=${SERVER_ADDRESS} /g"
This is telling to search zero or more characters (.*) NOT matching whitespace ([^\ ]) up to the first ...
2
votes
Accepted
Jenkins Exception that is caused by stdout redirection using windows cmd
I found out how to do it without pipeline. It only has to do with command line script:
start "" C:\MyApp\MyApp.exe >> text.txt
This call is asynchronous (i.e., the command line won't wait for ...
2
votes
Add mapping ip and host into /etc/hosts with docker
You could try to use docker compose and the docker compose "extra_hosts" tag, as described on the docker compose specification at https://docs.docker.com/compose/compose-file/.
extra_hosts
Add ...
2
votes
How to read array and loop server selection and deployment
Look this:
#!/bin/bash
#Get servers list
set -f
string=$DEPLOY_SERVER
array=(${string//,/ })
for i in "${!array[@]}"do
echo "Deploy project on server ${array[i]}"
done
I found this ...
2
votes
How can I monitor docker volume usage?
I'd recommend a temporary container for this. It will work on just about any version of docker, and supports named volumes with non-default settings, e.g. that store data on remote systems (e.g. NFS) ...
2
votes
Any site to host my little utility script?
Have you considered running this on AWS Lambda. It will probably forever free under free tier. There may be a couple of cents cost on API Gateway.
Otherwise you can rent outdated servers for cents per ...
1
vote
Accepted
How to add shell script to jenkins freestyle job
For executing the command in the Jenkins Freestyle Job.
#!/bin/bash
du -sh /bbhome/shared/data/repositories/* |sort -h |tail -20 |
while IFS= read -r line;do
DIR=`echo $line | awk '{print$2}'...
1
vote
How to add shell script to jenkins freestyle job
You can specify the script in the "execute shell" step of the build. Where it gets executed will depend on what labels the job needs, and which nodes those labels are associated with.
It sounds like ...
1
vote
Accepted
Run scripts which are stored in GitLab from Jenkins
If you are using Gitlab merely as a source code repository, and you are triggering the jobs when there are changes to the repository.
The Jenkins Gitlab plugin documentations states:
This plugin ...
1
vote
Is there a php (or composer) command to change upload_max_filesize && post_max_size from terminal?
PHP has supported conf.d configuration subdirectories for ages now (cf. PHP_INI_SCAN_DIR in its documentation, this stuff is as old as PHP 5 basically) - allowing you to simply add a small file ...
1
vote
replacing values in shell script using sed
You can do this using perl
For Example
perl -pi -e "s/server.address=localhost/server.address=${SERVER_ADDRESS}/g" file_path
This command change server address value localhost to vaariable value.
...
1
vote
How to avoid build scripts duplication
You could extract the common, shareable portions of the scripts which you'd package as either standalone scripts or libraries (depending on the scripting language you use and/or preferences), placed ...
1
vote
shell script to pass values properties file in java
You should regenerate this file from a template using your configuration management system of choice.
You could also write a shell script that uses a heredoc to do the same thing. But since we're in ...
1
vote
shell script to pass values properties file in java
You can use below.
[user@xyz ~]$ hh='mysql.username=USERNAME';echo $hh | awk -F"=" '{OFS=FS}{ $2="Mango"; print }'
mysql.username=Mango
1
vote
Accepted
shell script to pass values properties file in java
You can obtain old parameters from the properties file before using sed, e.g.
# get old parameters
$ export oldUsername=$(grep mysql.username $FILE | cut -d'=' -f2)
$ export oldPass=$(grep mysql.pass ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
shell-script × 37jenkins × 10
bash × 8
docker × 6
jenkins-pipeline × 4
git × 3
gitlab × 3
linux × 3
windows × 3
github × 3
ansible × 2
continuous-integration × 2
dockerfile × 2
automation × 2
python × 2
php × 2
environment-variables × 2
kubernetes × 1
terraform × 1
docker-compose × 1
jenkins-plugins × 1
security × 1
terminology × 1
jenkinsfile × 1
gitlab-ci-runner × 1