[gnome-build-meta: 3/3] Revert ".gitlab-ci.yml: use flat-manager to push to gbm.g.o"



commit 9ae4f45ed70fe73b5412132b167fc83328513f04
Author: Abderrahim Kitouni <akitouni gnome org>
Date:   Wed Mar 27 16:08:40 2019 +0100

    Revert ".gitlab-ci.yml: use flat-manager to push to gbm.g.o"
    
    This reverts commit 5f745bcd04aa1c73c4352a4e728c14ebed088afa.

 .gitlab-ci.yml | 146 +++++++++++++++++++++++++++++++++++++++++++--------------
 1 file changed, 112 insertions(+), 34 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 7a02150d..9bd668f2 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -62,18 +62,39 @@ before_script:
           push: true
     EOF
 
+  # and ssh key for pushing to the flatpak repo
+  - |
+    if [ -n "$GITLAB_SSH_KEY" ]; then
+        mkdir -p ~/.ssh
+
+        echo "$GITLAB_SSH_KEY" > ~/.ssh/id_rsa
+        chmod 600 ~/.ssh/id_rsa
+
+        cat >> ~/.ssh/config << EOF
+    Host gbm-builder.gnome.org
+        User gbm
+        ProxyJump bastion.gnome.org
+        Hostname vpn.gbm-builder.gnome.org
+
+    Host bastion.gnome.org
+        User gbm
+    EOF
+
+        # Trust the host key of the jump host and release server
+        cat > ~/.ssh/known_hosts << EOF
+    |1|Ec1eaTSoDQshjIpoIPouJCw40R4=|wG59JbBlwNW2K3kznnH7OUZYEhA= ssh-rsa 
AAAAB3NzaC1yc2EAAAABIwAAAQEAz8HWpA/W/0c/jV9+nU9zyZVUjw8flLksl6BNkcM3s12AMJXTG6qLJ+qVeQwI20eDkTioLLQYgOmMsmmFsO68vlivuxHYfAvjFHui6TkDVGXJS3lPGyOCqVwRmpyG0GnrfRWdsdgrYEo6sGbParkRb/ZfXxOuUXg3wWXMmeMyWXhkb09b1uYZTUjuruJpJTQ9kIC3CH8bdl7oiq2ffd+KdAykTkzkq+kFNizNRe0uBKtkcDgYpAZGOPCEJjpjwvDrWinXoE7rvE8zMfAv2/CP5AM4D+8yHrFgWz9tOexJyNsfJAZmQjg5rWuoeYow9tTVNWVloRU3tvF8OvVprgwPAw==
+    |1|DdY9PAqPg4LrkwIatwAUs3JLOXU=|fJqmuz18y1bJLarIIqckB1dH/ts= ecdsa-sha2-nistp256 
AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBAGixpYwAfvRyHOlqpKnrpo3iG5zPjQNL0hcay90SlNMfZ4W6+QUoFTZ/rQXDQFbBrOgTXzFDEQxKxxo350n6dw=
+    EOF
+
+    fi
+
   # flat-manager-client to push to flathub
   - git clone https://github.com/flatpak/flat-manager
 
   - |
-    if [ "$FLATPAK_BRANCH" = master ] && [ -n "$NIGHTLY_REPO_TOKEN" ]; then
-      export REPO_TOKEN=$NIGHTLY_REPO_TOKEN
-      export FLAT_MANAGER_SERVER=https://gbm.gnome.org/
-      export FLAT_MANAGER_REPO=nightly
-    elif [ "$FLATPAK_BRANCH" != master ] && [ -n "$FLATHUB_REPO_TOKEN" ]; then
+    if [ -n "$FLATHUB_REPO_TOKEN" ]; then
       export REPO_TOKEN=$FLATHUB_REPO_TOKEN
       export FLAT_MANAGER_SERVER=https://hub.flathub.org/
-      export FLAT_MANAGER_REPO=stable
     fi
 
 #
@@ -97,15 +118,50 @@ before_script:
     - ${BST} -o arch "${ARCH}" build flatpak-runtimes.bst
 
     - ${BST} -o arch "${ARCH}" checkout --hardlinks flatpak-runtimes.bst repo/
