Skip to content

Instantly share code, notes, and snippets.

View vcarmen's full-sized avatar

Carmen vcarmen

View GitHub Profile
you must allow jenkins to tun the script in /etc/sudoers.
jenkins ALL = NOPASSWD: /path/to/script
@vcarmen
vcarmen / enable_docker_rest_api
Created April 24, 2019 23:14
enable_docker_rest_api
https://medium.com/@ssmak/how-to-enable-docker-remote-api-on-docker-host-7b73bd3278c6
ubuntu@awt02-devops:~$ sudo vi /lib/systemd/system/docker.service
#add this -H=tcp://0.0.0.0:2375 to the next line
ExecStart=/usr/bin/dockerd -H=fd:// -H=tcp://0.0.0.0:2375
ubuntu@awt02-devops:~$ sudo systemctl daemon-reload
ubuntu@awt02-devops:~$ sudo service docker restart
ubuntu@awt02-devops:~$ curl http://localhost:2375/images/json
[]
//task to update file content
task updateBuildNum {
def productVersion="1.2.3.0"
def buildNum="1.2.3.4521"
String contents = new File( '/tmp/dir/BuildNum.plist' ).getText( 'UTF-8' )
contents = contents.replaceAll( 'version = "0.0.0.0"', 'version = '+'"'+"${productVersion}"+'"')
contents = contents.replaceAll( 'buildNum = "0.0.0.0"', 'buildNum = '+'"'+"${buildNum}"+'"')
new File( 'build/BuildNum.plist' ).write( contents, 'UTF-8' )
}
@vcarmen
vcarmen / .sh
Created November 9, 2018 02:13
Vagrant commands
# Otherwise connection errores will displayed, after doing up you can edit and add the keys
# How to generate an existing box to share
vagrant package --output mynewbox.box
# Add shared box, you must specified the file full path
vagrant box add my-box file:///f:/courses/boxes/newbox.box
# In order to verify that box was added, you could run
vagrant box list
# this is example result of the box added manually