Skip to content

Instantly share code, notes, and snippets.

pipeline {
agent any
parameters {
string(name:'commitHash', defaultValue: '5a24fd961fcb1027981d38a6ed2aa5e654ea6ea2', description: 'Commit to delete' )
}
stages {
stage ('eraser - Build') {
def buildResult
pipeline {
agent any
parameters {
booleanParam(name: 'makeSuccessful', defaultValue: false, description: 'Make it successful')
}
stages {
stage('Build') {
steps {
echo 'Hello World'
CREATE DATABASE ${DB_NAME};
GO
USE ${DB_NAME};
GO
CREATE LOGIN [${DB_USER}] WITH PASSWORD = '${DB_PASSWORD}', CHECK_EXPIRATION = OFF, CHECK_POLICY = OFF;
GO
CREATE USER [${DB_USER}] FROM LOGIN [${DB_USER}];
ALTER SERVER ROLE dbcreator
@Storager
Storager / gatherDmesg.groovy
Created December 20, 2023 12:57
groovy call dmesgCollector
def call(Map config = [:]) {
script {
def z = new org.zoo.DmesgCollector()
z.getDmesg(config.startDate, config.endDate, config.kMesg)
}
}
@Storager
Storager / myLocaldate.groovy
Last active December 20, 2023 12:55
Gist description
package org.zoo
import java.time.*
import java.time.format.DateTimeFormatter
def testDmesg(String kMesg = "") {
LocalDateTime endDate = LocalDateTime.now()
LocalDateTime startDate = convertDates("Tue Dec 19 06:30:55 2023")
// println startDate
getDmesg(startDate, endDate, kMesg)
@Storager
Storager / .gitlab-ci.yml
Created August 6, 2019 06:54
gitlab pipeline example
image: docker:latest
services:
- docker:dind
stages:
- build
- test
- release
- deploy
@Storager
Storager / update_artifactory.yml
Created August 2, 2019 08:34
Use Ansible 2.7 to run.
---
- name: Update artifactory ZIP distribution
hosts: all
become: false
vars:
target_version: 6.3.2
# target_versions_path: [ 6.3.8, 6.4.3, 6.5.18, 6.6.10, 6.7.7, 6.8.16, 6.9.5, 6.10.7, 6.11.3]
target_directory: /home/vagrant/artifactory
backup_directory: /home/vagrant/backup
temp_directory: /tmp
@Storager
Storager / releas_sort.py
Created July 21, 2019 19:31
my_l is a list of release tags from docker repository
my_l = sorted(my_l, key = lambda x: (int(x.split('-',2)[1].split('.')[0]), int(x.split('-',2)[1].split('.')[1])))
print(my_l)
i=0
cure = ""
while i < 10:
cure = my_l[len(my_l)-1].split('-',2)[1].split('.')[1]
print(cure)
while cure in my_l[len(my_l)-1]:
@Storager
Storager / unicorn.d
Created October 5, 2016 21:36
init.d script for unicorn with RVM
#!/bin/sh
#
# init.d script for single or multiple unicorn installations. Expects at least one .conf
# file in /etc/unicorn
#
# based on git://gist.github.com/504875.git [http://github.com/jaygooby]
# support for RVM on Mac OS X
# Modified by JeremyWei<http://github.com/jeremy>
#
# run the code below, you will get a script named bootup_unicorn in ~/.rvm/bin.
#!/bin/bash
#
# Bash script to setup headless Selenium (uses Xvfb and Chrome)
# (Tested on Ubuntu 12.04) trying on ubuntu server 14.04
# Add Google Chrome's repo to sources.list
echo "deb http://dl.google.com/linux/chrome/deb/ stable main" | sudo tee -a /etc/apt/sources.list
# Install Google's public key used for signing packages (e.g. Chrome)
# (Source: http://www.google.com/linuxrepositories/)