Skip to content

Instantly share code, notes, and snippets.

@anilkrs09
anilkrs09 / jenkinsfile-commons.groovy
Created August 14, 2021 08:12 — forked from aliok/jenkinsfile-commons.groovy
Sample advanced Jenkins pipeline
/**
* This file provides common stuff to be used in the pipelines.
* It is important to load it after repo checkout is done: see https://github.com/jenkinsci/pipeline-plugin/blob/master/TUTORIAL.md#triggering-manual-loading
*
*/
/**
* Dumps some info about the environment.
* @return
*/
@anilkrs09
anilkrs09 / Jenkinsfile
Created July 31, 2021 13:12 — forked from merikan/Jenkinsfile
An example Declarative Pipeline Jenkinsfile for Feb 15 2017 demo
// A Declarative Pipeline is defined within a 'pipeline' block.
pipeline {
// agent defines where the pipeline will run.
agent {
// This also could have been 'agent any' - that has the same meaning.
label ""
// Other possible built-in agent types are 'agent none', for not running the
// top-level on any agent (which results in you needing to specify agents on
// each stage and do explicit checkouts of scm in those stages), 'docker',
@anilkrs09
anilkrs09 / windows_hardening.cmd
Created October 22, 2020 13:42 — forked from jaredhaight/windows_hardening.cmd
Script to perform some hardening of Windows OS.
::
::#######################################################################
::
:: Change file associations to protect against common ransomware attacks
:: Note that if you legitimately use these extensions, like .bat, you will now need to execute them manually from cmd or powershell
:: Alternatively, you can right-click on them and hit 'Run as Administrator' but ensure it's a script you want to run :)
:: ---------------------
ftype htafile="%SystemRoot%\system32\NOTEPAD.EXE" "%1"
ftype WSHFile="%SystemRoot%\system32\NOTEPAD.EXE" "%1"
ftype batfile="%SystemRoot%\system32\NOTEPAD.EXE" "%1"
@anilkrs09
anilkrs09 / azure-pipelines.yml
Created July 30, 2020 16:49 — forked from zanechua/azure-pipelines.yml
Azure Pipeline + Laravel + MySQL + PHPUnit + Laravel Dusk
# PHP
# Test and package your PHP project.
# Add steps that run tests, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/php
pool:
vmImage: 'Ubuntu 16.04'
variables:
phpVersion: 7.2
@anilkrs09
anilkrs09 / pipeline-of-installing-and-testing-laravel-application
Created July 30, 2020 16:48 — forked from CarterZhou/pipeline-of-installing-and-testing-laravel-application
This is a sample script of installing and testing a Laravel application using Jenkins pipeline
node {
stage('download') {
git branch: 'master', url: 'github/url/to/your/project'
}
stage('install') {
sh 'composer install'
}
stage('init') {
sh 'cp .env.example .env'
sh 'php artisan key:generate'
@anilkrs09
anilkrs09 / Dockerfile
Created June 22, 2020 14:25 — forked from noelbundick/Dockerfile
Consuming packages from a private Azure Pipelines Python artifact feed
# We set an environment variable in this phase so it gets picked up by pip, but we don't want to bake secrets into our container image
FROM python:3.6-alpine AS builder
ARG INDEX_URL
ENV PIP_EXTRA_INDEX_URL=$INDEX_URL
COPY requirements.txt .
RUN pip install -U pip \
&& pip install --user -r requirements.txt