Skip to content

Instantly share code, notes, and snippets.

View yueban's full-sized avatar
✈️
want a trip...

yueban yueban

✈️
want a trip...
View GitHub Profile
node {
// TODO: replace REPO_URL & WEB_HOOK_URL with yours
def REPO_URL = ''
def WEB_HOOK_URL = ""
// 配置 PATH
withEnv(["PATH+EXTRA=/opt/homebrew/bin:${env.ANDROID_HOME}/platform-tools:${env.ANDROID_HOME}/emulator:${env.ANDROID_HOME}/build-tools/32.0.0:${env.ANDROID_HOME}/cmdline-tools/latest/bin"]) {
stage('pull code') {
// TODO: replace gitlab_jenkins_password with yours
#!/bin/sh
git filter-branch --env-filter '
OLD_EMAIL="your-old-email@example.com"
CORRECT_NAME="Your Correct Name"
CORRECT_EMAIL="your-correct-email@example.com"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
export GIT_COMMITTER_NAME="$CORRECT_NAME"
export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL"
@yueban
yueban / gitlab_code_counter.py
Created April 10, 2021 10:14
统计 gitlab 一段时间内提交的代码行数
import gitlab
# gitlab 地址
url = ''
# gitlab private token(设置 api 访问权限)
private_token = ''
# 获取 gitlab 操作对象
gl = gitlab.Gitlab(url, private_token)
@yueban
yueban / gitlab_repo_list.py
Last active April 10, 2021 09:02
输出 gitlab 项目列表
import gitlab
# gitlab url
url = ''
# account's private token (select api access permission)
private_token = ''
# login to get gitlab object
gl = gitlab.Gitlab(url, private_token)