Compare commits

...

40 Commits

Author SHA1 Message Date
4e075cbd8e feat: use emissary v2023.4.13-4b5bc0b
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-13 10:11:55 +00:00
ed52367837 feat: use emissary v2023.4.13-dee6218
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-13 09:39:49 +00:00
a6c32c5315 feat: use emissary v2023.4.13-76656e8
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-13 09:32:01 +00:00
a35c5563db feat: use emissary v2023.4.13-41b1619
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-13 09:08:54 +00:00
751f5398e1 feat: use emissary v2023.4.12-35d5ee8
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-12 09:13:52 +00:00
9b2c2e5cdc feat: use emissary v2023.4.11-2315ee7
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-11 13:14:45 +00:00
2aa581e3c0 feat: use emissary v2023.4.11-86a6d81
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-11 10:09:57 +00:00
fc7be554a3 feat: use emissary v2023.4.11-8fb86c6
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-11 09:17:18 +00:00
f6df7651da feat(turris,omnia): automatically resize partition at startup
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-07 11:38:36 +02:00
87b15c940f feat: use emissary v2023.4.6-12f8b3a
All checks were successful
arcad/emissary-firmware/pipeline/head This commit looks good
2023-04-06 19:00:29 +00:00
30d48ce4aa feat: use emissary v2023.4.6-4cf53d9
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-06 17:28:39 +00:00
2f06b5fdcf feat: use emissary v2023.4.6-47c2546
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-06 16:29:28 +00:00
c3070d2922 feat: use emissary v2023.4.6-2117391
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-06 16:21:15 +00:00
38a0d35c7b feat: use emissary v2023.4.6-b213b8d
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-06 14:01:51 +00:00
9a48ff1a65 feat: use emissary v2023.4.6-9dcddc5
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-06 13:17:58 +00:00
e1ed8f9bd1 feat: use emissary v2023.4.6-253c93d
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-06 09:04:09 +00:00
cec076241a feat: use emissary v2023.4.6-d2f865c
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-06 08:47:39 +00:00
adb3877206 feat: use emissary v2023.4.6-06b1235
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-06 08:26:51 +00:00
dd3bb6748c feat: use emissary v2023.4.6-06b1235-dirty
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-06 08:25:50 +00:00
d58fe78b43 feat: use emissary v2023.4.5-2e1ee44
Some checks failed
arcad/emissary-firmware/pipeline/head There was a failure building this commit
2023-04-05 21:32:38 +00:00
30e31359ec feat: use emissary v2023.4.5-2e1ee44-dirty
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-05 21:25:26 +00:00
2839b21113 feat: use emissary v2023.4.4-242a247
Some checks failed
arcad/emissary-firmware/pipeline/head There was a failure building this commit
2023-04-04 18:44:04 +00:00
b096b36e5c feat: use emissary v2023.4.4-242a247-dirty
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-04 18:30:45 +00:00
d945203a70 feat: use emissary v2023.4.2-562d698
Some checks failed
arcad/emissary-firmware/pipeline/head There was a failure building this commit
2023-04-02 16:32:38 +00:00
aff32b8627 feat: use emissary v2023.4.2-562d698-dirty
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-02 16:10:04 +00:00
f9c6997cdc feat: do not keep agent state between upgrades
Some checks failed
arcad/emissary-firmware/pipeline/head There was a failure building this commit
2023-04-01 21:24:58 +02:00
4e1772995d feat: use emissary v2023.4.1-909549f
All checks were successful
arcad/emissary-firmware/pipeline/head This commit looks good
2023-04-01 17:47:38 +00:00
f58c7cc6a7 feat: use emissary v2023.4.1-7d551a8
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-01 17:34:21 +00:00
95046def13 feat: use emissary v2023.4.1-d02eb91
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-01 12:36:55 +00:00
dc26c10bb3 feat: use emissary v2023.4.1-d2bcdd2
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-04-01 11:31:55 +00:00
7fbc1930df chore: display emissary version in release body
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-03-31 17:50:33 +02:00
d65ba3f252 feat: use emissary v2023.3.31-c638fe1
All checks were successful
arcad/emissary-firmware/pipeline/head This commit looks good
2023-03-31 15:35:20 +00:00
b56e563aa0 feat: use emissary v2023.3.31-5fc5f5f
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-03-31 15:20:01 +00:00
2c701ffc16 chore: add jenkins pipeline
Some checks reported errors
arcad/emissary-firmware/pipeline/head Something is wrong with the build of this commit
2023-03-31 17:19:44 +02:00
aa22f3c55b feat: update emissary to v2023.3.29-e5b6c5e 2023-03-29 21:43:31 +02:00
f6c3de68b2 feat: use emissary v2023.3.29-351f22e 2023-03-29 17:45:27 +02:00
1470bea902 chore: filter download emissary artefacts 2023-03-29 16:05:01 +02:00
aa314a939f feat: move all emissary 'data' files to /data 2023-03-29 12:23:28 +02:00
844c5d0e17 chore: allow override of used image in flash script 2023-03-29 12:23:01 +02:00
656081568e feat(turris,omnia): use armv7 arch for emissary binary 2023-03-29 12:22:27 +02:00
12 changed files with 165 additions and 18 deletions

102
Jenkinsfile vendored Normal file
View 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()
}
}
}

