Skip to content
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

Move workflows into workflows sub-directory #531

Merged
merged 2 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/create-ocp-project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
push:
branches: [ "main" ]
paths:
- 'create-ocp-project/**'
- 'workflows/create-ocp-project/**'
- 'pipeline/**'
- .github/workflows/create-ocp-project.yaml
- .github/workflows/main.yml
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/escalation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
push:
branches: [ "main" ]
paths:
- 'escalation/**'
- 'workflows/escalation/**'
- 'pipeline/**'
- 'scripts/**'
- .github/workflows/escalation.yml
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/extendable-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
push:
branches: [ "main" ]
paths:
- 'extendable-workflow/**'
- 'workflows/extendable-workflow/**'
- 'pipeline/**'
- .github/workflows/extendable-workflow.yml
- .github/workflows/main.yml
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/greeting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
push:
branches: [ "main" ]
paths:
- 'greeting/**'
- 'workflows/greeting/**'
- 'pipeline/**'
- .github/workflows/greeting.yml
- .github/workflows/main.yml
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/jira-listener.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
push:
branches: [ "main" ]
paths:
- 'escalation/jira-listener/**'
- 'workflows/escalation/jira-listener/**'
- 'pipeline/**'
- 'scripts/**'
- .github/workflows/jira-listener.yml
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/m2k-func.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
default: false

env:
WORKDIR: move2kube/m2k-func
WORKDIR: workflows/move2kube/m2k-func
MVN_OPTS: ""
WF_CONFIG_REPO: parodos-dev/serverless-workflows-config
REGISTRY_REPO: orchestrator
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ jobs:
APPLICATION_ID=${{ inputs.application_id }} \
PR_OR_COMMIT_URL=${PR_OR_COMMIT_URL} \
gen-manifests
echo manifests_dir=${{ runner.temp }}/serverless-workflows/${{ inputs.workflow_id }}/manifests >> "$GITHUB_OUTPUT"
echo manifests_dir=${{ runner.temp }}/serverless-workflows/workflows/${{ inputs.workflow_id }}/manifests >> "$GITHUB_OUTPUT"