-    - flatpak build-update-repo --generate-static-deltas repo/
-    - flat-manager/flat-manager-client push $(cat build.txt) repo/
+
+    # Push the resulting runtimes to gbm.gnome.org
+    # Assume there will be no branch name collisions,
+    # the ssh key is available only on protected branches
+    - rsync -a repo/ gbm-builder.gnome.org:incoming/repo-${CI_JOB_ID}
+    - ssh gbm-builder.gnome.org gbm-flatpak-scripts/import-commits -c "${CONFIG_FILE}" 
incoming/repo-${CI_JOB_ID}
+
+.flatpak-nightly-template:
+  extends: .flatpak-template
+  environment:
+    name: nightly/${ARCH}
+  variables:
+    CONFIG_FILE: config/nightly.json
   only:
-    - master
-    - /^gnome-\d-\d\d$/
+    refs:
+      - master
+    variables:
+      - $GITLAB_SSH_KEY
   except:
     variables:
       - $EMERGENCY
 
+.flatpak-stable-template:
+  stage: flatpak
+  script:
+    - ${BST} -o arch "${ARCH}" build flatpak-runtimes.bst
+
+    - |
+      if [ -n "$REPO_TOKEN" ]; then
+        bst -o arch "${ARCH}" checkout --hardlinks flatpak-runtimes.bst repo/
+        flatpak build-update-repo --generate-static-deltas repo/
+        flat-manager/flat-manager-client push $(cat build.txt) repo/
+      fi
+  only:
+    - /^gnome-\d-\d\d$/
+
+.flatpak-emergency-template:
+  extends: .flatpak-nightly-template
+  when: manual
+  only:
+    variables:
+      - $EMERGENCY
+  except: []
+
 #
 # Architecture specific settings
 #
@@ -179,40 +235,70 @@ build-gnome-core-arm:
   <<: *arm
 
 
-flapak-prepare:
+flathub-prepare:
   stage: prepare_flatpak
   script:
-    - flat-manager/flat-manager-client create $FLAT_MANAGER_SERVER $FLAT_MANAGER_REPO > build.txt
+    - flat-manager/flat-manager-client create $FLAT_MANAGER_SERVER stable > build.txt
   artifacts:
     paths:
       - build.txt
   only:
-    - master
     - /^gnome-\d-\d\d$/
-  except:
-    variables:
-      - $EMERGENCY
   <<: *x86_64
 
 
-flatpak-x86_64:
-  extends: .flatpak-template
+flatpak-nightly-x86_64:
+  extends: .flatpak-nightly-template
   <<: *x86_64
 
-flatpak-i386:
-  extends: .flatpak-template
+flatpak-nightly-i386:
+  extends: .flatpak-nightly-template
   <<: *i686
 
-flatpak-aarch64:
-  extends: .flatpak-template
+flatpak-nightly-aarch64:
+  extends: .flatpak-nightly-template
   <<: *aarch64
 
-flatpak-arm:
-  extends: .flatpak-template
+flatpak-nightly-arm:
+  extends: .flatpak-nightly-template
   <<: *arm
 
 
-flatpak-finish:
+flatpak-stable-x86_64:
+  extends: .flatpak-stable-template
+  <<: *x86_64
+
+flatpak-stable-i386:
+  extends: .flatpak-stable-template
+  <<: *i686
+
+flatpak-stable-aarch64:
+  extends: .flatpak-stable-template
+  <<: *aarch64
+
+flatpak-stable-arm:
+  extends: .flatpak-stable-template
+  <<: *arm
+
+
+flatpak-emergency-x86_64:
+  extends: .flatpak-emergency-template
+  <<: *x86_64
+
+flatpak-emergency-i386:
+  extends: .flatpak-emergency-template
+  <<: *i686
+
+flatpak-emergency-aarch64:
+  extends: .flatpak-emergency-template
+  <<: *aarch64
+
+flatpak-emergency-arm:
+  extends: .flatpak-emergency-template
+  <<: *arm
+
+
+flathub-finish:
   stage: finish_flatpak
   script:
     # the `|| true` is to work around instability in the flathub infrastructure
@@ -221,22 +307,14 @@ flatpak-finish:
     - flat-manager/flat-manager-client publish --wait $(cat build.txt) || true
     - flat-manager/flat-manager-client purge $(cat build.txt)
   only:
-    - master
     - /^gnome-\d-\d\d$/
-  except:
-    variables:
-      - $EMERGENCY
   <<: *x86_64
 
-flatpak-finish-failed:
+flathub-finish-failed:
   stage: finish_flatpak
   script:
     - flat-manager/flat-manager-client purge $(cat build.txt)
   when: on_failure
   only:
-    - master
     - /^gnome-\d-\d\d$/
-  except:
-    variables:
-      - $EMERGENCY
   <<: *x86_64


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]