Skip to content

Instantly share code, notes, and snippets.

Questions are not from any actual exam!!!
Q: Create a job that calculates pi to 2000 decimal points using the container with the image named perl
and the following commands issued to the container: ["perl", "-Mbignum=bpi", "-wle", "print bpi(2000)"]
Once the job has completed, check the logs to and export the result to pi-result.txt.
Solution:
node_version:=$(shell node -v)
npm_version:=$(shell npm -v)
timeStamp:=$(shell date +%Y%m%d%H%M%S)
.PHONY: install build archive test clean
show:
@ echo Timestamp: "$(timeStamp)"
@ echo Node Version: $(node_version)
@hassane1986
hassane1986 / jenkinsfile.md
Created January 21, 2022 21:10 — forked from amitthk/jenkinsfile.md
jenkinsfile input
stage 'promotion'
def userInput = input(
 id: 'userInput', message: 'Let\'s promote?', parameters: [
 [$class: 'TextParameterDefinition', defaultValue: 'uat', description: 'Environment', name: 'env'],
 [$class: 'TextParameterDefinition', defaultValue: 'uat1', description: 'Target', name: 'target']
])
echo ("Env: "+userInput['env'])
echo ("Target: "+userInput['target'])

** Make sure jenkin is in docker group **

sudo sudo usermod -aG docker $USER
sudo usermod -aG docker jenkins

** Update the docker.service **

Edit the following file : vi /usr/lib/systemd/system/docker.service

@hassane1986
hassane1986 / docker.compose.yaml
Created January 21, 2022 21:09 — forked from amitthk/docker.compose.yaml
docker compose for postgresql + springboot rest api
version: '2.0'
services:
postresql_db:
build:
context: ./ansible/dev/docker/postgresql/
volumes:
- ./ansible/dev/docker/postgresql/db:/var/lib/postgresql/data
ports:
- 5432:5432
environment:
@hassane1986
hassane1986 / main.yml
Created January 21, 2022 21:08 — forked from amitthk/main.yml
ansible docker_container playbook with postgresql springboot nginx
---
- hosts: localhost
connection: local
become: true
gather_facts: true
vars_files:
- settings.yaml
vars:
proj_name: "devopscicd"
nginx_host: "devopscicd.xyz.com"