Skip to content

Commit

Permalink
change some pipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeeq committed Jan 3, 2024
1 parent aeebfcf commit 8bb83f9
Show file tree
Hide file tree
Showing 12 changed files with 193 additions and 114 deletions.
2 changes: 1 addition & 1 deletion playbooks/generic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
become: true
roles:
- pkg_mgmt/pip
- apps/keybase
# - apps/keybase
- apps/kubectl
- apps/helm
- apps/stern
Expand Down
22 changes: 20 additions & 2 deletions playbooks/huawei-lte-setband.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,26 @@
- servers/huawei-lte
vars:
huawei_dynamic_task: "set-net-mode.yml"
huawei_lteband: "80005"
# huawei_lteband: "5" # 1800+2100
# huawei_lteband: "80000" # 800
# huawei_lteband: "80" # 900
# huawei_lteband: "4" # 1800
# huawei_lteband: "1" # 2100
# huawei_lteband: "40" # 2600
# huawei_lteband: "80005"
# huawei_lteband: "45" # 1800+2100+2600
huawei_lteband: "80045" # 800+1800+2100+2600
# huawei_lteband: "80125"
# huawei_lteband: "125" # 900+1800+2100+2600
# huawei_lteband: "5" # 1800+2100
# huawei_lteband: "7FFFFFFFFFFFFFFF" # all

# 800 - 7.55/6.38
# 900 - 3.32/4.57
# 1800 - 10.77/1.83
# 2100 - 17.81/1.76
# 2600 - 14.61/0.00

# 45 - 37.12/1.40
# 125 - 27.64/1.23
# 80005 - 34.67/1.47
# 80045 - ~40
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,8 @@ views:
name: Cleaning time
- entity: sensor.roborock_s5_max_total_cleaning_time
name: Total cleaning time
- type: picture
image_entity: image.roborock_s5_max_dol
title: Roborock S5 Max
- type: entities
entities:
Expand Down
7 changes: 5 additions & 2 deletions roles/servers/apps/jenkins/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,11 @@ jjb_password: "{{ jenkins_users | selectattr('name','equalto',jjb_username) | ma
jenkins_admin_username: "{{ jjb_username }}"
jenkins_admin_password: "{{ jjb_password }}"

jenkins_cleanup: false
jenkins_cleanup: true
jenkins_update: false

jenkins_ssh_private_key: ""
jenkins_ssh_private_keys:
- name: servers
value: |
"test"
jenkins_git_crypt_key: ""
54 changes: 42 additions & 12 deletions roles/servers/apps/jenkins/templates/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# https://hub.docker.com/r/jenkins/jenkins/tags
FROM jenkins/jenkins:slim-jdk11
FROM jenkins/jenkins:slim-jdk21

USER root

Expand All @@ -21,6 +21,7 @@ RUN apt-get update \
git \
libyaml-dev \
sshpass \
&& rm /usr/lib/python3.11/EXTERNALLY-MANAGED \
&& pip3 install --no-cache-dir \
# https://pypi.org/project/jenkins-job-builder/
# jenkins-job-builder \
Expand All @@ -36,7 +37,42 @@ ARG DOCKER_GID=955
RUN groupadd -g ${DOCKER_GID} docker \
&& usermod -a -G docker jenkins

WORKDIR /opt/jjb
WORKDIR /opt/

RUN git clone --single-branch --branch feature/pipeline_as_yaml https://github.com/mikeeq/jenkins-job-builder \
&& cd jenkins-job-builder \
&& pip3 install -r requirements.txt \
&& PBR_VERSION=9.9.9 python3 setup.py install

# # https://github.com/jenkinsci/pipeline-as-yaml-plugin/pull/77
# ARG MAVEN_VERSION=3.9.6
# # ARG USER_HOME_DIR="/root"
# ARG BASE_URL=https://apache.osuosl.org/maven/maven-3/${MAVEN_VERSION}/binaries

# RUN mkdir -p /usr/share/maven /usr/share/maven/ref \
# && curl -fsSL -o /tmp/apache-maven.tar.gz ${BASE_URL}/apache-maven-${MAVEN_VERSION}-bin.tar.gz \
# && tar -xzf /tmp/apache-maven.tar.gz -C /usr/share/maven --strip-components=1 \
# && rm -f /tmp/apache-maven.tar.gz \
# && ln -s /usr/share/maven/bin/mvn /usr/bin/mvn

# # ENV MAVEN_HOME /usr/share/maven
# # ENV MAVEN_CONFIG "$USER_HOME_DIR/.m2"

# RUN git clone --single-branch --branch feature/refresh-december-2023 https://github.com/jonesbusy/pipeline-as-yaml-plugin \
# && cd pipeline-as-yaml-plugin \
# && mvn package

# mvn install
# mvn package -Dmaven.test.skip
# mvn package -DskipTests

# /usr/share/jenkins/ref/plugins/

# /opt/pipeline-as-yaml-plugin/target
# -rw-r--r-- 1 root root 6064 Jan 2 16:14 pipeline-as-yaml-0.17-rc-SNAPSHOT.pom
# -rw-r--r-- 1 root root 197163 Jan 2 16:24 pipeline-as-yaml.hpi
# -rw-r--r-- 1 root root 100400 Jan 2 16:24 pipeline-as-yaml.jar


USER jenkins

Expand All @@ -57,15 +93,9 @@ USER jenkins
# RUN jenkins-plugin-cli --plugins "workflow-aggregator:590.v6a_d052e5a_a_b_5 rebuild:1.34 ansicolor:1.0.2 git:4.14.3 linenumbers:1.3 multiple-scms:0.8 pipeline-as-yaml:0.16-rc ws-cleanup:0.44"