View File

@ -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
View File

@ -0,0 +1 @@
v2023.4.13-4b5bc0b

View File

@ -12,6 +12,10 @@ install-emissary-files: tools/yq/bin/yq tools/upx/bin/upx
mkdir -p files/lib/upgrade/keep.d
cp -r misc/emissary/keep.d/* files/lib/upgrade/keep.d/
# Copy profile.d files
mkdir -p files/etc/profile.d
cp -r misc/emissary/profile.d/* files/etc/profile.d/
mkdir -p gitea-dl/emissary-agent_linux_$(EMISSARY_ARCH)
cd gitea-dl && tar -xzf emissary-agent_*_linux_$(EMISSARY_ARCH).tar.gz -C emissary-agent_linux_$(EMISSARY_ARCH)
@ -22,9 +26,11 @@ install-emissary-files: tools/yq/bin/yq tools/upx/bin/upx
# Patch agent config
tools/yq/bin/yq -i '.agent.serverUrl = "$${EMISSARY_SERVER_URL}"' files/etc/emissary/agent.yml
tools/yq/bin/yq -i '.agent.reconciliationInterval = "$${EMISSARY_RECONCILIATION_INTERVAL}"' files/etc/emissary/agent.yml
tools/yq/bin/yq -i '.agent.privateKeyPath = "/etc/emissary/agent-key.json"' files/etc/emissary/agent.yml
tools/yq/bin/yq -i '.agent.controllers.persistence.stateFile = "/etc/emissary/agent-state.json"' files/etc/emissary/agent.yml
tools/yq/bin/yq -i '.agent.privateKeyPath = "/data/emissary/agent-key.json"' files/etc/emissary/agent.yml
tools/yq/bin/yq -i '.agent.controllers.persistence.stateFile = "/data/emissary/agent-state.json"' files/etc/emissary/agent.yml
tools/yq/bin/yq -i '.agent.controllers.sysupgrade.firmwareVersionCommand = ["sh", "-c", "source /etc/emissary_firmware && echo \"$$FIRMWARE_VERSION\""]' files/etc/emissary/agent.yml
tools/yq/bin/yq -i '.agent.controllers.app.dataDir = "/data/emissary/apps/data"' files/etc/emissary/agent.yml
tools/yq/bin/yq -i '.agent.controllers.app.downloadDir = "/data/emissary/apps/bundles"' files/etc/emissary/agent.yml
# Copy emissary binary
mkdir -p files/usr/local/bin
@ -32,10 +38,10 @@ install-emissary-files: tools/yq/bin/yq tools/upx/bin/upx
chmod +x files/usr/local/bin/emissary
# Set defaults
mkdir -p files/etc/emissary
rm -rf files/etc/emissary/default.conf
echo "EMISSARY_RECONCILIATION_INTERVAL='$(EMISSARY_RECONCILIATION_INTERVAL)'" > files/etc/emissary/default.conf
echo "EMISSARY_SERVER_URL='$(EMISSARY_SERVER_URL)'" >> files/etc/emissary/default.conf
mkdir -p files/data/emissary
rm -rf files/data/emissary/default.conf
echo "EMISSARY_RECONCILIATION_INTERVAL='$(EMISSARY_RECONCILIATION_INTERVAL)'" > files/data/emissary/default.conf
echo "EMISSARY_SERVER_URL='$(EMISSARY_SERVER_URL)'" >> files/data/emissary/default.conf
# Compress emissary binary
tools/upx/bin/upx -9 files/usr/local/bin/emissary

3
install/turris-omnia.mk Normal file
View 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/

View File

@ -1,3 +1,3 @@
/etc/machine-id
/etc/emissary/agent-key.json
/etc/emissary/agent-state.json
/data/emissary/agent-key.json
/data/emissary/apps/data

View File

@ -0,0 +1,3 @@
#!/bin/sh
export PATH="${PATH}:/usr/local/bin"

View File

@ -3,7 +3,7 @@
set -e
main() {
local default_config="/etc/emissary/default.conf"
local default_config="/data/emissary/default.conf"
if [ ! -f "${default_config}" ]; then
exit 0

14
misc/jenkins/Dockerfile Normal file
View 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

View File

@ -6,7 +6,8 @@ ssh-copy-id root@${OPENWRT_DEVICE}
TARGET_ARCH=$(ssh root@${OPENWRT_DEVICE} source /etc/os-release \&\& echo \${OPENWRT_BOARD:-\$LEDE_BOARD})
FIRMWARE_FILE=bin/${OPENWRT_VERSION}/${TARGET_ARCH}/${OPENWRT_PROFILE}/openwrt-*-sysupgrade.img*
FIRMWARE_FILENAME=${FIRMWARE_FILENAME:-openwrt-*-sysupgrade.img*}
FIRMWARE_FILE=bin/${OPENWRT_VERSION}/${TARGET_ARCH}/${OPENWRT_PROFILE}/${FIRMWARE_FILENAME}
FIRMWARE_FILE=${CUSTOM_FIRMWARE_FILE:-$FIRMWARE_FILE}
ssh root@${OPENWRT_DEVICE} \

View 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"

View File

@ -4,8 +4,9 @@ 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="armv6" \
EMISSARY_ARCH="armv7" \
OPENWRT_PROFILE="cznic_turris-omnia" \
build