From 17db219916eec0191f4f28a8a12da411b8cb1a13 Mon Sep 17 00:00:00 2001
From: jo <ljonas@riseup.net>
Date: Mon, 12 Dec 2022 17:54:08 +0100
Subject: [PATCH] ci: keep job variables in the build job definition

---
 .gitlab-ci.yml | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index cf9bf12..ad46007 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -20,9 +20,6 @@ stages:
 variables:
   POSTGRES_PASSWORD: postgres
   POSTGRES_DB: funkwhale_network
-  DOCKER_HOST: tcp://docker:2375/
-  DOCKER_DRIVER: overlay2
-  DOCKER_TLS_CERTDIR: ""
 
 pre-commit:
   extends: [.pre-commit]
@@ -51,12 +48,17 @@ pre-commit:
 #        path: coverage.xml
 
 build:
-  only:
-    - main
   stage: build
-  image: egon0/docker-with-buildx-and-git:bash
+  rules:
+    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
+
   tags:
     - dind
+  image: egon0/docker-with-buildx-and-git:bash
+  variables:
+    DOCKER_HOST: tcp://docker:2375/
+    DOCKER_DRIVER: overlay2
+    DOCKER_TLS_CERTDIR: ""
   services:
     - docker:20-dind
   before_script:
-- 
GitLab