# linenumbers plugin fails to print json output in ansible, it's merging multiple lines as one
RUN jenkins-plugin-cli --plugins "blueocean workflow-aggregator rebuild ansicolor git multiple-scms pipeline-as-yaml ws-cleanup locale pipeline-multibranch-defaults basic-branch-build-strategies pipeline-stage-view configuration-as-code job-dsl dark-theme git-parameter"
# cloudbees-folder
# timestamper
# build-timeout
RUN jenkins-plugin-cli --plugins "blueocean workflow-aggregator rebuild ansicolor git multiple-scms pipeline-as-yaml:0.17-rc-SNAPSHOT:https://github.com/mikeeq/pipeline-as-yaml-plugin/releases/download/v0.17-rc-SNAPSHOT/pipeline-as-yaml.hpi ws-cleanup locale pipeline-multibranch-defaults basic-branch-build-strategies pipeline-stage-view configuration-as-code job-dsl dark-theme git-parameter conditional-buildstep run-condition theme-manager"

# ❯ docker exec jenkins cat /var/jenkins_home/secrets/initialAdminPassword

USER root

RUN git clone --single-branch --branch feature/pipeline_as_yaml https://github.com/mikeeq/jenkins-job-builder \
&& cd jenkins-job-builder \
&& pip3 install -r requirements.txt \
&& PBR_VERSION=9.9.9 python3 setup.py install

USER jenkins
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ unclassified:
ignoreAcceptLanguage: true
location:
adminAddress: "[email protected]"

appearance:
themeManager:
disableUserThemes: true
theme: "dark"
theme: "darkSystem"
4 changes: 3 additions & 1 deletion roles/servers/apps/jenkins/templates/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ services:
environment:
TZ: "Europe/Warsaw"
CASC_JENKINS_CONFIG: "/var/jenkins_home/casc_configs"
JAVA_OPTS: "-Xmx256m"
JAVA_OPTS: "-Xmx256m -Djenkins.install.runSetupWizard=false"
JAVA_ARGS: "-Xmx256m"
# CSP - Content Security Policy, overriden to make git-parameter working
# JAVA_ARGS: "-Xmx256m -Djava.awt.headless=true -Dhudson.model.DirectoryBrowserSupport.CSP=\"default-src 'self' 'unsafe-inline' 'unsafe-eval'; img-src data:;\""
Expand All @@ -42,3 +42,5 @@ services:
options:
max-size: "250m"
# mkdir -p ./jenkins_home; chown -R 1000:1000 ./jenkins_home

# ENV JAVA_OPTS "-Djenkins.install.runSetupWizard=false ${JAVA_OPTS:-}"

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# ---
# - job:
# name: Huawei LTE band 1800+2100
# project-type: pipeline
# sandbox: true
# # triggers:
# # - timed: '0 8 * * *'
# parameters:
# - string:
# name: "BRANCH_ANSIBLE_OPS_WORKSTATION"
# default: "main"
# trim: true
# description: "Branch name repo: ansible-ops-workstation"
# - string:
# name: "BRANCH_ANSIBLE_OPS_PRIVATE"
# default: "main"
# trim: true
# description: "Branch name repo: ansible-ops-private"
# - bool:
# name: DYNAMIC_SQM_ENABLED
# default: true
# description: "Enable dynamic SQM on OpenWRT"
# - bool:
# name: LOCAL_REPO_RUN
# default: false
# description: "Run from local copy of the repo, disable checkout"
# - choice:
# name: HUAWEI_LTE_BAND
# choices:
# - "5"
# - "7FFFFFFFFFFFFFFF"
# - "80005"
# - "80000"
# - "4"
# - "1"
# description: "LTE Band: 1800+2100, all, 800+1800+2100, 800, 1800, 2100"
# dsl-yaml: |
# pipeline:
# agent:
# any:
# options:
# - ansiColor('xterm')
# - disableConcurrentBuilds()
# - skipDefaultCheckout()
# stages:
# - stage: "Checkout ansible-ops-workstation"
# when:
# expression:
# - "params.LOCAL_REPO_RUN == false"
# steps:
# script:
# - dir: "'ansible-ops-workstation'"
# script:
# - >-
# git(
# url: "[email protected]:mikeeq/ansible-ops-workstation.git",
# branch: "$params.BRANCH_ANSIBLE_OPS_WORKSTATION"
# )
# - stage: "Checkout ansible-ops-private"
# when:
# expression:
# - "params.LOCAL_REPO_RUN == false"
# steps:
# script:
# - dir: "'ansible-ops-private'"
# script:
# - >-
# git(
# url: "[email protected]:mikeeq/ansible-ops-private.git",
# branch: "$params.BRANCH_ANSIBLE_OPS_PRIVATE"
# )
# - stage: "Unlock git-crypt"
# steps:
# script:
# - dir: "'ansible-ops-private'"
# script:
# - |
# sh """#!/bin/bash
# id
# pwd
# ls
# git-crypt unlock ~jenkins/secrets/git_crypt_key
# """
# - stage: "Ansible LTE Band set"
# steps:
# script:
# - |
# sh """#!/bin/bash
# cd ansible-ops-workstation/playbooks
# ansible-playbook -e huawei_lteband=$params.HUAWEI_LTE_BAND -i ../../ansible-ops-private/inventory/hosts.yml huawei-lte-setband.yml
# """
# - stage: "Ansible SQM disable"
# steps:
# script:
# - |
# sh """#!/bin/bash
# cd ansible-ops-workstation/playbooks
# ansible-playbook -e dynamic_sqm_enabled=$params.DYNAMIC_SQM_ENABLED -i ../../ansible-ops-private/inventory/hosts.yml openwrt-sqm.yml
# """
Loading

0 comments on commit 8bb83f9

Please sign in to comment.