-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'topic/okurth/ci-add-gitlab-runner' into 'master'
ci: add gitlab-runner example See merge request core-build/photon-os-installer!102
- Loading branch information
Showing
6 changed files
with
148 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
live: False | ||
|
||
password: | ||
crypted: false | ||
text: changeme | ||
|
||
disks: | ||
default: | ||
filename: !param rootdisk=root.img | ||
size: 40960 | ||
|
||
partitions: | ||
- mountpoint: / | ||
size: 0 | ||
filesystem: ext4 | ||
- mountpoint: /boot | ||
size: 128 | ||
filesystem: ext4 | ||
- size: 4 | ||
filesystem: swap | ||
|
||
repos: | ||
photon: | ||
name: "Photon 5.0" | ||
baseurl: !param photon_repo_url=https://packages.vcfd.broadcom.net/artifactory/photonos-rpm-local/$releasever/photon_updates_$releasever_$basearch/ | ||
enabled: 1 | ||
gpgcheck: 0 | ||
|
||
packagelist_file: packages_minimal.json | ||
|
||
additional_packages: | ||
# install vim because you probably need to edit config files | ||
- vim | ||
- build-essential | ||
- zlib-devel | ||
# to build docker images | ||
- docker-buildx | ||
# gitlab runner needs git | ||
- git | ||
# python3 is optional, but many CI/CD jobs will need it | ||
- python3 | ||
- python3-PyYAML | ||
- python3-pytest | ||
- python3-lxml | ||
- python3-xmltodict | ||
# to install gitlab python package | ||
- python3-pip | ||
- jq | ||
- tar | ||
- sshpass | ||
|
||
linux_flavor: linux | ||
|
||
additional_files: | ||
- sudoers-wheel-nopasswd: /etc/sudoers.d/wheel-nopasswd | ||
|
||
postinstall: | ||
# see https://docs.gitlab.com/runner/install/linux-manually.html#using-binary-file | ||
- curl -L --output /usr/local/bin/gitlab-runner "https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-linux-amd64" | ||
- chmod +x /usr/local/bin/gitlab-runner | ||
- useradd --comment 'GitLab Runner' --create-home gitlab-runner --shell /bin/bash | ||
- gitlab-runner install --user=gitlab-runner --working-directory=/home/gitlab-runner | ||
|
||
- pip3 install git+https://github.com/python-gitlab/python-gitlab.git | ||
|
||
# some scripts use pytest-3 | ||
- ln -fs /usr/bin/pytest3.11 /usr/bin/pytest-3 | ||
|
||
# enable docker and allow gitlab-runner to use it | ||
- systemctl enable docker | ||
- usermod -aG docker gitlab-runner | ||
|
||
# sudo access for gitlab-runner | ||
- usermod -aG wheel gitlab-runner | ||
|
||
# allow ssh root login - needed for testing | ||
- sed -i "s/\(^PermitRootLogin\)[ ]*no$/\1 yes/g" /etc/ssh/sshd_config | ||
|
||
docker: | ||
images: | ||
- method: pull | ||
name: dockerhub.artifactory.vcfd.broadcom.net/photon:5.0 | ||
tags: | ||
- photon:5.0 | ||
|
||
eject_cdrom: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
system: | ||
name: glrunner | ||
type: vmx-14 vmx-20 vmx-21 | ||
os_vmw: vmwarePhoton64Guest | ||
firmware: efi | ||
secure_boot: false | ||
|
||
networks: | ||
vm_network: | ||
name: "VM Network" | ||
description: "The VM Network network" | ||
|
||
hardware: | ||
cpus: | ||
type: cpus | ||
number: 4 | ||
memory: | ||
type: memory | ||
size: 8192 | ||
sata1: | ||
type: sata_controller | ||
scsi1: | ||
type: scsi_controller | ||
rootdisk: | ||
type: hard_disk | ||
parent: scsi1 | ||
raw_image: !param rootdisk=root.img | ||
usb1: | ||
type: usb_controller | ||
ethernet1: | ||
type: ethernet | ||
subtype: VmxNet3 | ||
network: vm_network | ||
videocard1: | ||
type: video_card | ||
vmci1: | ||
type: vmci | ||
|
||
product: | ||
product: Photon OS Gitlab Runner | ||
vendor: VMware Inc. | ||
|
||
annotation: | ||
text: > | ||
Provides a simple gitlab runner based on Photon. | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
%wheel ALL=(ALL:ALL) NOPASSWD: ALL |