- name: Archive manifests
uses: actions/upload-artifact@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/modify-vm-resources.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
push:
branches: [ "main" ]
paths:
- 'modify-vm-resources/**'
- 'workflows/modify-vm-resources/**'
- 'pipeline/**'
- .github/workflows/modify-vm-resources.yaml
- .github/workflows/main.yml
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/move2kube-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
branches:
- main
paths:
- 'move2kube/**'
- 'workflows/move2kube/**'
- 'pipeline/**'
- .github/workflows/move2kube-e2e.yaml
- .github/workflows/m2k-func.yaml
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/move2kube.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
push:
branches: [ "main" ]
paths:
- 'move2kube/**'
- 'workflows/move2kube/**'
- 'pipeline/**'
- 'e2e/move2kube.sh'
- .github/workflows/move2kube-e2e.yaml
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/mta-v7.x-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ on:
branches:
- main
paths:
- 'mta-v7.x/**'
- 'workflows/mta-v7.x/**'
- 'pipeline/**'
- '!e2e/mta-v7.x.sh'
- '!mta-v7.x/*.svg'
- '!workflows/mta-v7.x/*.svg'
- .github/workflows/mta-v7.x-e2e.yaml
- .github/workflows/main.yml

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mta-v7.x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
push:
branches: [ "main" ]
paths:
- 'mta-v7.x/**'
- 'workflows/mta-v7.x/**'
- 'pipeline/**'
- .github/workflows/mta-v7.x.yml
- .github/workflows/main.yml
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mtv-migration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
push:
branches: ["main"]
paths:
- "mtv-migration/**"
- "workflows/mtv-migration/**"
- "pipeline/**"
- .github/workflows/mtv-migration.yml
- .github/workflows/main.yml
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mtv-plan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
push:
branches: ["main"]
paths:
- "mtv-plan/**"
- "workflows/mtv-plan/**"
- "pipeline/**"
- .github/workflows/mtv-plan.yml
- .github/workflows/main.yml
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/request-vm-cnv.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
push:
branches: [ "main" ]
paths:
- 'request-vm-cnv/**'
- 'workflows/request-vm-cnv/**'
- 'pipeline/**'
- .github/workflows/request-vm-cnv.yaml
- .github/workflows/main.yml
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rpj.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
push:
branches: ["main"]
paths:
- "rpj/**"
- "workflows/rpj/**"
- "pipeline/**"
- .github/workflows/rpj.yml
- .github/workflows/main.yml
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Serverless workflows generated files
*/manifests/
workflows/*/manifests/

#Maven
target/
**/target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
Expand Down
8 changes: 4 additions & 4 deletions .tekton/m2k-func-pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ metadata:
build.appstudio.redhat.com/target_branch: '{{target_branch}}'
pipelinesascode.tekton.dev/max-keep-runs: "3"
pipelinesascode.tekton.dev/on-cel-expression: event == "pull_request" && target_branch
== "main" && ( "move2kube/m2k-func/***".pathChanged() || ".tekton/m2k-func-pull-request.yaml".pathChanged()
== "main" && ( "workflows/move2kube/m2k-func/***".pathChanged() || ".tekton/m2k-func-pull-request.yaml".pathChanged()
)
creationTimestamp: null
labels:
Expand All @@ -28,11 +28,11 @@ spec:
- name: image-expires-after
value: 5d
- name: dockerfile
value: move2kube/m2k-func/src/main/docker/Dockerfile.jvm
value: workflows/move2kube/m2k-func/src/main/docker/Dockerfile.jvm
- name: path-context
value: move2kube/m2k-func
value: workflows/move2kube/m2k-func
- name: build-args-file
value: move2kube/m2k-func/argfile.conf
value: workflows/move2kube/m2k-func/argfile.conf
pipelineSpec:
finally:
- name: show-sbom
Expand Down
4 changes: 2 additions & 2 deletions .tekton/m2k-func-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ spec:
- name: output-image
value: quay.io/redhat-user-workloads/orchestrator-releng-tenant/serverless-workflows/m2k-func:{{revision}}
- name: dockerfile
value: move2kube/m2k-func/src/main/docker/Dockerfile.jvm
value: workflows/move2kube/m2k-func/src/main/docker/Dockerfile.jvm
- name: path-context
value: move2kube/m2k-func
- name: build-args-file
value: move2kube/m2k-func/argfile.conf
value: workflows/move2kube/m2k-func/argfile.conf
pipelineSpec:
finally:
- name: show-sbom
Expand Down
8 changes: 4 additions & 4 deletions .tekton/move2kube-serverless-workflow-pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
build.appstudio.redhat.com/pull_request_number: '{{pull_request_number}}'
build.appstudio.redhat.com/target_branch: '{{target_branch}}'
pipelinesascode.tekton.dev/max-keep-runs: "3"
pipelinesascode.tekton.dev/on-cel-expression: event == "pull_request" && target_branch == "main" && ( "move2kube/***".pathChanged() || ".tekton/move2kube-serverless-workflow-pull-request.yaml".pathChanged() || "pipeline/workflow-builder.Dockerfile".pathChanged() )
pipelinesascode.tekton.dev/on-cel-expression: event == "pull_request" && target_branch == "main" && ( "workflows/move2kube/***".pathChanged() || ".tekton/move2kube-serverless-workflow-pull-request.yaml".pathChanged() || "pipeline/workflow-builder.Dockerfile".pathChanged() )
creationTimestamp: null
labels:
appstudio.openshift.io/application: serverless-workflows
Expand All @@ -26,13 +26,13 @@ spec:
- name: output-image
value: quay.io/redhat-user-workloads/orchestrator-releng-tenant/serverless-workflows/move2kube-serverless-workflow:on-pr-{{revision}}
- name: path-context
value: move2kube
value: workflows/move2kube
- name: revision
value: '{{revision}}'
- name: build-source-image
value: "true"
- name: build-args-file
value: move2kube/argfile.conf
value: workflows/move2kube/argfile.conf
pipelineSpec:
finally:
- name: show-sbom
Expand Down Expand Up @@ -234,7 +234,7 @@ spec:
value: task
resolver: bundles
params:
- name: workflowId
- name: workflowDirectoryPath
value: $(params.path-context)
- name: SOURCE_ARTIFACT
value: $(tasks.clone-repository.results.SOURCE_ARTIFACT)
Expand Down
6 changes: 3 additions & 3 deletions .tekton/move2kube-serverless-workflow-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ spec:
- name: output-image
value: quay.io/redhat-user-workloads/orchestrator-releng-tenant/serverless-workflows/move2kube-serverless-workflow:{{revision}}
- name: path-context
value: move2kube
value: workflows/move2kube
- name: revision
value: '{{revision}}'
- name: build-source-image
value: "true"
- name: build-args-file
value: move2kube/argfile.conf
value: workflows/move2kube/argfile.conf
pipelineSpec:
finally:
- name: show-sbom
Expand Down Expand Up @@ -231,7 +231,7 @@ spec:
value: task
resolver: bundles
params:
- name: workflowId
- name: workflowDirectoryPath
value: $(params.path-context)
- name: SOURCE_ARTIFACT
value: $(tasks.clone-repository.results.SOURCE_ARTIFACT)
Expand Down
8 changes: 4 additions & 4 deletions .tekton/mta-serverless-workflow-pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
build.appstudio.redhat.com/pull_request_number: '{{pull_request_number}}'
build.appstudio.redhat.com/target_branch: '{{target_branch}}'
pipelinesascode.tekton.dev/max-keep-runs: "3"
pipelinesascode.tekton.dev/on-cel-expression: event == "pull_request" && target_branch == "main" && ( "mta-v7.x/***".pathChanged() || ".tekton/mta-serverless-workflow-pull-request.yaml".pathChanged() || "pipeline/workflow-builder.Dockerfile".pathChanged() )
pipelinesascode.tekton.dev/on-cel-expression: event == "pull_request" && target_branch == "main" && ( "workflows/mta-v7.x/***".pathChanged() || ".tekton/mta-serverless-workflow-pull-request.yaml".pathChanged() || "pipeline/workflow-builder.Dockerfile".pathChanged() )
creationTimestamp: null
labels:
appstudio.openshift.io/application: serverless-workflows
Expand All @@ -26,13 +26,13 @@ spec:
- name: output-image
value: quay.io/redhat-user-workloads/orchestrator-releng-tenant/serverless-workflows/mta-serverless-workflow:on-pr-{{revision}}
- name: path-context
value: mta-v7.x
value: workflows/mta-v7.x
- name: revision
value: '{{revision}}'
- name: build-source-image
value: "true"
- name: build-args-file
value: mta-v7.x/argfile.conf
value: workflows/mta-v7.x/argfile.conf
pipelineSpec:
finally:
- name: show-sbom
Expand Down Expand Up @@ -234,7 +234,7 @@ spec:
value: task
resolver: bundles
params:
- name: workflowId
- name: workflowDirectoryPath
value: $(params.path-context)
- name: SOURCE_ARTIFACT
value: $(tasks.clone-repository.results.SOURCE_ARTIFACT)
Expand Down
6 changes: 3 additions & 3 deletions .tekton/mta-serverless-workflow-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ spec:
- name: output-image
value: quay.io/redhat-user-workloads/orchestrator-releng-tenant/serverless-workflows/mta-serverless-workflow:{{revision}}
- name: path-context
value: mta-v7.x
value: workflows/mta-v7.x
- name: revision
value: '{{revision}}'
- name: build-source-image
value: "true"
- name: build-args-file
value: mta-v7.x/argfile.conf
value: workflows/mta-v7.x/argfile.conf
pipelineSpec:
finally:
- name: show-sbom
Expand Down Expand Up @@ -231,7 +231,7 @@ spec:
value: task
resolver: bundles
params:
- name: workflowId
- name: workflowDirectoryPath
value: $(params.path-context)
- name: SOURCE_ARTIFACT
value: $(tasks.clone-repository.results.SOURCE_ARTIFACT)
Expand Down
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ prepare-workdir:
@rm -rf $(WORKDIR)
@mkdir -p $(WORKDIR)
@cp -R . $(WORKDIR)
@cp -R $(WORKDIR)/shared $(WORKDIR)/$(WORKFLOW_ID)/shared
@cp -R $(WORKDIR)/workflows/shared $(WORKDIR)/workflows/$(WORKFLOW_ID)/shared
@find $(WORKDIR) -type d -name target -prune -exec rm -rf {} \;


Expand All @@ -117,7 +117,7 @@ prepare-workdir:
# Depends on: prepare-workdir target.
# Usage: make build-image
ifeq ($(IS_WORKFLOW),true)
build-image: BUILD_ARGS=--build-arg-file=$(WORKFLOW_ID)/argfile.conf --build-arg=BUILDER_IMAGE=$(BUILDER_IMAGE) --build-arg WF_RESOURCES=$(WORKFLOW_ID)
build-image: BUILD_ARGS=--build-arg-file=workflows/$(WORKFLOW_ID)/argfile.conf --build-arg=BUILDER_IMAGE=$(BUILDER_IMAGE) --build-arg WF_RESOURCES=workflows/$(WORKFLOW_ID)
endif
build-image: EXTRA_ARGS=--ulimit nofile=4096:4096
build-image: prepare-workdir
Expand All @@ -126,7 +126,7 @@ ifeq ($(IS_APPLICATION),true)
# First build the application
$(BUILD_APPLICATION_SCRIPT) $(CONTAINER_ENGINE) $(WORKDIR) $(WORKFLOW_ID) $(APPLICATION_ID) $(JDK_IMAGE) $(MVN_OPTS)
# Then build the containerized image from the application source
@cd $(WORKDIR)/$(WORKFLOW_ID)/$(APPLICATION_ID) && $(CONTAINER_ENGINE) build -f $(DOCKERFILE) \
@cd $(WORKDIR)/workflows/$(WORKFLOW_ID)/$(APPLICATION_ID) && $(CONTAINER_ENGINE) build -f $(DOCKERFILE) \
$(BUILD_ARGS) $(EXTRA_ARGS) \
--tag ${IMAGE_NAME}:${IMAGE_TAG} --tag ${IMAGE_NAME}:latest .
else
Expand Down Expand Up @@ -167,9 +167,9 @@ save-oci: build-image
# Usage: make gen-manifests
gen-manifests: prepare-workdir
cd $(WORKDIR)
@$(CONTAINER_ENGINE) run --rm -v $(WORKDIR):/workdir:Z -w /workdir \
$(LINUX_IMAGE) /bin/bash -c "ENABLE_PERSISTENCE=$(ENABLE_PERSISTENCE) WORKFLOW_IMAGE_TAG=$(IMAGE_TAG) ${SCRIPTS_DIR}/gen_manifests.sh $(WORKFLOW_ID)"
@echo "Manifests are available in workdir $(WORKDIR)/$(WORKFLOW_ID)/manifests"
$(CONTAINER_ENGINE) run --rm -v $(WORKDIR):/workdir:Z -w /workdir \
$(LINUX_IMAGE) /bin/bash -c "ENABLE_PERSISTENCE=$(ENABLE_PERSISTENCE) WORKFLOW_IMAGE_TAG=$(IMAGE_TAG) ${SCRIPTS_DIR}/gen_manifests.sh workflows/$(WORKFLOW_ID)"
@echo "Manifests are available in workdir $(WORKDIR)/workflows/$(WORKFLOW_ID)/manifests"

remove-trailing-whitespaces:
@echo "Removing all trailing whitespaces from application.properties files"
Expand Down
4 changes: 2 additions & 2 deletions konflux/custom-tasks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Tu build an image based on the task:
1. Install tekton ci: https://tekton.dev/docs/cli/
1. Create the repository in which the image should be pushed
1. Run `
kn bundle push quay.io/orchestrator/replace-me:replace-me -f .tekton/tasks/replace-me.yaml
tkn bundle push quay.io/orchestrator/konflux-task-copy-ta:vXXX -f konflux/custom-tasks/copy-task.yaml
`
1. Update [the task policy data](../policy-data/task-bundles.yaml.yaml) in order for the task to be updated (see [Entreprise Contract doc about trusting custom task](https://enterprisecontract.dev/docs/ec-policies/trusting_tasks.html#_adding_a_custom_task_to_the_trusted_task_list))

1. Once merged, create a MR to update https://gitlab.cee.redhat.com/releng/konflux-release-data/-/blob/main/config/stone-prd-rh01.pg1f.p1/product/EnterpriseContractPolicy/registry-orchestrator-releng-serverless-workflows.yaml#L28 with the new sha pointing to the version to use
See [how konflux-ci are building their task](https://github.com/konflux-ci/build-definitions/blob/main/hack/build-and-push.sh).
11 changes: 6 additions & 5 deletions konflux/custom-tasks/copy-task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ spec:
- name: ociStorage
description: The OCI repository where the Trusted Artifacts are stored.
type: string
- name: workflowId
description: The workflow ID from the repository
- name: workflowDirectoryPath
description: The workflow directory path from the repository
type: string
results:
- name: SOURCE_ARTIFACT
Expand All @@ -44,9 +44,10 @@ spec:
workingDir: /var/workdir/
script: |
ls -al
cp -R source/shared source/$(params.workflowId)/shared
cp source/LICENSE source/$(params.workflowId)/LICENSE
ls -al source/$(params.workflowId)
ls -al source
cp -R source/workflows/shared source/$(params.workflowDirectoryPath)/shared
cp source/LICENSE source/$(params.workflowDirectoryPath)/LICENSE
ls -al source/$(params.workflowDirectoryPath)
- name: create-trusted-artifact
image: quay.io/redhat-appstudio/build-trusted-artifacts:latest@sha256:81c4864dae6bb11595f657be887e205262e70086a05ed16ada827fd6391926ac
args:
Expand Down
Loading
Loading