Skip to content
Snippets Groups Projects
Commit 1e39c8da authored by Frederic Danis's avatar Frederic Danis
Browse files

Fix flatpak runtime upload


Embed runtime upload to `images.apertis.org` in `build-runtime` job
instead of a separated job which consume runners and time.
Main runtime is uploaded to `/srv/images/public/flatpak/mildenhall`
MRs are uploaded to `/srv/images/test/flatpak/mildenhall/$CI_COMMIT_REF_SLUG`

Signed-off-by: default avatarFrédéric Danis <frederic.danis@collabora.com>
parent 4929dfee
No related branches found
No related tags found
1 merge request!3Fix flatpak runtime upload
Pipeline #133682 passed
......@@ -3,12 +3,14 @@
variables:
FLATDEB_PROJECT_URL: https://gitlab.apertis.org/infrastructure/apertis-flatdeb.git
APERTIS_RELEASE: "v2021dev2"
upload_host: archive@images.apertis.org
upload_root_main: /srv/images/public/flatpak/mildenhall
upload_root_test: /srv/images/test/flatpak/mildenhall/$CI_COMMIT_REF_SLUG
image: registry.gitlab.apertis.org/infrastructure/apertis-docker-images/${APERTIS_RELEASE}-package-builder
stages:
- build runtime
# - upload runtime
build-runtime:
variables:
......@@ -19,30 +21,27 @@ build-runtime:
before_script:
- apt update
- apt install -y binutils debootstrap debos flatpak ostree pigz python3 python3-debian python3-gi python3-yaml systemd-container time flatpak-builder
- mkdir -p _build_runtime/
- chmod 0400 "$ARCHIVE_SECRET_FILE"
script:
- git clone --branch apertis/${APERTIS_RELEASE} --depth 1 ${FLATDEB_PROJECT_URL}
- apertis-flatdeb/run.py --suite=${APERTIS_RELEASE} --arch=amd64 base
- apertis-flatdeb/run.py --suite=${APERTIS_RELEASE} --arch=amd64 runtimes runtimes/org.apertis.mildenhall.yaml
- mv ~/.cache/flatdeb _build_runtime/.
# artifacts:
# paths:
# - _build_runtime/
- |
case "$CI_COMMIT_REF_NAME" in
apertis/*)
export UPLOAD_ROOT=$upload_root_main
;;
*)
export UPLOAD_ROOT=$upload_root_test
;;
esac
- ssh -oStrictHostKeyChecking=no -i "$ARCHIVE_SECRET_FILE" "$upload_host" mkdir -p "$UPLOAD_ROOT"
- rsync -e "ssh -oStrictHostKeyChecking=no -i $ARCHIVE_SECRET_FILE" -aP ~/.cache/flatdeb/ostree-repo/. "$upload_host:$UPLOAD_ROOT"
only:
refs:
- branches
- merge_requests
variables:
- $ARCHIVE_SECRET_FILE
except:
- tags
#upload-runtime:
# image: ubuntu:16.04
# stage: upload runtime
# script:
# - './upload.sh _build_runtime/flatdeb/ostree-repo/. mildenhall'
# dependencies:
# - build-runtime
# rules:
# - if: '$ARCHIVE_SECRET_FILE'
# when: on_success
# - when: never
#!/bin/bash
set -eux
LOCAL_PATH=$1
DEST_DIR=$2
cd $(dirname $0)
upload_host="archive@images.apertis.org"
upload_root="/srv/images/public/flatpak"
upload_dest="$upload_host:$upload_root"
apt -y update
apt -y install rsync ssh
chmod 0400 "$ARCHIVE_SECRET_FILE"
ssh -oStrictHostKeyChecking=no -i "$ARCHIVE_SECRET_FILE" "$upload_host" mkdir -p "$upload_root/$DEST_DIR"
rsync -e "ssh -oStrictHostKeyChecking=no -i $ARCHIVE_SECRET_FILE" -aP $LOCAL_PATH "$upload_dest/$DEST_DIR"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment