Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
gitlab_to_aptly [2021/05/29 15:05] okias update |
gitlab_to_aptly [2021/06/29 20:36] (current) okias english |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Creating repository from automated Debian Salsa builds ====== | ====== Creating repository from automated Debian Salsa builds ====== | ||
| + | {{ : | ||
| ===== Motivation ===== | ===== Motivation ===== | ||
| I'm not an Debian maintainer. Nor I want to be in future. | I'm not an Debian maintainer. Nor I want to be in future. | ||
| - | My reasons to do all this is that: | + | My reasons to do all this is: |
| - I want some specific software to be packaged for Debian | - I want some specific software to be packaged for Debian | ||
| - | - when I update packaging on salsa.debian.org I want to have available package for computers and phones | + | - when I update packaging on salsa.debian.org I want to have available package for my devices |
| - | - I don't want to bother | + | - I don't want to bother |
| - I want also others to be able use my packages | - I want also others to be able use my packages | ||
| These reasons motivated me to look into [[salsa.debian.org/ | These reasons motivated me to look into [[salsa.debian.org/ | ||
| - | ===== Predispozition | + | ==== Advantages |
| - | - You have correctly setup Salsa CI (including | + | * package build process is handled by salsa, no need to worry about it |
| - | - you didn't disabled | + | * ecologic - it's build only once |
| + | |||
| + | ==== Disadvantages ==== | ||
| + | * no control about build process than offered by salsa-ci.yml configuration file | ||
| + | |||
| + | ===== Predisposition | ||
| + | - You did correctly setup **debian/ | ||
| + | - you build for achitectures | ||
| - | You can take [[https:// | + | You can look at project configuration of [[https:// |
| ===== Where to start ===== | ===== Where to start ===== | ||
| Line 27: | Line 34: | ||
| Then it's a time to create user and generate your repository replated GPG key. | Then it's a time to create user and generate your repository replated GPG key. | ||
| + | ==== Aptly ==== | ||
| < | < | ||
| useradd -m repo && export USER=repo # create user repo | useradd -m repo && export USER=repo # create user repo | ||
| Line 59: | Line 66: | ||
| TOKEN= # watch https:// | TOKEN= # watch https:// | ||
| - | ARCHS=" | + | ARCHS=" |
| - | JOBS=" | + | JOBS=" |
| ARTIF_UNPACK=debian/ | ARTIF_UNPACK=debian/ | ||
| Line 97: | Line 104: | ||
| get_artifacts() { | get_artifacts() { | ||
| for job in $JOBS; do | for job in $JOBS; do | ||
| - | curl -o ${id}_${job}.zip -H ' | + | BRANCH=" |
| + | curl -o ${id}_${job}.zip -H ' | ||
| unzip ${id}_${job}.zip && \ | unzip ${id}_${job}.zip && \ | ||
| rm ${id}_${job}.zip && \ | rm ${id}_${job}.zip && \ | ||
| Line 114: | Line 122: | ||
| aptly repo add ${REPO_NAME} ${ARTIF_UNPACK} # add files | aptly repo add ${REPO_NAME} ${ARTIF_UNPACK} # add files | ||
| aptly publish drop unstable # first we get rid of previously published repo | aptly publish drop unstable # first we get rid of previously published repo | ||
| - | | + | APTLY_ARCHS=`echo $ARCHS | tr " " ,` |
| + | aptly publish repo -batch -architectures | ||
| } | } | ||
| Line 122: | Line 131: | ||
| </ | </ | ||
| + | |||
| + | ==== Nginx ==== | ||
| Test script with < | Test script with < | ||
| Line 141: | Line 152: | ||
| systemctl reload nginx and check URL, if you see the repository. | systemctl reload nginx and check URL, if you see the repository. | ||
| + | |||
| + | ==== Testing it ==== | ||
| In that case, you can try add it to the first device. Replace ixit with your repository name: | In that case, you can try add it to the first device. Replace ixit with your repository name: | ||
| Line 147: | Line 160: | ||
| echo "deb https:// | echo "deb https:// | ||
| curl -o / | curl -o / | ||
| - | apt update # shouldn' | + | apt update # shouldn' |
| </ | </ | ||
| now you can install package you desire and test. | now you can install package you desire and test. | ||
| + | |||
| + | ==== Repository refreshing ==== | ||
| Most likely, you'll want to regenerate your repository at least every hour. | Most likely, you'll want to regenerate your repository at least every hour. | ||