Questions tagged [shell-script]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
54 votes
5 answers
16k views

How is Ansible different from simply running a provisioning bash shell in Vagrant?

A team of IT sysadmins that have exprience using shell scripting to solve their problems, are contemplating to start using Ansible instead. Are there substantial differences and good reasons to start ...
Evgeny Zislis's user avatar
5 votes
2 answers
6k views

docker-compose multiple services in a loop

Trying to optimize definition of multiple services with docker-compose.yml Here is the original, "dumb" variant of the docker-compose.yml: version: '3' services: s1: build: . ports: - "...
Alexander Shcheblikin's user avatar
4 votes
1 answer
3k views

Jenkins Exception that is caused by stdout redirection using windows cmd

I'm trying to execute an exec file from a jenkins server, using windows cmd. This is what is run from jenkins Windows batch window: C:\MyApp\MyApp.exe When run regularly from command line, the app ...
Noam Ohana's user avatar
4 votes
3 answers
4k views

Jenkins - sending email after build with the build version as a subject

I would like to send an email at the end of my build to inform success or failure. I'm using the email ext-plugin for Jenkins. I want the version number of the build to be the subject of the email. ...
Noam Ohana's user avatar
4 votes
0 answers
649 views

Problems with integrating Python script in a Bash script Git pre-receive hook [closed]

We have a pre-receive hook script in a bash shell script that enforces commits with messages having the right ticket number in a pre-defined format. We also have a separate python script that can be ...
sage's user avatar
  • 199
3 votes
1 answer
275 views

Cassandra DB: store binary file record via shell

While the dev team works on a REST service to manage binary data in Cassandra, ops would like to store local blobs directly from shell. Is it actually possible via CQL/bash without a Cassandra driver?...
Ta Mu's user avatar
  • 6,810
3 votes
1 answer
16k views

npm not found but installed from the shell script file in Dockerfile

I have a following Dockerfile: FROM ubuntu:18.04 RUN mkdir app && cd app WORKDIR app/ RUN apt-get update && apt-get install -y \ software-properties-common \ curl \ sudo ...
Leon Ma's user avatar
  • 33
3 votes
1 answer
3k views

Run scripts which are stored in GitLab from Jenkins

I have configured Jenkins Build Jobs and Deployment Jobs from using Jenkins shell. But I put all the commands in Shell to execute. Can I store those commands in GitLab and execute from jenkins?
Janith's user avatar
  • 173
2 votes
1 answer
83 views

Suggestions for a good run command review console

Is there a good web console or tool that would help enable us to review Shell Scripts? Usually when maintaining a system, we would run scripts that are managed, or we could run scripts that run only ...
JeffJen's user avatar
  • 21
2 votes
1 answer
1k views

Prevent ${PIPELINESTATUS[0]} from being evaluated in Jenkinsfile

Below is a script I am running in the deploy of a docker container. The docker ps -a | grep $APP_CONTAINER_NAME command is returning non-zero when the container was not correctly built/tested, hence ...
jdcskillet's user avatar
2 votes
1 answer
25 views

Any site to host my little utility script? [closed]

I have a small node js script running in my aws ec2. It is just one file. If I hit the server with a query param, it will do some utility job (like hashing) and return the result in html. Since its a ...
Mani Bharathy's user avatar
2 votes
1 answer
142 views

How can I monitor docker volume usage?

I'm planning to automate docker activities using python. However, I couldn't find any efficient command for monitoring docker volume. So now I wish to use shell commands for that and later it can be ...
Aaditya R Krishnan's user avatar
2 votes
2 answers
2k views

How to read array and loop server selection and deployment

I have configured jenkins parameter deployment job using active choices parameterize plugin. In my dev server section have two servers called, 192.168.94.139, 192.168.94.140 I want to read this ...
Janith's user avatar
  • 173
2 votes
2 answers
85 views

Automatic production deployment for a Node.js app on RHEL 7?

