This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| for i in cd-*; do ls $i; done | |
| #The above command to check that all the files which are starting from cd-* is listing or not. | |
| for i in cd-*; do sudo rm $i; done | |
| #The above command will delete all the files which start with `cd-`. | |
| #Note: sudo command is not needed if you are performing the above command as `root` or `privileged user` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| du -ahx . | sort -rh | head -2 | sed 1d | awk -F"./" '{ print $2 }' | xargs -I {} sudo aws s3 mv {} s3://s3example/me/mee-u/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sed -i ":a;\\$!{N;ba};s/\\(app:\\ [a-z-]\\+\\)/\\1\\n\\ image: ${dev_tag}/4" /var/lib/jenkins/workspace/$JOB_NAME/marlo/'''+params.Environment+'''-apps/'''+params.Environment+'''-${c}.yaml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Jenkins .instance.getItemByFullName("JobName") | |
| .getBuildByNumber(JobNumber) | |
| .finish(hudson.model.Result.ABORTED, new java.io.IOException("Aborting build")); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| stage('CopyArtifactToJump') { | |
| steps { | |
| sshagent(credentials : ['18dddd8d7-d912-4123-bf66-303cvvvvv']) { | |
| sh 'ssh -o StrictHostKeyChecking=no [email protected] uptime' | |
| sh 'scp /jenkins-home/workspace/dev-build/*.tar [email protected]:/home/jenkins-sl/workspace/volan/' | |
| } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| wget https://github.com/returntocorp/semgrep/releases/download/v0.15.0/semgrep-v0.15.0-ubuntu-generic.sh | |
| chmod +x semgrep-v0.15.0-ubuntu-generic.sh | |
| ./semgrep-v0.15.0-ubuntu-generic.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| echo "Termination of Instance process will start now" | |
| curl -s http://metadata.google.internal/computeMetadata/v1/instance/name -H "Metadata-Flavor: Google" > /home/ubuntu/a | |
| touch /home/ubuntu/_SUCCESS | |
| filey="/home/ubuntu/_SUCCESS" | |
| if [ -f "$filey" ]; then | |
| cat /home/ubuntu/a | xargs -I {} gcloud compute instances delete {} --zone=us-central1-a --delete-disks=all --quiet | |
| echo "Instance will get terminated" | |
| else | |
| cat /home/ubuntu/a | xargs -I {} gcloud compute instances stop {} --zone=us-central1-a --quiet | |
| echo "Instance will gonna stop" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Getting hostname of the instance via Metadata | |
| curl http://metadata.google.internal/computeMetadata/v1/instance/hostname -H "Metadata-Flavor: Google" | |
| #Getting ID of the instance | |
| curl http://metadata.google.internal/computeMetadata/v1/instance/id -H "Metadata-Flavor: Google" | |
| #Getting Instance-name via Metadata | |
| curl http://metadata.google.internal/computeMetadata/v1/instance/name -H "Metadata-Flavor: Google" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| logdirect="/dataa/app-service-1.0-SNAPSHOT/" | |
| cd $logdirect | |
| ls | grep ".log.gz" | awk '{print $1}' | head -n -3 | xargs -I {} aws s3 mv {} s3://cass-doc/app-logs/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo docker ps -a | grep "Exited" | sudo xargs docker rm |
NewerOlder