Compare commits
37 Commits
v2023.03.2
...
v2023.04.1
Author | SHA1 | Date | |
---|---|---|---|
4e075cbd8e | |||
ed52367837 | |||
a6c32c5315 | |||
a35c5563db | |||
751f5398e1 | |||
9b2c2e5cdc | |||
2aa581e3c0 | |||
fc7be554a3 | |||
f6df7651da | |||
87b15c940f | |||
30d48ce4aa | |||
2f06b5fdcf | |||
c3070d2922 | |||
38a0d35c7b | |||
9a48ff1a65 | |||
e1ed8f9bd1 | |||
cec076241a | |||
adb3877206 | |||
dd3bb6748c | |||
d58fe78b43 | |||
30e31359ec | |||
2839b21113 | |||
b096b36e5c | |||
d945203a70 | |||
aff32b8627 | |||
f9c6997cdc | |||
4e1772995d | |||
f58c7cc6a7 | |||
95046def13 | |||
dc26c10bb3 | |||
7fbc1930df | |||
d65ba3f252 | |||
b56e563aa0 | |||
2c701ffc16 | |||
aa22f3c55b | |||
f6c3de68b2 | |||
1470bea902 |
102
Jenkinsfile
vendored
Normal file
102
Jenkinsfile
vendored
Normal file
@ -0,0 +1,102 @@
|
||||
pipeline {
|
||||
agent {
|
||||
dockerfile {
|
||||
filename 'Dockerfile'
|
||||
dir 'misc/jenkins'
|
||||
}
|
||||
}
|
||||
|
||||
parameters {
|
||||
persistentText(name: 'emissaryRelease', defaultValue: 'latest', description: 'Numéro de release Emissary', successfulOnly: false)
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('Cancel older jobs') {
|
||||
steps {
|
||||
script {
|
||||
def buildNumber = env.BUILD_NUMBER as int
|
||||
if (buildNumber > 1) milestone(buildNumber - 1)
|
||||
milestone(buildNumber)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Update emissary release') {
|
||||
when {
|
||||
expression {
|
||||
return params.emissaryRelease != 'latest'
|
||||
}
|
||||
}
|
||||
steps {
|
||||
script {
|
||||
currentEmissaryRelease = readFile('emissary_release.txt').trim()
|
||||
|
||||
if (currentEmissaryRelease == params.emissaryRelease) {
|
||||
currentBuild.result = 'SUCCESS'
|
||||
return
|
||||
}
|
||||
|
||||
withCredentials([
|
||||
usernamePassword([
|
||||
credentialsId: 'forge-jenkins',
|
||||
usernameVariable: 'GIT_USERNAME',
|
||||
passwordVariable: 'GIT_PASSWORD'
|
||||
])
|
||||
]) {
|
||||
sh """
|
||||
git config user.email "jenkins@cadoles.com"
|
||||
git config user.name "Jenkins"
|
||||
git config credential.https://forge.cadoles.com.username "\$GIT_USERNAME"
|
||||
git config credential.https://forge.cadoles.com.helper '!f() { test "\$1" = get && echo "password=\$GIT_PASSWORD"; }; f'
|
||||
|
||||
echo '${params.emissaryRelease}' > emissary_release.txt
|
||||
git add emissary_release.txt
|
||||
git commit -m "feat: use emissary ${params.emissaryRelease}"
|
||||
git pull --rebase
|
||||
git push origin \$(git rev-parse HEAD):${env.GIT_BRANCH}
|
||||
"""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Build and release') {
|
||||
steps {
|
||||
script {
|
||||
withCredentials([
|
||||
usernamePassword([
|
||||
credentialsId: 'forge-jenkins',
|
||||
usernameVariable: 'GITEA_DOWNLOAD_USERNAME',
|
||||
passwordVariable: 'GITEA_DOWNLOAD_PASSWORD'
|
||||
])
|
||||
]) {
|
||||
sh '''
|
||||
make download-emissary-release
|
||||
make all
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Release') {
|
||||
steps {
|
||||
withCredentials([
|
||||
usernamePassword([
|
||||
credentialsId: 'forge-jenkins',
|
||||
usernameVariable: 'GITEA_RELEASE_USERNAME',
|
||||
passwordVariable: 'GITEA_RELEASE_PASSWORD'
|
||||
])
|
||||
]) {
|
||||
sh 'make gitea-release'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
post {
|
||||
always {
|
||||
cleanWs()
|
||||
}
|
||||
}
|
||||
}
|
13
Makefile
13
Makefile
@ -22,7 +22,7 @@ IMAGEBUILDER_CUSTOM_FILES_DIR_PATH := $(IMAGEBUILDER_DIR_PATH)/files
|
||||
|
||||
BIN_DIR := "$(shell readlink -f bin)/$(OPENWRT_VERSION)/$(OPENWRT_TARGET)/$(OPENWRT_PROFILE)$(BIN_DIR_NAME_SUFFIX)"
|
||||
|
||||
GITEA_DOWNLOAD_RELEASE_NAME ?= latest
|
||||
EMISSARY_RELEASE ?= $(shell cat emissary_release.txt)
|
||||
EMISSARY_ARCH ?= armv6
|
||||
|
||||
EMISSARY_RECONCILIATION_INTERVAL ?=
|
||||
@ -109,8 +109,8 @@ gitea-release: tools/gitea-release/bin/gitea-release.sh
|
||||
GITEA_RELEASE_NAME="$(FULL_VERSION)" \
|
||||
GITEA_RELEASE_COMMITISH_TARGET="$(GIT_VERSION)" \
|
||||
GITEA_RELEASE_IS_DRAFT="false" \
|
||||
GITEA_RELEASE_BODY="" \
|
||||
GITEA_RELEASE_ATTACHMENTS="$(shell find .gitea-release/* -type f)" \
|
||||
GITEA_RELEASE_BODY="With Emissary $(EMISSARY_RELEASE)" \
|
||||
GITEA_RELEASE_ATTACHMENTS="$$(find .gitea-release/* -type f)" \
|
||||
tools/gitea-release/bin/gitea-release.sh
|
||||
|
||||
.PHONY: download-emissary-release
|
||||
@ -119,7 +119,8 @@ download-emissary-release: tools/gitea-download/bin/gitea-download.sh
|
||||
GITEA_DOWNLOAD_PROJECT="emissary" \
|
||||
GITEA_DOWNLOAD_ORG="arcad" \
|
||||
GITEA_DOWNLOAD_BASE_URL="https://forge.cadoles.com" \
|
||||
GITEA_DOWNLOAD_RELEASE_NAME="$(GITEA_DOWNLOAD_RELEASE_NAME)" \
|
||||
GITEA_DOWNLOAD_RELEASE_NAME="$(EMISSARY_RELEASE)" \
|
||||
GITEA_DOWNLOAD_ATTACHMENTS_FILTER="\.tar\.gz$$" \
|
||||
tools/gitea-download/bin/gitea-download.sh
|
||||
|
||||
tools/gitea-release/bin/gitea-release.sh:
|
||||
@ -142,5 +143,5 @@ UPX_VERSION := 4.0.2
|
||||
tools/upx/bin/upx:
|
||||
mkdir -p tools/upx/bin
|
||||
curl -L --output tools/upx/upx-$(UPX_VERSION)-amd64_linux.tar.xz https://github.com/upx/upx/releases/download/v$(UPX_VERSION)/upx-$(UPX_VERSION)-amd64_linux.tar.xz
|
||||
cd tools/upx && tar -xJf upx-$(UPX_VERSION)-amd64_linux.tar.xz
|
||||
ln -s $(shell readlink -f tools/upx/upx-$(UPX_VERSION)-amd64_linux/upx) tools/upx/bin/upx
|
||||
cd tools/upx && tar -xJf upx-$(UPX_VERSION)-amd64_linux.tar.xz && wait $$!
|
||||
$(SHELL) -c 'ln -s $$(readlink -f tools/upx/upx-$(UPX_VERSION)-amd64_linux/upx) tools/upx/bin/upx'
|
1
emissary_release.txt
Normal file
1
emissary_release.txt
Normal file
@ -0,0 +1 @@
|
||||
v2023.4.13-4b5bc0b
|
3
install/turris-omnia.mk
Normal file
3
install/turris-omnia.mk
Normal file
@ -0,0 +1,3 @@
|
||||
install-turris-omnia-uci-defaults:
|
||||
mkdir -p files/etc/uci-defaults
|
||||
cp misc/turris/omnia/uci-defaults/* files/etc/uci-defaults/
|
@ -1,4 +1,3 @@
|
||||
/etc/machine-id
|
||||
/data/emissary/agent-key.json
|
||||
/data/emissary/agent-state.json
|
||||
/data/emissary/apps/data
|
||||
|
14
misc/jenkins/Dockerfile
Normal file
14
misc/jenkins/Dockerfile
Normal file
@ -0,0 +1,14 @@
|
||||
FROM reg.cadoles.com/proxy_cache/library/ubuntu:22.04
|
||||
|
||||
ARG HTTP_PROXY=
|
||||
ARG HTTPS_PROXY=
|
||||
ARG http_proxy=
|
||||
ARG https_proxy=
|
||||
|
||||
# Install dev environment dependencies
|
||||
RUN export DEBIAN_FRONTEND=noninteractive &&\
|
||||
apt-get update -y &&\
|
||||
apt-get install -y --no-install-recommends curl ca-certificates build-essential wget unzip tar git jq gawk python3 rsync file
|
||||
|
||||
# Add LetsEncrypt certificates
|
||||
RUN curl -k https://forge.cadoles.com/Cadoles/Jenkins/raw/branch/master/resources/com/cadoles/common/add-letsencrypt-ca.sh | bash
|
15
misc/turris/omnia/uci-defaults/99-resize-disk.sh
Normal file
15
misc/turris/omnia/uci-defaults/99-resize-disk.sh
Normal file
@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -eo pipefail
|
||||
|
||||
DISK=/dev/mmcblk0
|
||||
PARTITION="${DISK}p2"
|
||||
|
||||
parted -s -a opt "$DISK" "resizepart 2 100%"
|
||||
|
||||
FS_SIZE="$(unsquashfs -s "$PARTITION" | grep -o 'Filesystem size [0-9]* bytes' | grep -o '[0-9][0-9]*')"
|
||||
FS_OFFSET="$(expr '(' "$FS_SIZE" + 65535 ')' / 65536 '*' 65536)"
|
||||
LOOP_DEVICE="$(losetup -f --show -o "$FS_OFFSET" "$PARTITION")"
|
||||
|
||||
e2fsck -fy "$LOOP_DEVICE"
|
||||
resize2fs "$LOOP_DEVICE"
|
@ -4,7 +4,8 @@ turris: omnia
|
||||
|
||||
omnia:
|
||||
$(MAKE) \
|
||||
ADDITIONAL_INSTALL="" \
|
||||
ADDITIONAL_INSTALL="install-turris-omnia-uci-defaults" \
|
||||
ADDITIONAL_OPENWRT_PACKAGES="losetup squashfs-tools-unsquashfs resize2fs e2fsprogs parted" \
|
||||
OPENWRT_TARGET="mvebu/cortexa9" \
|
||||
EMISSARY_ARCH="armv7" \
|
||||
OPENWRT_PROFILE="cznic_turris-omnia" \
|
||||
|
Reference in New Issue
Block a user