This file contains 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
def commonFunction () { | |
echo "Hello inception" | |
} | |
def commonFunctionAsVariable = this.&commonFunction | |
def callFunction(functionAsVariable) { | |
functionAsVariable() | |
} |
This file contains 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 %F IN ("%SystemRoot%\servicing\Packages\Microsoft-Windows-GroupPolicy-ClientTools-Package~*.mum") DO (DISM /Online /NoRestart /Add-Package:"%F") | |
FOR %F IN ("%SystemRoot%\servicing\Packages\Microsoft-Windows-GroupPolicy-ClientExtensions-Package~*.mum") DO (DISM /Online /NoRestart /Add-Package:"%F") |
This file contains 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
def archive_name | |
pipeline { | |
agent any | |
stages { | |
stage('copy') { | |
steps { | |
script { | |
archive_name = sh ( script: "ssh 192.168.64.15 ls /opt/app", |
This file contains 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
pipeline { | |
agent any | |
stages { | |
stage('Step One') { | |
steps { | |
sh 'echo "Hello from step one"' | |
} | |
} | |
stage('Manual approval') { |
This file contains 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
pipeline { | |
agent any | |
stages { | |
stage('Call Pipeline One') { | |
steps { | |
build job: 'pipeline-one' | |
} | |
} | |
stage('Call Pipeline Two') { |
This file contains 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
pipeline { | |
agent any | |
stages { | |
stage("copy") { | |
steps { | |
// to copy files from first-server to second-server | |
sh "scp 192.168.64.15:/opt/app-name/outbox/test.txt 192.168.64.14:/opt/app-name/inbox" | |
} | |
} |
This file contains 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
pipeline { | |
agent any | |
stages { | |
stage('install and test') { | |
steps { | |
// the script is multi-line because if the instructions where in independent steps there are errors of command not found with nvm and npm | |
sh ''' | |
# nvm install | |
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash |
This file contains 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 | |
sudo yum update | |
sudo yum install ruby -y | |
sudo yum install wget | |
CODEDEPLOY_BIN="/opt/codedeploy-agent/bin/codedeploy-agent" | |
$CODEDEPLOY_BIN stop | |
sudo yum erase codedeploy-agent -y | |
cd /home/ec2-user | |
#Executar comando semelhante ao abaixo, mudar a região caso necessário: | |
wget https://aws-codedeploy-us-east-1.s3.us-east-1.amazonaws.com/latest/install |
This file contains 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 | |
sudo yum update -y | |
sudo yum install docker -y | |
sudo systemctl start docker.service | |
sudo chmod 666 /var/run/docker.sock | |
sudo yum install python3-pip | |
sudo pip3 install docker-compose | |
docker ps | |
docker info |
This file contains 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
Client: | |
Context: desktop-linux | |
Debug Mode: false | |
Plugins: | |
buildx: Docker Buildx (Docker Inc., v0.9.1) | |
compose: Docker Compose (Docker Inc., v2.13.0) | |
dev: Docker Dev Environments (Docker Inc., v0.0.5) | |
extension: Manages Docker extensions (Docker Inc., v0.2.16) | |
sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc., 0.6.0) | |
scan: Docker Scan (Docker Inc., v0.22.0) |
NewerOlder