Skip to content

Instantly share code, notes, and snippets.

@shenxianpeng
shenxianpeng / .gitconfig
Created March 7, 2023 04:01 — forked from johnpolacek/.gitconfig
My current .gitconfig aliases
[alias]
co = checkout
cob = checkout -b
coo = !git fetch && git checkout
br = branch
brd = branch -d
brD = branch -D
merged = branch --merged
st = status
aa = add -A .

C/C++ Lint Action

clang-format & clang-tidy

@shenxianpeng
shenxianpeng / sonar.properties
Last active August 5, 2021 05:32
sonar.properties
# Property values can:
# - be overridden by environment variables. The name of the corresponding environment variable is the
# upper-cased name of the property where all the dot ('.') and dash ('-') characters are replaced by
# underscores ('_'). For example, to override 'sonar.web.systemPasscode' use 'SONAR_WEB_SYSTEMPASSCODE'.
# - be encrypted. See https://redirect.sonarsource.com/doc/settings-encryption.html
#--------------------------------------------------------------------------------------------------
# DATABASE
#
# IMPORTANT:
@shenxianpeng
shenxianpeng / update-bitbucket-build-status.sh
Last active July 25, 2021 12:20
Update Bitbucket build status with REST API
#!/bin/sh
username=your-bitbucket-user
password=your-bitbucket-password
commit_id='58577d7d4892bc4ef2c4375028c19b27921e2485'
# build_result has 3 status: SUCCESSFUL, FAILED, INPROGRESS
build_result='SUCCESSFUL'
description='Manully update bitbucket status'
@shenxianpeng
shenxianpeng / build.sh
Last active February 17, 2020 07:00
How to use shell shift
#!/bin/ksh
# set -x
set -e
usage(){
echo "Usage: $0 [-p password] [-P PR] [-h hotfix]"
echo " -p --password Required - must input password of executor"
echo " -P --PR Optional - If is a Pull Request build"
echo " -h --hotfix Optional - If is a hotfix build"
echo ""
@shenxianpeng
shenxianpeng / gist:15b8e0f6ba0b1c5b30e4fdc6881cd8de
Created January 1, 2020 06:03
SSH Pipeline Steps example
#!/usr/bin/env groovy
def loadAppinhouseConf() {
def resource = libraryResource 'appinhouse.conf'
return readProperties(text: resource)
}
def getHost() {
def appinhouseConf = loadAppinhouseConf()
def remote = [:]
remote.name = appinhouseConf.name
@shenxianpeng
shenxianpeng / gist:6210d6890745ab516ac7bec9ed3cd832
Created December 28, 2019 08:10
warnings-ng-plugin support
https://github.com/jenkinsci/warnings-ng-plugin/blob/master/SUPPORTED-FORMATS.md
@shenxianpeng
shenxianpeng / Jenkinsfile
Last active February 8, 2020 02:45
used Jenkins lock for install on different platforms
/*
* This Jenkinsfile used for install build on different platform
*
* Created by Xianpeng Shen at 10/9/2019
*/
pipeline {
agent {
node {
label 'PreDevENV'
@shenxianpeng
shenxianpeng / gist:a277aaa464f614574b24750460b20803
Created December 10, 2019 03:26
Jenkins groovy snippet-01
def call(){
def labels = ['build-on-linux', 'build-on-aix', 'build-on-hpux', 'build-on-solaris']
def builders = [:]
def BLD = credentials("d1cbab74-823d-41aa-abb7")
def UNIX_BLD_FOLDER = '/disk1/agent/workspace/build'
for (x in labels){
def label = x
builders[label] = {
node(label){