Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
sauterp committed Sep 21, 2023
1 parent 23d2a6f commit e51b22d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 13 deletions.
3 changes: 3 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ nfpms:

publishers:
- name: aptly
env:
- AWS_ACCESS_KEY_ID={{ .Env.AWS_ACCESS_KEY_ID }}
- AWS_SECRET_ACCESS_KEY={{ .Env.AWS_SECRET_ACCESS_KEY }}
ids:
- nfpms
cmd: ./publish-artifact.sh {{ .ArtifactPath }}
33 changes: 20 additions & 13 deletions publish-artifact.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,35 @@ aptlydistro=stable
aptlycmd="aptly -config=.aptly.conf"
gpgkeyflag='-gpg-key=7100E8BFD6199CE0374CB7F003686F8CDE378D41'

if $aptlycmd mirror show $aptlymirror >/dev/null 2>&1; then
echo "repo $aptlymirror already exists"
else
$aptlycmd mirror create \
$aptlymirror \
$archiveurl \
$aptlydistro
fi
# if $aptlycmd mirror show $aptlymirror >/dev/null 2>&1; then
# echo "repo $aptlymirror already exists"
# else
# $aptlycmd mirror create \
# -filter="(latest)" \
# $aptlymirror \
# $archiveurl \
# $aptlydistro
# fi

$aptlycmd mirror update \
$aptlymirror
# $aptlycmd mirror update \
# $aptlymirror

if $aptlycmd repo show $aptlyrepo >/dev/null 2>&1; then
echo "repo $aptlyrepo already exists"
else
$aptlycmd repo import $aptlymirror $aptlyrepo $aptlydistro
$aptlycmd repo create $aptlyrepo
# $aptlycmd repo import $aptlymirror $aptlyrepo $aptlydistro
fi

if echo $artifact | grep -q '.*.deb'; then
$aptlycmd repo add $aptlyrepo $artifact
$aptlycmd publish update \
$aptlycmd publish repo \
$gpgkeyflag \
$aptlydistro \
-distribution=$aptlydistro \
$aptlyrepo \
$aptlyremote
# $aptlycmd publish update \
# $gpgkeyflag \
# $aptlydistro \
# $aptlyremote
fi

0 comments on commit e51b22d

Please sign in to comment.