Questions tagged [shell-script]
The shell-script tag has no usage guidance.
37
questions
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 ...
1
vote
0
answers
67
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 ...
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'
...
0
votes
0
answers
58
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, ...
0
votes
1
answer
2k
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 ...
1
vote
0
answers
104
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']) {
...
2
votes
1
answer
81
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 ...
1
vote
1
answer
890
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 ...
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 ...
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:
- "...
2
votes
1
answer
129
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 ...
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
...
1
vote
2
answers
45
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 ...
1
vote
2
answers
14k
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-...
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 ...
3
votes
1
answer
15k
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 ...
1
vote
1
answer
3k
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 ...
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 "[*] ...
0
votes
2
answers
372
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 ...
0
votes
2
answers
92
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 \
--...
0
votes
3
answers
165
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 ...
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 ...
2
votes
1
answer
182
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 ...
-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 ...
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 ...
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?
0
votes
3
answers
162
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?
...
-3
votes
1
answer
167
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 ...
0
votes
1
answer
113
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....
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.
...
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 ...
3
votes
1
answer
267
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?...
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 ...
-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 ...
1
vote
1
answer
513
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 ...
4
votes
0
answers
642
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 ...
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 ...