Skip to content
Snippets Groups Projects
Commit d95ff281 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/runtime`, main app
to `/srv/images/public/flatpak/app`
MRs are uploaded to
`/srv/images/test/flatpak/mildenhall/$CI_COMMIT_REF_SLUG/runtime`, and
`/srv/images/test/flatpak/mildenhall/$CI_COMMIT_REF_SLUG/app`.

Signed-off-by: default avatarFrédéric Danis <frederic.danis@collabora.com>
parent 0d1e65a5
No related branches found
No related tags found
1 merge request!6Update to v2021pre, new apertis-flatdeb-builder and fix upload process
...@@ -3,14 +3,17 @@ ...@@ -3,14 +3,17 @@
variables: variables:
FLATDEB_PROJECT_URL: https://gitlab.apertis.org/infrastructure/apertis-flatdeb.git FLATDEB_PROJECT_URL: https://gitlab.apertis.org/infrastructure/apertis-flatdeb.git
APERTIS_RELEASE: "v2021dev1" APERTIS_RELEASE: "v2021dev1"
upload_host: archive@images.apertis.org
upload_root_main: /srv/images/public/flatpak
upload_root_test: /srv/images/test/flatpak/flatdeb-demo/$CI_COMMIT_REF_SLUG
remote_url_main: https://images.apertis.org/public/flatpak/runtime
remote_url_test: https://images.apertis.org/test/flatpak/flatdeb-demo/${CI_COMMIT_REF_SLUG}/runtime
image: docker-registry.apertis.org/apertis/apertis-${APERTIS_RELEASE}-package-builder image: docker-registry.apertis.org/apertis/apertis-${APERTIS_RELEASE}-package-builder
stages: stages:
- build runtime - build runtime
- upload runtime
- build app - build app
- upload app
build-runtime: build-runtime:
variables: variables:
...@@ -19,65 +22,60 @@ build-runtime: ...@@ -19,65 +22,60 @@ build-runtime:
before_script: before_script:
- apt update - apt update
- apt install -y binutils debootstrap debos flatpak ostree pigz python3 python3-debian python3-gi python3-yaml systemd-container time flatpak-builder - 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: script:
- git clone --branch apertis/${APERTIS_RELEASE} --depth 1 ${FLATDEB_PROJECT_URL} - 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 base
- apertis-flatdeb/run.py --suite=${APERTIS_RELEASE} --arch=amd64 runtimes runtimes/org.apertis.demo.yaml - apertis-flatdeb/run.py --suite=${APERTIS_RELEASE} --arch=amd64 runtimes runtimes/org.apertis.demo.yaml
- mv ~/.cache/flatdeb _build_runtime/. - |
artifacts: case "$CI_COMMIT_REF_NAME" in
paths: apertis/*)
- _build_runtime/ export UPLOAD_ROOT=${upload_root_main}/runtime
;;
*)
export UPLOAD_ROOT=${upload_root_test}/runtime
;;
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: only:
refs: refs:
- branches - branches
- merge_requests - merge_requests
variables:
- $ARCHIVE_SECRET_FILE
except: except:
- tags - tags
upload-runtime:
image: ubuntu:16.04
stage: upload runtime
script:
- './upload.sh _build_runtime/flatdeb/ostree-repo/. runtime'
dependencies:
- build-runtime
rules:
- if: '$ARCHIVE_SECRET_FILE'
when: on_success
- when: never
build-app: build-app:
variables: variables:
GIT_STRATEGY: clone GIT_STRATEGY: clone
REMOTE_URL: https://images.apertis.org/public/flatpak/runtime
stage: build app stage: build app
before_script: before_script:
- apt update - apt update
- apt install -y binutils debootstrap debos flatpak ostree pigz python3 python3-debian python3-gi python3-yaml systemd-container time flatpak-builder - apt install -y binutils debootstrap debos flatpak ostree pigz python3 python3-debian python3-gi python3-yaml systemd-container time flatpak-builder
- mkdir -p _build_app/ - chmod 0400 "$ARCHIVE_SECRET_FILE"
script: script:
- git clone --branch apertis/${APERTIS_RELEASE} --depth 1 ${FLATDEB_PROJECT_URL} - git clone --branch apertis/${APERTIS_RELEASE} --depth 1 ${FLATDEB_PROJECT_URL}
- |
case "$CI_COMMIT_REF_NAME" in
apertis/*)
export UPLOAD_ROOT=${upload_root_main}/app
export REMOTE_URL=$remote_url_main
;;
*)
export UPLOAD_ROOT=${upload_root_test}/app
export REMOTE_URL=$remote_url_test
;;
esac
- apertis-flatdeb/run.py --remote-url="${REMOTE_URL}" --suite=${APERTIS_RELEASE} --arch=amd64 app apps/org.apertis.demo.curl.yaml - apertis-flatdeb/run.py --remote-url="${REMOTE_URL}" --suite=${APERTIS_RELEASE} --arch=amd64 app apps/org.apertis.demo.curl.yaml
- mv ~/.cache/flatdeb _build_app/. - ssh -oStrictHostKeyChecking=no -i "$ARCHIVE_SECRET_FILE" "$upload_host" mkdir -p "$UPLOAD_ROOT"
artifacts: - rsync -e "ssh -oStrictHostKeyChecking=no -i $ARCHIVE_SECRET_FILE" -aP ~/.cache/flatdeb/ostree-repo/. "$upload_host:$UPLOAD_ROOT"
paths:
- _build_app/
only: only:
refs: refs:
- branches - branches
- merge_requests - merge_requests
variables:
- $ARCHIVE_SECRET_FILE
except: except:
- tags - tags
upload-app:
image: ubuntu:16.04
stage: upload app
script:
- './upload.sh _build_app/flatdeb/ostree-repo/. app'
dependencies:
- build-app
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