Compare commits

...

8 Commits

Author SHA1 Message Date
7b67601e44 artixpkg ci: remove parallel agent config, leads to problems with gpg agents signing the commit
All checks were successful
Artools shellcheck / lint (push) Successful in 42s
2024-03-30 21:37:58 +01:00
8db0c1ca39 artixpkg admin: fix maintainer parallel
All checks were successful
Artools shellcheck / lint (push) Successful in 41s
2024-03-27 10:12:14 +01:00
190340e375 artixpkg admin: fix maintainer usage example
All checks were successful
Artools shellcheck / lint (push) Successful in 45s
2024-03-27 00:45:44 +01:00
f7a61731ba agent-branches (#118)
All checks were successful
Artools shellcheck / lint (push) Successful in 38s
Reviewed-on: #118
2024-03-26 18:27:50 +01:00
e959ce10c3 artixpkg admin: fix maintainer parallel (#121)
All checks were successful
Artools shellcheck / lint (push) Successful in 35s
Reviewed-on: #121
2024-03-25 23:14:22 +01:00
d2bbf9d8c4 Merge pull request 'packagersign: fix signing' (#120) from psign into master
Some checks failed
Artools shellcheck / lint (push) Has been cancelled
Reviewed-on: #120
2024-03-25 23:13:48 +01:00
1dafa0fb38 packagersign: fix signing
All checks were successful
Artools shellcheck / lint (pull_request) Successful in 52s
2024-03-25 22:50:11 +01:00
982a9ed678 artixpkg: fix ci usage
All checks were successful
Artools shellcheck / lint (push) Successful in 48s
2024-03-23 14:25:20 +01:00
11 changed files with 56 additions and 44 deletions

View File

@@ -35,3 +35,6 @@
# default archiving org
# GIT_ORG_ARCHIVE='landfill'
# default jenkins agents
# AGENTS=(orion taurus)

View File

@@ -31,7 +31,7 @@ artixpkg_admin_usage() {
$ ${COMMAND} query --topic mytopic
$ ${COMMAND} topic --add mytopic libfoo
$ ${COMMAND} team --add ${ARTIX_TEAMS[3]} libfoo
$ ${COMMAND} --adopt libfoo libbar
$ ${COMMAND} maintainer --adopt libfoo libbar
_EOF_
}

View File

@@ -48,7 +48,7 @@ artixpkg_admin_maintainer() {
local -r orphan="orphan"
local command=${_ARTOOLS_COMMAND:-${BASH_SOURCE[0]##*/}}
local RUNCMD=${_ARTOOLS_COMMAND:-${BASH_SOURCE[0]##*/}}
while (( $# )); do
case $1 in
@@ -58,12 +58,12 @@ artixpkg_admin_maintainer() {
;;
-a|--adopt)
ADOPT=1
RUNCMD+=" $1 $maintainer"
RUNCMD+=" $1"
shift
;;
-o|--orphan)
ORPHAN=1
RUNCMD+=" $1 $orphan"
RUNCMD+=" $1"
shift
;;
--)
@@ -103,7 +103,7 @@ artixpkg_admin_maintainer() {
export ARTOOLS_COLOR=always
fi
if ! parallel --bar --jobs "${jobs}" "${RUNCMD}" ::: "${pkgbases[@]}"; then
die 'Failed to pull some packages, please check the output'
die 'Failed to manange some packages, please check the output'
exit 1
fi
exit 0
@@ -118,7 +118,7 @@ artixpkg_admin_maintainer() {
warning "failed to add topic: $maintainer"
fi
if ! remove_topic "${gitname}" "$orphan"; then
warning "failed to remove topic: $orphan"
warning "failed to remove topic: $orphan"
fi
fi
@@ -127,7 +127,7 @@ artixpkg_admin_maintainer() {
warning "failed to add topic: $orphan"
fi
if ! remove_topic "${gitname}" "$maintainer"; then
warning "failed to remove topic: $maintainer"
warning "failed to remove topic: $maintainer"
fi
fi

View File

@@ -11,14 +11,6 @@ source "${LIBDIR}"/pkg/db/db.sh
set -e
write_jenkinsfile() {
printf "@Library('artix-ci@%s') import org.artixlinux.RepoPackage\n" "${1}" > "${REPO_CI}"
{
printf '\n'
printf 'PackagePipeline(new RepoPackage(this))\n'
} >> "${REPO_CI}"
}
artixpkg_ci_config_usage() {
local -r COMMAND=${_ARTOOLS_COMMAND:-${BASH_SOURCE[0]##*/}}
cat <<- _EOF_
@@ -49,7 +41,6 @@ artixpkg_ci_config() {
local SWITCH=0
# variables
local RUNCMD=${_ARTOOLS_COMMAND:-${BASH_SOURCE[0]##*/}}
local path realpath pkgbase
while (( $# )); do
@@ -65,7 +56,6 @@ artixpkg_ci_config() {
-a|--agent)
(( $# <= 1 )) && die "missing argument for %s" "$1"
AGENT="$2"
RUNCMD+=" $1 ${AGENT}"
shift 2
;;
-j|--jobs)
@@ -97,18 +87,6 @@ artixpkg_ci_config() {
fi
fi
# parallelization
if [[ ${jobs} != 1 ]] && (( ${#paths[@]} > 1 )); then
if [[ -n ${BOLD} ]]; then
export ARTOOLS_COLOR=always
fi
if ! parallel --bar --jobs "${jobs}" "${RUNCMD}" ::: "${paths[@]}"; then
die 'Failed to configure some packages, please check the output'
exit 1
fi
exit 0
fi
for path in "${paths[@]}"; do
if ! realpath=$(realpath -e "${path}"); then
error "No such directory: ${path}"

View File

@@ -30,11 +30,6 @@ readonly ARTIX_TEAMS=(
"${ARTIX_DB[11]}"
)
readonly AGENTS=(
orion
taurus
)
readonly REPO_DB='.artixlinux/pkgbase.yaml'
readonly REPO_CI='.artixlinux/Jenkinsfile'
@@ -360,3 +355,24 @@ show_srcinfo_base() {
show_srcinfo_pkgs() {
pkg2yaml . | yq '.pkgnames'
}
write_jenkinsfile() {
printf "@Library('artix-ci@%s') import org.artixlinux.RepoPackage\n" "${1}" > "${REPO_CI}"
{
printf '\n'
printf 'PackagePipeline(new RepoPackage(this))\n'
} >> "${REPO_CI}"
}
migrate_agent_branch() {
local branch=${AGENTS[0]}
for a in "${AGENTS[@]}"; do
if grep @"$a" "${REPO_CI}" &>/dev/null; then
branch="$a"
fi
done
if grep @galaxy "${REPO_CI}" &>/dev/null; then
branch=${AGENTS[1]}
fi
write_jenkinsfile "${branch}"
}

View File

@@ -160,6 +160,8 @@ artixpkg_repo_add() {
delete_obsolete_map_keys
migrate_agent_branch
if [[ -n $(git status --porcelain --untracked-files=no) ]]; then
stat_busy 'Staging files'

View File

@@ -129,6 +129,8 @@ artixpkg_repo_move() {
delete_obsolete_map_keys
migrate_agent_branch
update_yaml_team "$(auto_detect)"
if [[ -n $(git status --porcelain --untracked-files=no) ]]; then

View File

@@ -107,6 +107,8 @@ artixpkg_repo_remove() {
delete_obsolete_map_keys
migrate_agent_branch
if [[ -n $(git status --porcelain --untracked-files=no) ]]; then
stat_busy 'Staging files'

View File

@@ -60,6 +60,10 @@ load_pkg_config(){
DBEXT=${DBEXT:-'gz'}
if [[ -z "${AGENTS[*]}" ]]; then
AGENTS=(orion taurus)
fi
return 0
}

View File

@@ -20,10 +20,11 @@ usage() {
Usage: ${COMMAND} [COMMAND] [OPTIONS]
COMMANDS
repo Pacman database modification for package updates, moves, etc.
git Manage Git packaging repositories and their configuration
agent Manage CI and build agent
admin Manage topics, teams and obsolete repos
ci Manage CI and build agent
git Manage Git packaging repositories and their configuration
repo Pacman database modification for package updates, moves, etc.
version Show artixpkg version information
OPTIONS

View File

@@ -11,6 +11,13 @@ source "${LIBDIR}"/base/chroot.sh
# shellcheck source=src/lib/pkg/deploy.sh
source "${LIBDIR}"/pkg/deploy.sh
# shellcheck source=config/makepkg/x86_64.conf
load_makepkg_config
export PKGDEST
export GPG_KEY
export GPG_PASS
passfiles=("$@")
sign_pkg(){
@@ -23,16 +30,13 @@ sign_pkg(){
if [[ -n "${GPG_KEY}" ]] && [[ -n "${GPG_PASS}" ]]; then
msg "Signing [%s]" "${file_to_sign##*/}"
if ! gpg --homedir /etc/pacman.d/gnupg --no-permission-warning \
--no-default-keyring --default-key "${GPGP_KEY}" --passphrase "${GPGP_PASS}" \
-q --detach-sign "$file_to_sign"; then
return 1
fi
gpg --homedir /etc/pacman.d/gnupg --no-permission-warning \
--no-default-keyring --default-key "${GPG_KEY}" --passphrase "${GPG_PASS}" \
-q --detach-sign "$file_to_sign"
fi
return 0
}
check_root "" "${BASH_SOURCE[0]}" "$@"
check_root PKGDEST,GPG_KEY,GPG_PASS "${BASH_SOURCE[0]}" "$@"
for pkg in "${passfiles[@]}"; do
msg "Searching %s ..." "$pkg"