Skip to content

Commit

Permalink
improve readme
Browse files Browse the repository at this point in the history
  • Loading branch information
reschandreas committed Jan 21, 2024
1 parent 6530713 commit d6521d7
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 37 deletions.
4 changes: 2 additions & 2 deletions cli/classes/generated/definitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ class PlatformAction(BaseModel):
extra='forbid',
)
name: str = Field(..., description='The name of the action.', examples=['rust-exercise-jobs'])
file: Optional[str] = Field(None, description='The file of the platform action. Written in Python')
code: str = Field(..., description='The file of the platform action. Written in Python')
parameters: Optional[Parameters] = None
function: Optional[constr(pattern=r'^[a-zA-Z0-9._-]+$')] = Field(
'run', description='The function of the platform action.', examples=['run']
Expand All @@ -167,7 +167,7 @@ class PlatformAction(BaseModel):
title='Exclude during',
)
environment: Optional[Environment] = Field(None, description='Environment variables for this platform action.')
platform: Optional[Target] = Field(None, description='Ignored for this action.')
platform: Target = Field(..., description='Ignored for this action.')
kind: Optional[str] = Field(None, description='The kind of the platform action.', examples=['junit'])
docker: Optional[Docker] = Field(None, description='The docker configuration that is used to execute the action')
runAlways: Optional[bool] = Field(
Expand Down
10 changes: 6 additions & 4 deletions cli/classes/merger.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,11 +278,12 @@ def traverse_external_actions(
typing.List[Action],
]
] = None
if isinstance(action, (PlatformAction, FileAction)):
if isinstance(action, FileAction):
path = action.file
if isinstance(action, PlatformAction):
if path is None:
converted = ([name], [Action(root=action)])
elif isinstance(action, PlatformAction):
path = action.code
if path is None:
converted = ([name], [Action(root=action)])
elif isinstance(action, TemplateAction):
path = action.use
if path:
Expand All @@ -309,6 +310,7 @@ def traverse_external_actions(
logger.error("❌", f"{exception}", self.output_settings.emoji)
if self.output_settings.debug:
traceback.print_exc()
return False
return True

def inline_actions(
Expand Down
26 changes: 6 additions & 20 deletions cli/examples/example-windfile-readme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,15 @@ metadata:
docker:
image: ls1tum/artemis-maven-template
tag: java17-20
volumes:
- ${WORKDIR}:/aeolus
gitCredentials: artemis_gitlab_admin_credentials
repositories:
aeolus:
url: https://github.com/ls1intum/Aeolus.git
branch: develop
path: aeolus
actions:
- name: set-java-container
script: set
- name: set-c-container
docker:
image: ghcr.io/ls1intum/artemis-c-docker
script: set
- name: internal-action
script: |
echo "This is an internal action"
- name: external-action
use: simple-action.yml
excludeDuring:
- working_time
- name: clean_up
script: |
rm -rf aeolus/
runAlways: true
- name: script-action
script: echo "I am a script action"
- name: template-action
use: https://github.com/reschandreas/example-action.git
parameters:
WHO_TO_GREET: "hello"
3 changes: 2 additions & 1 deletion cli/examples/windfiles/windfile-with-platform-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ metadata:
author: Andreas Resch
actions:
- name: hello-world
use: ../actions/platform-action.yml
platform: bamboo
code: install-api.py
14 changes: 4 additions & 10 deletions schemas/v0.0.1/schemas/definitions.json
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@
"rust-exercise-jobs"
]
},
"file": {
"code": {
"description": "The file of the platform action. Written in Python",
"type": "string"
},
Expand Down Expand Up @@ -265,15 +265,9 @@
}
},
"required": [
"name"
],
"oneOff": [
{
"required": [
"for",
"file"
]
}
"code",
"name",
"platform"
]
},
"file-action": {
Expand Down

0 comments on commit d6521d7

Please sign in to comment.