Skip to content

Instantly share code, notes, and snippets.

View chmouel's full-sized avatar
🤨
Kuberneting

Chmouel Boudjnah chmouel

🤨
Kuberneting
View GitHub Profile
@chmouel
chmouel / bump-release.sh
Created November 24, 2021 17:57
Bump a release from shell
#!/usr/bin/env bash
# need python-semver package https://pypi.org/project/semver/
set -euf
VERSION=${1-""}
bumpversion() {
current=$(git describe --tags $(git rev-list --tags --max-count=1))
echo "Current version is ${current}"

Prep

  • Make sure tkn-pac is compiled from main
  • Make sure we are on the right cluster ($ opac)
  • Create a demo directory in /tmp (mkdir /tmp/demo)

Use GH to create a repository

  • gh repo create openshfit-demo-test

How to install Pipelines as Code

Install release.yaml

kubectl apply -f https://raw.githubusercontent.com/openshift-pipelines/pipelines-as-code/release-0.1/release-0.1.yaml

OpenShift

Expose the EventListenner


@chmouel
chmouel / pac-demo.org
Last active January 4, 2022 09:46
Tekton Pipelines as Code demo
@chmouel
chmouel / prune-pipelinerun-objects.yaml
Last active February 23, 2023 20:27
cronjob for pruning pipelinerun objects by age
apiVersion: v1
kind: List
items:
- apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: pr-cleanup
namespace: ghe
spec:
concurrencyPolicy: Replace
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
networking:
apiServerAddress: "10.0.111.66"
apiServerPort: 8443
kubeadmConfigPatchesJSON6902:
- group: kubeadm.k8s.io
version: v1beta2
kind: ClusterConfiguration
patch: |
@chmouel
chmouel / gnus-demon-config.el
Last active February 11, 2021 21:56
Integrate GNUS with Argos
(defun gnus-demon-scan-mail-or-news-and-update (level)
"Scan for new mail, updating the *Group* buffer."
(let ((win (current-window-configuration)))
(unwind-protect
(save-window-excursion
(save-excursion
(when (gnus-alive-p)
(save-excursion
(set-buffer gnus-group-buffer)
(gnus-group-get-new-news level)))))
status title creation-date last-updated authors
proposed
Pipeline as a Code
2020-11-24
2020-11-24
chmouel
afrittoli

TEP-0037: Pipeline as a Code

# -*- coding: utf-8 -*-
# Author: Chmouel Boudjnah <[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: tkn-cleanup
spec:
failedJobsHistoryLimit: 1
successfulJobsHistoryLimit: 1
concurrencyPolicy: Replace
schedule: "0 0 * * *"