DevOps interview Q
DevOps interview Q
Docker Scenarios
Kubernetes Scenarios
Jenkins Scenarios
groovy
CopyEdit
stage('Deploy') {
when {
expression { currentBuild.result == 'SUCCESS' }
}
steps {
sh 'deploy.sh'
}
}
yaml
CopyEdit
- name: Deploy app
hosts: "{{ target_env }}"
tasks:
- debug: msg="Deploying to {{ target_env }}"
yaml
CopyEdit
serial: 1
tasks:
- name: Restart service
service:
name: myapp
state: restarted
yaml
CopyEdit
- name: Restart if service is running
service:
name: myapp
state: restarted
when: ansible_facts['services']['myapp']['state'] ==
'running'
yaml
CopyEdit
- task: TerraformTaskV1
inputs:
command: 'apply'