Skip to content
This repository was archived by the owner on Oct 7, 2025. It is now read-only.

Commit 59536a3

Browse files
authored
Gitlab migration pr 2.x (#2738)
* Trying an ansible-lint container for GitLab. * Preparing GitLab CI config for ce-provision tests. * Run linters unless merging to 2.x. * Fixed the CI rules for linting.
1 parent b4b29e7 commit 59536a3

1 file changed

Lines changed: 56 additions & 0 deletions

File tree

.gitlab-ci.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,68 @@
11
---
2+
variables:
3+
FF_SCRIPT_SECTIONS: "true"
4+
25
before_script:
36
- export $BASH_VARS
47

58
stages:
69
- linting
10+
- builds
711

812
ansible-lint:
913
stage: linting
1014
image: registry.gitlab.com/pipeline-components/ansible-lint:latest
1115
script:
1216
- ansible-lint --show-relpath roles
17+
rules:
18+
- if: $CI_COMMIT_BRANCH != "$CI_DEFAULT_BRANCH"
19+
- if: $CI_PIPELINE_SOURCE == "schedule"
20+
when: never
21+
22+
yamllint:
23+
stage: linting
24+
image: registry.gitlab.com/pipeline-components/yamllint:latest
25+
script:
26+
- yamllint roles
27+
rules:
28+
- if: $CI_COMMIT_BRANCH != "$CI_DEFAULT_BRANCH"
29+
- if: $CI_PIPELINE_SOURCE == "schedule"
30+
when: never
31+
32+
webserver:
33+
stage: builds
34+
image: debian:bookworm
35+
script:
36+
- |
37+
/usr/bin/apt-get update
38+
/usr/bin/apt-get install -y curl sudo
39+
/usr/bin/curl -LO ${CI_MERGE_REQUEST_SOURCE_PROJECT_URL}/-/raw/${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}/install.sh
40+
/usr/bin/chmod +x ./install.sh
41+
/usr/bin/sudo ./install.sh --version ${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME} --config-branch ${CI_MERGE_REQUEST_TARGET_BRANCH_NAME} --docker --no-firewall
42+
/usr/bin/git config --global --add safe.directory /home/controller/ce-provision
43+
/usr/bin/git config --global --add safe.directory /home/controller/ce-provision/config
44+
/usr/sbin/sshd&
45+
/usr/bin/su - controller -c "cd /home/controller/ce-provision && /bin/sh /home/controller/ce-provision/scripts/provision.sh --python-interpreter /home/controller/ce-python/bin/python3 --repo dummy --branch dummy --workspace /home/controller/ce-provision/ce-dev/ansible --playbook plays/web/ci.yml --own-branch ${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME} --config-branch ${CI_MERGE_REQUEST_TARGET_BRANCH_NAME} --force"
46+
rules:
47+
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
48+
- if: $CI_PIPELINE_SOURCE == "schedule"
49+
when: always
50+
51+
gitlabserver:
52+
stage: builds
53+
image: debian:bookworm
54+
script:
55+
- |
56+
/usr/bin/apt-get update
57+
/usr/bin/apt-get install -y curl sudo
58+
/usr/bin/curl -LO ${CI_MERGE_REQUEST_SOURCE_PROJECT_URL}/-/raw/${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}/install.sh
59+
/usr/bin/chmod +x ./install.sh
60+
/usr/bin/sudo ./install.sh --version ${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME} --config-branch ${CI_MERGE_REQUEST_TARGET_BRANCH_NAME} --docker --no-firewall
61+
/usr/bin/git config --global --add safe.directory /home/controller/ce-provision
62+
/usr/bin/git config --global --add safe.directory /home/controller/ce-provision/config
63+
/usr/sbin/sshd&
64+
/usr/bin/su - controller -c "cd /home/controller/ce-provision && /bin/sh /home/controller/ce-provision/scripts/provision.sh --python-interpreter /home/controller/ce-python/bin/python3 --repo dummy --branch dummy --workspace /home/controller/ce-provision/ce-dev/ansible --playbook plays/gitlab/ci.yml --own-branch ${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME} --config-branch ${CI_MERGE_REQUEST_TARGET_BRANCH_NAME} --force"
65+
rules:
66+
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
67+
- if: $CI_PIPELINE_SOURCE == "schedule"
68+
when: always

0 commit comments

Comments
 (0)