I am looking for some way to have a maximally simple(no Jenkins or anything like that) automatic production deployment for a Node.js application on a RHEL 7 system. The caveat is: At the organization ...
Megakoresh's user avatar
2 votes
1 answer
193 views

Bash Tokenization Errors on Jenkins JNLP Slave

Why might the below bash commands give me an error on a Jenkins JNLP slave in Kubernetes cluster? Each work on a local machine. Error: Syntax error: redirection unexpected IFS='/' read -r -a branch ...
Brandon Clark's user avatar
1 vote
2 answers
46 views

Docker preserve images policy

Can I configure Docker in a such way that it will store only certain amount of tags for the given image e.g. docker images REPOSITORY TAG ...
Most Wanted's user avatar
1 vote
4 answers
2k views

shell script to pass values properties file in java

I have a properties file that looks like this: mysql.username=USERNAME mysql.pass=PASS I need to change USERNAME and PASS with variable values passed to shell script. I cannot use sed since that ...
systemdebt's user avatar
1 vote
2 answers
15k views

How to add shell script to jenkins freestyle job

I have the below shell script: du -sh /bbhome/shared/data/repositories/* |sort -h |tail -20 | while IFS= read -r line;do DIR=`echo $line | awk '{print$2}'` Rep=`cat $DIR/repository-...
arielma's user avatar
  • 329
1 vote
1 answer
4k views

Add mapping ip and host into /etc/hosts with docker

I am using docker to scale my service. I know there's a command called --add--host for adding host into /etc/host However, I have a bunch of hosts need to be added. It's just too long to launch a ...
rj487's user avatar
  • 143
1 vote
1 answer
3k views

How to exit a jenkins job if a script executing gets access denied?

I have written this script that performs db backup #!/bin/bash #For taking backup DIR=/media/storage/backup/db_backup/ DATESTAMP=$(date +%d-%m-%y-%H-%M) DB_USER=backup DB_PORT=$2 DB_PASS='secret' ...
Chang Zhao's user avatar
1 vote
1 answer
901 views

SSH connection to jenkins server

I have a absh script which connects and exexutes programs from my local to remote server and now this should be executed from jenkins build so for this jenkins is taking continous changes from git for ...
Sakshi Rathore's user avatar
1 vote
1 answer
1k views

create entry-point script to get all env variables starting with VUE_APP_ and take it's value

I would like to Dockerize my existing vuejs app for staging , production and I used multi staged approach to create my app container and I'm using Ubuntu 18.04 and this is my, Dockerfile # build stage ...
soldier's user avatar
  • 115
1 vote
1 answer
520 views

Best learning resources for continuous integration tools like Jenkins [duplicate]

I am a .NET developer , I have decided to learn DevOps continuous integration tools. One of my folk asked me to learn below tools and language: Jenkins Shell Scripting Python I have found below ...
Shaiju T's user avatar
  • 111
1 vote
0 answers
76 views

Why is my Gitlab shell executor only returning "0 0"?

All the sudden my self-hosted runner set to use the shell executor started returning "0 0" which is causing the pipeline to incorrectly "succeed" at every step without executing ...
kriipke's user avatar
  • 11
1 vote
0 answers
111 views

Application deployed in tomcat cannot be started through Jenkins pipeline [closed]

I've deployed an application deployed in tomcat and want to restart and hence stop it first and then start it with following code - def startServer() { withEnv(['JENKINS_NODE_COOKIE=dontkill']) { ...
Alpha's user avatar
  • 173
1 vote
1 answer
12k views

Set environment variables then run script in Jenkins Scripted Pipeline

I am new to Jenkins, Groovy and pipelines. I have created a simple pipeline stage like so: //working build but not setting env variables node('build-01') { stage('Building') { echo "[*] ...
Perplexabot's user avatar
0 votes
3 answers
170 views

Is there a php (or composer) command to change upload_max_filesize && post_max_size from terminal?

Is there a php (or composer) terminal command to change the php.ini variables upload_max_filesize and post_max_size from terminal to some value directly from terminal, without sed or awk operations? ...
user avatar
0 votes
2 answers
127 views

replacing values in shell script using sed [closed]

My shell script looks like this: FAILED_REQUEST_DIRECTORY=/bla/bla2 \ java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=1234 \ -jar /xyz/abc-service-1.0-SNAPSHOT.jar \ --...
systemdebt's user avatar
0 votes
1 answer
114 views

The right way to Ansiblically deploy environments directly from Github:

Can one deploy an environment for some Linux OS (say, Ubuntu) from a raw Github playbook in a way similar to this (I wonder if it's the correct syntax)? bash <(curl -s https://raw....
Arcticooling's user avatar
0 votes
1 answer
25 views

How to determine the color of a shell script task in Ansible?

There are various Ansible modules which can execute my own-written script (ansible.builtin.script, ansible.builtin.shell, ansible.builtin.command). However, I would like to determine the color of the ...
peterh's user avatar
  • 131
0 votes
3 answers
170 views

How to avoid build scripts duplication

Let's say you've got several code repositories on GitHub. You want to build, test and deploy them. You picked a continuous integration service (e.g. Travis CI, AppVeyor or something else) and wrote ...
Sergey Anisimov's user avatar
0 votes
0 answers
4 views

How to collect cumulative report for 32 repos?

We use separate Jenkins jobs to collect unit tests and coverage for each repository. There are 32 such repos. How do we collect cumulative report? Currently we are going into each job and collecting ...
TheDevOpsMonk's user avatar
0 votes
0 answers
5 views

Extract RDS address value using data external in terraform

I am using data external block to extract the address of RDS data "external" "rds_endpoint" { program = ["/bin/bash", "-c", "aws rds describe-db-...
Devang Sanghani's user avatar
0 votes
0 answers
14 views

Contabo's Object Storage - Object Lock Retention (AWS S3 compatible)

I'm having difficulty with Contabo's Object Storage. With a user with permission: "S3 Object Storage Read and Write" I configured a aws profile called 'backup'. With this profile, I ran this ...
Allan Andrade's user avatar
0 votes
2 answers
3k views

What is the difference between CMD and terminal in Windows machine?

While using the Windows machine we face soo much trouble running the command line scripts on CMD(command prompt). Few commands run successfully but some are not. Why is there any difference between ...
Rashid's user avatar
  • 101
0 votes
2 answers
438 views

Programmatically scrape the latest version of Tomcat for an installation script

Looking for some assistance or ideas on how to grab the latest version of a Tomcat release from their website or other website. I came across these Stack Overflow/Stack Exchange links that were ...
Keegan Jacobson's user avatar
-1 votes
0 answers
66 views

How can I provision using Vagrant if I need a system restart in the middle of the provisioning process?

Good day to you all, How can I approach the following case: System: CentOS Stream/7-8; RHEL; Fedora Vagrant up (init a machine) with shell script provisioning as a file. Case: I go for a full update, ...
Vasil's user avatar
  • 1
-3 votes
2 answers
2k views

How can CaaS, PaaS, and FaaS users know if the operating system of their server environment is of the newest release?

Please consider this chart a moment; it shows the different hosting models common today: From the chart I learn that CaaS, PaaS and FaaS are three hosting-models by which a user can't control the OS ...
user avatar
-3 votes
1 answer
182 views

Set user in aws

I have a lot of instance in aws.I have build through terraform. I have made scripts of making user(e.g. user1 rather than ec2-user).But i am facing one issue.when i check .ssh/authorized_key. I have ...
MeetGadhiya's user avatar
-5 votes
1 answer
111 views

Shell Scripting [closed]

I am trying to execute a PHP shell script on my friends mail server to show him the impact of such vulnerability. Vulnerable code but unfortunately it doesn't seem to be running. This is the script I ...
Jaipravin AKA Christopher's user avatar