]> source.dussan.org Git - sonarqube.git/commitdiff
BUILD-2482 setup gitlab on runtime
authorJulien Carsique <julien.carsique@sonarsource.com>
Wed, 1 Feb 2023 14:52:22 +0000 (15:52 +0100)
committersonartech <sonartech@sonarsource.com>
Tue, 28 Feb 2023 20:03:02 +0000 (20:03 +0000)
.cirrus.yml

index 0ad715d8cac6c2db9ec127e72fb1fdc5f42217af..c442f8e122766d3940d7b39d2a1e65249fd2aeee 100644 (file)
@@ -417,6 +417,23 @@ qa_gitlab_task:
         cpu: 2
         memory: 5Gb
         image: ${CIRRUS_AWS_ACCOUNT}.dkr.ecr.eu-central-1.amazonaws.com/gitlab:${GITLAB_VERSION}
+        env:
+          - GITLAB_POST_RECONFIGURE_SCRIPT: |-
+              { cat >/tmp/setup.rb <<-'EOF'
+                token = User.find_by_username('root').personal_access_tokens.create(scopes: [:api], name: 'token');
+                token.set_token('token-here-456');
+                token.save!;
+                token_read = User.find_by_username('root').personal_access_tokens.create(scopes: [:read_user], name: 'token_read');
+                token_read.set_token('token-read-123');
+                token_read.save!;
+                user = User.find_by_username('root');
+                user.password = 'eng-YTU1ydh6kyt7tjd';
+                user.password_confirmation = 'eng-YTU1ydh6kyt7tjd';
+                user.save!;
+              EOF
+              } && gitlab-rails runner /tmp/setup.rb && \
+              echo 'from_file "/etc/gitlab/external_gitlab.rb"' >> /etc/gitlab/gitlab.rb && \
+              gitlab-ctl reconfigure
   script:
     - ./private/cirrus/cirrus-qa.sh h2
   <<: *DEFAULT_ARTIFACTS_TEMPLATE