-
Notifications
You must be signed in to change notification settings - Fork 200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert pipelines to obsah #1064
Open
ekohl
wants to merge
2
commits into
theforeman:master
Choose a base branch
from
ekohl:obsahize
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
#!/usr/bin/env python3 | ||
# PYTHON_ARGCOMPLETE_OK | ||
|
||
from typing import List | ||
from pathlib import Path | ||
|
||
import obsah | ||
|
||
|
||
class ApplicationConfig(obsah.ApplicationConfig): | ||
""" | ||
A class describing the where to find various files | ||
""" | ||
|
||
@staticmethod | ||
def name() -> str: | ||
""" | ||
Return the name as shown to the user in the ArgumentParser | ||
""" | ||
return 'forklift' | ||
|
||
@staticmethod | ||
def target_name() -> str: | ||
""" | ||
Return the name of the target in the playbook if the playbook takes a parameter. | ||
""" | ||
return 'pipeline' | ||
|
||
@staticmethod | ||
def data_path() -> Path: | ||
""" | ||
Returns the root of the project | ||
""" | ||
return Path(__file__).absolute().parent.parent | ||
|
||
@classmethod | ||
def playbooks_path(cls: obsah.ApplicationConfig) -> str: | ||
""" | ||
Return the data path. Houses playbooks and configs. | ||
""" | ||
return (cls.data_path() / 'pipelines').as_posix() | ||
|
||
@classmethod | ||
def playbooks(cls: obsah.ApplicationConfig) -> List[obsah.Playbook]: | ||
""" | ||
Return all playbooks in the playbook path. | ||
""" | ||
paths = Path(cls.playbooks_path()).glob('*/*.yaml') | ||
return sorted(obsah.Playbook(playbook_path.as_posix(), cls) for playbook_path in paths | ||
if playbook_path.stem == playbook_path.parent.name) | ||
|
||
@classmethod | ||
def inventory_path(cls) -> str: | ||
""" | ||
Return the inventory path | ||
""" | ||
return (cls.data_path() / 'inventories').as_posix() | ||
|
||
|
||
if __name__ == '__main__': | ||
obsah.main(application_config=ApplicationConfig) |
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,7 @@ | ||
--- | ||
- import_playbook: 01-boxes.yml | ||
- import_playbook: 02-setup.yml | ||
- import_playbook: 03-install_server.yml | ||
- import_playbook: 04-install_proxy.yml | ||
- import_playbook: 05-tests.yml | ||
- import_playbook: 06-smoker.yml |
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,17 @@ | ||
help: | | ||
Run an install pipeline | ||
variables: | ||
forklift_state: | ||
parameter: --state | ||
help: Forklift state to ensure | ||
# TODO: choices: up/rebuild/destroy | ||
pipeline_os: | ||
parameter: --os | ||
help: Operating system to install, like centos8-stream, debian11 or ubuntu2004. Valid options depend on the pipeline | ||
pipeline_type: | ||
parameter: --type | ||
help: Type of pipeline, like foreman, katello or luna | ||
# TODO: choices: foreman/katello/luna | ||
pipeline_version: | ||
parameter: --version | ||
help: Version to install, like nightly, 3.7 or 4.9 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,14 @@ | ||
help: | | ||
Run a Pulpcore pipeline | ||
variables: | ||
forklift_state: | ||
parameter: --state | ||
help: Forklift state to ensure | ||
# TODO: up/rebuild/destroy | ||
pipeline_os: | ||
parameter: --os | ||
help: Operating system to install, like centos7, debian10 or ubuntu1804 | ||
pipeline_type: | ||
parameter: --type | ||
help: Type of pipeline, like foreman, katello or luna | ||
# TODO: choices: foreman/katello/luna |
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,3 @@ | ||
- import_playbook: 01-boxes.yml | ||
- import_playbook: 02-install.yml | ||
- import_playbook: 03-tests.yml |
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,18 @@ | ||
help: | | ||
Run an upgrade pipeline | ||
variables: | ||
forklift_state: | ||
parameter: --state | ||
help: Forklift state to ensure | ||
# TODO: up/rebuild/destroy | ||
pipeline_os: | ||
parameter: --os | ||
help: Operating system to install, like centos7, debian10 or ubuntu1804 | ||
pipeline_type: | ||
parameter: --type | ||
help: Type of pipeline, like foreman, katello or luna | ||
# TODO: choices: foreman/katello/luna | ||
pipeline_version: | ||
parameter: --version | ||
help: Version to install, like nightly, 1.24 or 3.14 | ||
|
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,12 @@ | ||
--- | ||
- import_playbook: 01-boxes.yml | ||
- import_playbook: 02-setup.yml | ||
- import_playbook: 03-install_server.yml | ||
- import_playbook: 04-install_proxy.yml | ||
- import_playbook: 05-server_to_intermediate.yml | ||
- import_playbook: 06-proxy_to_intermediate.yml | ||
- import_playbook: 07-server_to_final.yml | ||
- import_playbook: 08-tests.yml | ||
- import_playbook: 09-proxy_to_final.yml | ||
- import_playbook: 10-tests.yml | ||
- import_playbook: 11-smoker.yml |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,2 +1,4 @@ | ||
forklift_versions_file: "{{ lookup('env', 'PWD') }}/vagrant/config/versions.yaml" | ||
--- | ||
forklift_directory: "{{ playbook_dir | dirname }}" | ||
forklift_versions_file: "{{ forklift_directory }}/vagrant/config/versions.yaml" | ||
upgrade: False |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here as above, but it does look like you want to eventually have something here for that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently we only have a set of variables for those 3. That means we can enforce just the 3 options.