Skip to content

Instantly share code, notes, and snippets.

View VireshDoshi's full-sized avatar
💭
working

Viresh Doshi VireshDoshi

💭
working
  • London
View GitHub Profile
@VireshDoshi
VireshDoshi / bash
Created February 1, 2018 10:12
command to startup containerised Jenkins
docker run -p 8080:8080 -p 50000:50000 jenkins/jenkins:latest
@VireshDoshi
VireshDoshi / Jenkinsfile
Last active September 19, 2021 05:38
Jenkinsfille configuration - build and push image to docker hub
node {
def myImage
stage('Clone repository') {
/* Let's make sure we have the repository cloned to our workspace */
dir('.') {
git url: 'https://github.com/VireshDoshi/jen-build-node-app-aws.git'
}
}
@VireshDoshi
VireshDoshi / Dockerfile
Created February 18, 2018 13:46
Dockerfile for node apps with devops tools baked in like git, terraform and packer
FROM node:8.9.4
RUN mkdir /root/packer
WORKDIR /root/packer
RUN wget https://releases.hashicorp.com/packer/1.1.3/packer_1.1.3_linux_amd64.zip
RUN wget https://releases.hashicorp.com/terraform/0.11.1/terraform_0.11.1_linux_amd64.zip
RUN apt-get update \
@VireshDoshi
VireshDoshi / execution output
Last active February 18, 2018 20:51
Ansible playbook with_file demo
[vdo023@localhost loop_with_file]$ ansible-playbook -i "localhost," -c local ./with_files-playbook.yml
PLAY [localhost] **********************************************************************************************************************************
TASK [Gathering Facts] ****************************************************************************************************************************
ok: [localhost]
TASK [create a file number 1 for this example] ****************************************************************************************************
ok: [localhost]
[vdo023@localhost jinja2-map]$ ansible-playbook -i "localhost," ./j2-map-playbook.yml
PLAY [localhost] **********************************************************************************************************************************
TASK [establish the first name from the mps dictionary] *******************************************************************************************
ok: [localhost] => {
"msg": [
"Tony",
"Theresa",
"Nigel"
[vdo023@localhost selectattr]$ ansible-playbook -i "localhost," ./selectattr-playbook.yml
PLAY [localhost] **********************************************************************************************************************************
TASK [extract the emails for users without a password] ********************************************************************************************
ok: [localhost]
TASK [debug message] ******************************************************************************************************************************
ok: [localhost] => (item=johnsmith@gmail.com) => {
"changed": false,
[vdo023@localhost list_dicts]$ ansible-playbook -i "localhost," ./list_dicts-playbook.yml
PLAY [Test playbook for checking dictionaries] ****************************************************************************************************
TASK [Gathering Facts] ****************************************************************************************************************************
ok: [localhost]
TASK [Accessing direct dictionary] ****************************************************************************************************************
ok: [localhost] => {
"msg": "hostname is test and ip is 127.0.0.1"
[vdo023@localhost modify_list]$ ansible-playbook -i "localhost," ./modify_list-playbook.yml
PLAY [localhost] **********************************************************************************************************************************
TASK [modify the list values by appending to the end with _changed] *******************************************************************************
ok: [localhost] => {
"msg": "before value: [u'listitem_1', u'listitem_2'] after value: [u'listitem_1_changed', u'listitem_2_changed']"
}
TASK [modify the list values by appending to the end with .changed] *******************************************************************************
@VireshDoshi
VireshDoshi / test_selenium_grid.py
Created February 22, 2018 10:12
one page selenium grid python script
[vdo023@localhost ASOS_BDD_WebTester]$ cat ./test_selenium_grid.py
import unittest
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import Select
class PythonOrgSearch(unittest.TestCase):
def setUp(self):
self.driver = webdriver.Remote(
@VireshDoshi
VireshDoshi / terraform-project.text
Created February 26, 2018 09:13
terraform project structure
terraform_project/
--> autoscaling_groups/
--> variables.tf
--> website-asg.tf
--> launch_configurations/
--> variables.tf