Skip to content

Instantly share code, notes, and snippets.

View doytsujin's full-sized avatar
🎯
Private Account

Alexander Chernov doytsujin

🎯
Private Account
View GitHub Profile
@doytsujin
doytsujin / app-of-apps.yaml
Created March 15, 2022 14:42 — forked from mikesparr/app-of-apps.yaml
Argo CD App of Apps config
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: applications
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
destination:
namespace: argocd
@doytsujin
doytsujin / pipeline.groovy
Created March 11, 2022 14:38 — forked from paulchubatyy/pipeline.groovy
Jenkins pipeline to read the repository list for Github Organization and create multibranch pipeline projects for them
import org.kohsuke.github.*
/*
* This pipeline uses the Jenkins Job DSL plugin to create the multi-branch pipelines
* for your Github Organization repositories.
*
* @see https://wiki.jenkins-ci.org/display/JENKINS/Job+DSL+Plugin
*
* It does not consumes 5k requests in 6 minutes, but actually queries the Github API
* for the repositories in organization and creates the Multi-Branch Pipelines in Jenkins.
@doytsujin
doytsujin / v1.groovy
Created March 9, 2022 23:44 — forked from zacker330/v1.groovy
jenkins-k8s-yaml-pipeline.groovy
System.setProperty("org.csanchez.jenkins.plugins.kubernetes.pipeline.PodTemplateStepExecution.defaultImage", "jenkins/jnlp-slave:3.36-2")
pipeline {
agent {
kubernetes {
label 'parent-pod'
containerTemplate(name: 'jnlp', image: "jenkins/jnlp-slave:3.10-1-alpine",args: '${computer.jnlpmac} ${computer.name}')
}
}
stages {
pipeline {
agent { label 'xxx' }
options { timestamps() }
environment {
KW_PROJECT_NAME = 'xxx'
}
stages {
stage('Checkout') {
steps {
@doytsujin
doytsujin / _Jenkins+Script+Console.md
Created March 9, 2022 23:42 — forked from dnozay/_Jenkins+Script+Console.md
jenkins groovy scripts collection.
@doytsujin
doytsujin / Failure
Created March 9, 2022 23:42 — forked from doudou/Failure
Failing jenkins pipeline
Started by user admin
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
General error during class generation: 296
java.lang.ArrayIndexOutOfBoundsException: 296
at org.codehaus.groovy.classgen.asm.CallSiteWriter.getCreateArraySignature(CallSiteWriter.java:58)
at org.codehaus.groovy.classgen.asm.CallSiteWriter.makeCallSite(CallSiteWriter.java:317)
at org.codehaus.groovy.classgen.asm.InvocationWriter.makeCachedCall(InvocationWriter.java:307)
at org.codehaus.groovy.classgen.asm.InvocationWriter.makeCall(InvocationWriter.java:397)
at org.codehaus.groovy.classgen.asm.InvocationWriter.makeCall(InvocationWriter.java:104)
@doytsujin
doytsujin / pipeline.groovy
Created March 9, 2022 23:41 — forked from cyrille-leclerc/pipeline.groovy
Escape character & quotes in Jenkins Pipeline
docker.image('cloudbees/java-build-tools:0.0.6').inside {
sshagent(['github-ssh-credentials']) {
sh """
git version
git config --local user.email \\"[email protected]\\"
git config --local user.name \\"Cyrille Le Clerc\\"
git clone [email protected]:cyrille-leclerc/a-test-repo.git
date &> now.txt
@doytsujin
doytsujin / nginxproxy.md
Created March 9, 2022 15:55 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

Kubernetes hybrid cluster (Linux+Windows) on Hyper-V with local subnet and internet access

Prepare Host

Install CLI utils on your host machine

Kubectl

Helm

@doytsujin
doytsujin / dijkstra_algorithm.rb
Created January 29, 2022 14:16 — forked from daifu/dijkstra_algorithm.rb
Dijkstra Algorithm in Ruby
=begin
Implement dijkstra's algorithm
reference
https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm
V is the number of vertices
N is the maximum number of edges attached to a single node.
Time complexity: O( V * N * log V)