diff --git a/README.md b/README.md index ae1304c5dc..ba97869015 100644 --- a/README.md +++ b/README.md @@ -2,34 +2,36 @@ This repository contains components that are installed or managed by the managed CI and Build Team. -This includes default Pipelines and Tasks. You need to have bootstrapped a working appstudio configuration from (see `https://github.com/redhat-appstudio/infra-deployments`) for the dev of pipelines or new tasks. +This includes default Pipelines and Tasks. You need to have bootstrapped a working appstudio configuration from (see `https://github.com/redhat-appstudio/infra-deployments`) for the dev of pipelines or new tasks. Pipelines are delivered into App Studio via `quay.io/redhat-appstudio/build-templates-bundle:v0.1.3` (the tag will be updated every change) -Tasks are delivered into App Studio via Cluster tasks installedfrom `https://github.com/redhat-appstudio/infra-deployments/blob/main/components/build/clustertasks` -App Studio specific cluster tasks will be found in this repository. Currently a set of utilties are bundled with App Studio in `quay.io/redhat-appstudio/appstudio-utils:v0.1.3` as a convenience but tasks may be run from different per-task containers in future. +Tasks are delivered into App Studio via `quay.io/redhat-appstudio/appstudio-tasks`. Where each task is bundled and pushed into tag in format `${TASK_NAME}-${VERSION}` where version is the same as pipelines bundle version. -## Devmode for Pipelines +Currently a set of utilties are bundled with App Studio in `quay.io/redhat-appstudio/appstudio-utils:v0.1.3` as a convenience but tasks may be run from different per-task containers in future. -The pipelines can be found in the `pipelines` directories. +## Devmode -Once your configuration is set you can modify pipelines installed via this repository in two ways. +Script `dev.sh` creates bundles for pipelines, each task and create appstudio-utils image. Images are pushed into your quay.io repository. You will need to set `MY_QUAY_USER` to use this feature and be logged into quay.io on your workstation. +Once you run the `dev.sh` all pipelines will come from your bundle instead of from the default installed by gitops into the cluster. -### Override mode. -Every time you run `dev-mode.sh`, it will take the current directory and package into a bundle into your own quay.io repository. You will need to set `MY_QUAY_USER` to use this feature and be logged into quay.io on your workstation. -Once you run the `dev-mode.sh` all pipelines will come from your bundle instead of from the default installed by gitops into the cluster. -### Gitops Mode -Replace the file `https://github.com/redhat-appstudio/infra-deployments/blob/main/components/build/build-templates/bundle-config.yaml` in your own fork (dev mode). This will sync to the cluster and all builds-definitions will come from the bundle you configure. +### Pipelines -Please test in _gitops mode_ when doing a new release into staging as it will be the best way to ensure that the deployment will function correctly when deployed via gitops. +The pipelines can be found in the `pipelines` directories. -Releasing new bundles are currently manual. (TODO, CI will automatically publish updates `infra-deployments`) via a SHA/pull request. +#### Gitops Mode -## Devmode for Tasks +Replace the file `https://github.com/redhat-appstudio/infra-deployments/blob/main/components/build/build-templates/bundle-config.yaml` in your own fork (dev mode). This will sync to the cluster and all builds-definitions will come from the bundle you configure. -The tasks can be found in the `tasks` directories. Replacing tasks in App Studio is more complex as we will currently deliver tasks as ClusterTasks. See `https://github.com/redhat-appstudio/infra-deployments/blob/main/components/build/` to install new app studio cluster tasks via the gitops delivery mode. -For quick local innerloop style task development, you may install new Tasks in your local namespace manually and create your pipelines as well as the base task image to test new function. This is a manual process which requires you create Tasks and use in your namespace. This may be faster but requires you to later change the task type to ClusterTask and release in the infra deployment directory. +Please test in _gitops mode_ when doing a new release into staging as it will be the best way to ensure that the deployment will function correctly when deployed via gitops. -There is a container which is used to support multiple set of tasks called `quay.io/redhat-appstudio/appstudio-utils:v0.1.3` , which is a single container which is used by multiple tasks. Tasks may also be in their own container as well however many simple tasks are utiltities and will be packaged for app studio in a single container. Tasks can rely on other tasks in the system which are co-packed in a container allowing combined tasks (build-only vs build-deploy) which use the same core implementations. +### Tasks +The tasks can be found in the `tasks` directories. Tasks are bundled and used by bundled pipelines. Tasks are not stored in the Cluster. +For quick local innerloop style task development, you may install new Tasks in your local namespace manually and create your pipelines as well as the base task image to test new function. Tasks can be installed into local namespace using `oc apply -k tasks/appstudio-utils/util-tasks`. +There is a container which is used to support multiple set of tasks called `quay.io/redhat-appstudio/appstudio-utils:v0.1.3` , which is a single container which is used by multiple tasks. Tasks may also be in their own container as well however many simple tasks are utilities and will be packaged for app studio in a single container. Tasks can rely on other tasks in the system which are co-packed in a container allowing combined tasks (build-only vs build-deploy) which use the same core implementations. + +## Release + +Prerequisite for new release is creation of tag or release in GitHub repository. After that pull changes and execute `./release.sh $TAG` where `TAG` must match with git tag of current branch. diff --git a/dev.sh b/dev.sh index 1a2eff7c60..0e65548048 100755 --- a/dev.sh +++ b/dev.sh @@ -1,2 +1,18 @@ -./pipelines/dev-build.sh -(cd ./tasks/appstudio-utils; ./dev-build.sh) \ No newline at end of file +#!/bin/bash + +export BUILD_TAG=$1 + +if [ -z "$MY_QUAY_USER" ]; then + echo "MY_QUAY_USER environment variable must be set" + exit 1 +fi +if [ "$MY_QUAY_USER" = "redhat-appstudio" ]; then + echo "Cannot use devmode as redhat-appstudio user " + exit 1 +fi +if [ -z "$BUILD_TAG" ]; then + export BUILD_TAG=$(date +"%Y-%m-%d-%H%M%S") +fi + +./tasks/appstudio-utils/dev-build.sh +./pipelines/dev-build.sh diff --git a/pipelines/README.md b/pipelines/README.md index f4af01bc03..a330365ad7 100644 --- a/pipelines/README.md +++ b/pipelines/README.md @@ -1,11 +1,3 @@ # build-definitions This directory the OCI bundle with default pipelines installed for build-definitions. - -Update `pipelines/release-build.sh` to set the release tag to a specific version. - -Currently set manually (v0.1, v0.1.1), but when integrated into a CI, will shift to use git commit SHA. - -This has to be updated on the infra-deployment cluster when the version is updated. - - diff --git a/pipelines/build-templates-bundle/devfile-build.yaml b/pipelines/build-templates-bundle/devfile-build.yaml old mode 100755 new mode 100644 index 885af5bfac..1fc271e8ac --- a/pipelines/build-templates-bundle/devfile-build.yaml +++ b/pipelines/build-templates-bundle/devfile-build.yaml @@ -1,11 +1,11 @@ apiVersion: tekton.dev/v1beta1 kind: Pipeline metadata: - name: devfile-build + name: devfile-build labels: "pipelines.openshift.io/used-by" : "build-cloud" "pipelines.openshift.io/runtime" : "generic" - "pipelines.openshift.io/strategy" : "docker" + "pipelines.openshift.io/strategy" : "docker" spec: params: - description: 'Source Repository URL' @@ -19,7 +19,7 @@ spec: name: output-image type: string - description: The path to your source code - name: path-context + name: path-context type: string default: . - description: Path to the Dockerfile @@ -28,19 +28,19 @@ spec: default: Dockerfile tasks: - name: appstudio-init - params: - - name: image-url + params: + - name: image-url value: "$(params.output-image)" taskRef: - kind: ClusterTask - name: appstudio-init + bundle: ${CONTAINER_REPO}/appstudio-tasks:init-${TAG} + name: init workspaces: - name: source - workspace: workspace + workspace: workspace - name: registry-auth - workspace: registry-auth - - name: git-auth - workspace: git-auth + workspace: registry-auth + - name: git-auth + workspace: git-auth - name: clone-repository runAfter: - appstudio-init @@ -59,28 +59,28 @@ spec: runAfter: - clone-repository taskRef: - kind: ClusterTask + bundle: ${CONTAINER_REPO}/appstudio-tasks:analyze-devfile-${TAG} name: analyze-devfile workspaces: - name: source workspace: workspace - name: appstudio-configure-build runAfter: - - analyze-devfile + - analyze-devfile when: - - input: $(tasks.appstudio-init.results.exists) + - input: $(tasks.appstudio-init.results.exists) operator: in - values: ["false"] + values: ["false"] taskRef: - kind: ClusterTask - name: appstudio-configure-build + bundle: ${CONTAINER_REPO}/appstudio-tasks:configure-build-${TAG} + name: configure-build workspaces: - name: source - workspace: workspace + workspace: workspace - name: registry-auth - workspace: registry-auth - - name: git-auth - workspace: git-auth + workspace: registry-auth + - name: git-auth + workspace: git-auth - name: build-container params: - name: IMAGE @@ -103,51 +103,51 @@ spec: value: "$(tasks.appstudio-configure-build.results.buildah-auth-param)" - name: PUSH_EXTRA_ARGS value: "$(tasks.appstudio-configure-build.results.buildah-auth-param)" - runAfter: + runAfter: - appstudio-configure-build taskRef: kind: ClusterTask name: buildah workspaces: - name: source - workspace: workspace + workspace: workspace - name: show-summary runAfter: - - build-container + - build-container taskRef: - kind: ClusterTask - name: appstudio-summary - params: + bundle: ${CONTAINER_REPO}/appstudio-tasks:summary-${TAG} + name: summary + params: - name: pipeline-run-name value: "$(context.pipelineRun.name)" - name: git-url value: "$(params.git-url)" - name: image-url - value: $(params.output-image) + value: $(params.output-image) - name: deploy-yaml - value: $(tasks.analyze-devfile.results.deploy) - - name: skip-rebuild-summary + value: $(tasks.analyze-devfile.results.deploy) + - name: skip-rebuild-summary when: - - input: $(tasks.appstudio-init.results.exists) + - input: $(tasks.appstudio-init.results.exists) operator: in - values: ["true"] + values: ["true"] runAfter: - analyze-devfile taskRef: - kind: ClusterTask - name: appstudio-summary - params: + bundle: ${CONTAINER_REPO}/appstudio-tasks:summary-${TAG} + name: summary + params: - name: pipeline-run-name value: "$(context.pipelineRun.name)" - name: git-url value: "$(params.git-url)" - name: image-url - value: $(params.output-image) + value: $(params.output-image) - name: deploy-yaml value: $(tasks.analyze-devfile.results.deploy) workspaces: - name: workspace - name: registry-auth optional: true - - name: git-auth - optional: true \ No newline at end of file + - name: git-auth + optional: true diff --git a/pipelines/build-templates-bundle/docker-build.yaml b/pipelines/build-templates-bundle/docker-build.yaml old mode 100755 new mode 100644 index 986138400a..343ca9ab5a --- a/pipelines/build-templates-bundle/docker-build.yaml +++ b/pipelines/build-templates-bundle/docker-build.yaml @@ -32,8 +32,8 @@ spec: - name: image-url value: "$(params.output-image)" taskRef: - kind: ClusterTask - name: appstudio-init + bundle: ${CONTAINER_REPO}/appstudio-tasks:init-${TAG} + name: init workspaces: - name: source workspace: workspace @@ -67,8 +67,8 @@ spec: operator: in values: ["false"] taskRef: - kind: ClusterTask - name: appstudio-configure-build + bundle: ${CONTAINER_REPO}/appstudio-tasks:configure-build-${TAG} + name: configure-build workspaces: - name: source workspace: workspace @@ -110,8 +110,8 @@ spec: runAfter: - build-container taskRef: - kind: ClusterTask - name: appstudio-summary + bundle: ${CONTAINER_REPO}/appstudio-tasks:summary-${TAG} + name: summary params: - name: pipeline-run-name value: "$(context.pipelineRun.name)" @@ -127,8 +127,8 @@ spec: runAfter: - appstudio-init taskRef: - kind: ClusterTask - name: appstudio-summary + bundle: ${CONTAINER_REPO}/appstudio-tasks:summary-${TAG} + name: summary params: - name: pipeline-run-name value: "$(context.pipelineRun.name)" @@ -141,4 +141,4 @@ spec: - name: registry-auth optional: true - name: git-auth - optional: true \ No newline at end of file + optional: true diff --git a/pipelines/build-templates-bundle/java-builder.yaml b/pipelines/build-templates-bundle/java-builder.yaml index 3f54986041..5929deb3bd 100644 --- a/pipelines/build-templates-bundle/java-builder.yaml +++ b/pipelines/build-templates-bundle/java-builder.yaml @@ -38,8 +38,8 @@ spec: - name: image-url value: "$(params.output-image)" taskRef: - kind: ClusterTask - name: appstudio-init + bundle: ${CONTAINER_REPO}/appstudio-tasks:init-${TAG} + name: init workspaces: - name: source workspace: workspace @@ -84,8 +84,8 @@ spec: runAfter: - git-clone taskRef: - kind: ClusterTask - name: appstudio-configure-build + bundle: ${CONTAINER_REPO}/appstudio-tasks:configure-build-${TAG} + name: configure-build workspaces: - name: source workspace: workspace @@ -120,8 +120,8 @@ spec: runAfter: - s2i-java taskRef: - kind: ClusterTask - name: appstudio-summary + bundle: ${CONTAINER_REPO}/appstudio-tasks:summary-${TAG} + name: summary params: - name: pipeline-run-name value: "$(context.pipelineRun.name)" @@ -137,8 +137,8 @@ spec: runAfter: - appstudio-init taskRef: - kind: ClusterTask - name: appstudio-summary + bundle: ${CONTAINER_REPO}/appstudio-tasks:summary-${TAG} + name: summary params: - name: pipeline-run-name value: "$(context.pipelineRun.name)" @@ -151,4 +151,4 @@ spec: - name: registry-auth optional: true - name: git-auth - optional: true \ No newline at end of file + optional: true diff --git a/pipelines/build-templates-bundle/nodejs-builder.yaml b/pipelines/build-templates-bundle/nodejs-builder.yaml index b675a7c67c..9e3520f897 100644 --- a/pipelines/build-templates-bundle/nodejs-builder.yaml +++ b/pipelines/build-templates-bundle/nodejs-builder.yaml @@ -61,8 +61,8 @@ spec: - name: image-url value: "$(params.output-image)" taskRef: - kind: ClusterTask - name: appstudio-init + bundle: ${CONTAINER_REPO}/appstudio-tasks:init-${TAG} + name: init workspaces: - name: source workspace: workspace @@ -74,8 +74,8 @@ spec: runAfter: - git-clone taskRef: - kind: ClusterTask - name: appstudio-configure-build + bundle: ${CONTAINER_REPO}/appstudio-tasks:configure-build-${TAG} + name: configure-build workspaces: - name: source workspace: workspace @@ -141,8 +141,8 @@ spec: runAfter: - s2i-nodejs taskRef: - kind: ClusterTask - name: appstudio-summary + bundle: ${CONTAINER_REPO}/appstudio-tasks:summary-${TAG} + name: summary params: - name: pipeline-run-name value: "$(context.pipelineRun.name)" @@ -158,8 +158,8 @@ spec: runAfter: - appstudio-init taskRef: - kind: ClusterTask - name: appstudio-summary + bundle: ${CONTAINER_REPO}/appstudio-tasks:summary-${TAG} + name: summary params: - name: pipeline-run-name value: "$(context.pipelineRun.name)" @@ -172,4 +172,4 @@ spec: - name: registry-auth optional: true - name: git-auth - optional: true \ No newline at end of file + optional: true diff --git a/pipelines/build-templates-bundle/noop.yaml b/pipelines/build-templates-bundle/noop.yaml old mode 100755 new mode 100644 diff --git a/pipelines/build-templates-bundle/prototype-build-compliance.yaml b/pipelines/build-templates-bundle/prototype-build-compliance.yaml old mode 100755 new mode 100644 index 8419b5edec..b4342618f0 --- a/pipelines/build-templates-bundle/prototype-build-compliance.yaml +++ b/pipelines/build-templates-bundle/prototype-build-compliance.yaml @@ -36,8 +36,8 @@ spec: - name: image-url value: "$(params.output-image)" taskRef: - kind: ClusterTask - name: appstudio-init + bundle: ${CONTAINER_REPO}/appstudio-tasks:init-${TAG} + name: init workspaces: - name: source workspace: workspace @@ -63,8 +63,8 @@ spec: runAfter: - source-clone-repository taskRef: - kind: ClusterTask - name: appstudio-configure-build + bundle: ${CONTAINER_REPO}/appstudio-tasks:configure-build-${TAG} + name: configure-build workspaces: - name: source workspace: workspace @@ -74,8 +74,8 @@ spec: workspace: git-auth - name: secret-detection-detect-secrets taskRef: - kind: ClusterTask - name: appstudio-utils + bundle: ${CONTAINER_REPO}/appstudio-tasks:utils-task-${TAG} + name: utils-task runAfter: - source-clone-repository params: @@ -85,8 +85,8 @@ spec: echo "This is a placeholder for secret-detection-detect-secrets" - name: policy-code-reviews-check taskRef: - kind: ClusterTask - name: appstudio-utils + bundle: ${CONTAINER_REPO}/appstudio-tasks:utils-task-${TAG} + name: utils-task runAfter: - setup-appstudio-init params: @@ -96,8 +96,8 @@ spec: echo "This is a placeholder for policy-code-reviews-check" - name: policy-branch-protection-check taskRef: - kind: ClusterTask - name: appstudio-utils + bundle: ${CONTAINER_REPO}/appstudio-tasks:utils-task-${TAG} + name: utils-task runAfter: - setup-appstudio-init params: @@ -107,8 +107,8 @@ spec: echo "This is a placeholder for policy-branch-protection-check" - name: build-placeholder-build-step taskRef: - kind: ClusterTask - name: appstudio-utils + bundle: ${CONTAINER_REPO}/appstudio-tasks:utils-task-${TAG} + name: utils-task runAfter: - build-appstudio-configure-build params: @@ -118,8 +118,8 @@ spec: echo "This is a placeholder for build-placeholder-build-step" - name: discovery-create-build-graph taskRef: - kind: ClusterTask - name: appstudio-utils + bundle: ${CONTAINER_REPO}/appstudio-tasks:utils-task-${TAG} + name: utils-task runAfter: - build-placeholder-build-step params: @@ -129,8 +129,8 @@ spec: echo "This is a placeholder for discovery-create-build-graph" - name: bill-of-materials-create-build-bom taskRef: - kind: ClusterTask - name: appstudio-utils + bundle: ${CONTAINER_REPO}/appstudio-tasks:utils-task-${TAG} + name: utils-task runAfter: - discovery-create-build-graph params: @@ -140,8 +140,8 @@ spec: echo "This is a placeholder for bill-of-materials-create-build-bom" - name: test-unit-test taskRef: - kind: ClusterTask - name: appstudio-utils + bundle: ${CONTAINER_REPO}/appstudio-tasks:utils-task-${TAG} + name: utils-task runAfter: - build-placeholder-build-step params: @@ -151,8 +151,8 @@ spec: echo "This is a placeholder for test-unit-test" - name: coverage-unit-test-coverage taskRef: - kind: ClusterTask - name: appstudio-utils + bundle: ${CONTAINER_REPO}/appstudio-tasks:utils-task-${TAG} + name: utils-task runAfter: - test-unit-test params: @@ -162,8 +162,8 @@ spec: echo "This is a placeholder for coverage-unit-test-coverage" - name: scan-lint taskRef: - kind: ClusterTask - name: appstudio-utils + bundle: ${CONTAINER_REPO}/appstudio-tasks:utils-task-${TAG} + name: utils-task runAfter: - build-placeholder-build-step params: @@ -173,8 +173,8 @@ spec: echo "This is a placeholder for scan-lint" - name: scan-dependency-vulnerability-scan taskRef: - kind: ClusterTask - name: appstudio-utils + bundle: ${CONTAINER_REPO}/appstudio-tasks:utils-task-${TAG} + name: utils-task runAfter: - bill-of-materials-create-build-bom params: @@ -184,8 +184,8 @@ spec: echo "This is a placeholder for scan-dependency-vulnerability-scan" - name: scan-static-security-test taskRef: - kind: ClusterTask - name: appstudio-utils + bundle: ${CONTAINER_REPO}/appstudio-tasks:utils-task-${TAG} + name: utils-task runAfter: - build-placeholder-build-step params: @@ -195,8 +195,8 @@ spec: echo "This is a placeholder for scan-static-security-test" - name: scan-code-smells taskRef: - kind: ClusterTask - name: appstudio-utils + bundle: ${CONTAINER_REPO}/appstudio-tasks:utils-task-${TAG} + name: utils-task runAfter: - build-placeholder-build-step params: @@ -206,8 +206,8 @@ spec: echo "This is a placeholder for scan-code-smells" - name: policy-provenance-check taskRef: - kind: ClusterTask - name: appstudio-utils + bundle: ${CONTAINER_REPO}/appstudio-tasks:utils-task-${TAG} + name: utils-task runAfter: - bill-of-materials-create-build-bom params: @@ -217,8 +217,8 @@ spec: echo "This is a placeholder for policy-provenance-check" - name: policy-cis-checks taskRef: - kind: ClusterTask - name: appstudio-utils + bundle: ${CONTAINER_REPO}/appstudio-tasks:utils-task-${TAG} + name: utils-task runAfter: - bill-of-materials-create-build-bom params: @@ -228,8 +228,8 @@ spec: echo "This is a placeholder for policy-cis-checks" - name: policy-license-check taskRef: - kind: ClusterTask - name: appstudio-utils + bundle: ${CONTAINER_REPO}/appstudio-tasks:utils-task-${TAG} + name: utils-task runAfter: - bill-of-materials-create-build-bom params: @@ -269,8 +269,8 @@ spec: workspace: workspace - name: discovery-create-output-graph taskRef: - kind: ClusterTask - name: appstudio-utils + bundle: ${CONTAINER_REPO}/appstudio-tasks:utils-task-${TAG} + name: utils-task runAfter: - package-build-container params: @@ -280,8 +280,8 @@ spec: echo "This is a placeholder for discovery-create-output-graph" - name: bill-of-materials-create-output-bom taskRef: - kind: ClusterTask - name: appstudio-utils + bundle: ${CONTAINER_REPO}/appstudio-tasks:utils-task-${TAG} + name: utils-task runAfter: - discovery-create-output-graph params: @@ -291,8 +291,8 @@ spec: echo "This is a placeholder for bill-of-materials-create-output-bom" - name: sign-artifacts-build taskRef: - kind: ClusterTask - name: appstudio-utils + bundle: ${CONTAINER_REPO}/appstudio-tasks:utils-task-${TAG} + name: utils-task runAfter: - bill-of-materials-create-output-bom params: @@ -302,8 +302,8 @@ spec: echo "This is a placeholder for sign-artifacts-build" - name: publish-push-to-quay taskRef: - kind: ClusterTask - name: appstudio-utils + bundle: ${CONTAINER_REPO}/appstudio-tasks:utils-task-${TAG} + name: utils-task runAfter: - sign-artifacts-build params: @@ -313,8 +313,8 @@ spec: echo "This is a placeholder for publish-push-to-quay" - name: scan-twistlock taskRef: - kind: ClusterTask - name: appstudio-utils + bundle: ${CONTAINER_REPO}/appstudio-tasks:utils-task-${TAG} + name: utils-task runAfter: - publish-push-to-quay params: @@ -324,8 +324,8 @@ spec: echo "This is a placeholder for scan-twistlock" - name: provision-provision-dev taskRef: - kind: ClusterTask - name: appstudio-utils + bundle: ${CONTAINER_REPO}/appstudio-tasks:utils-task-${TAG} + name: utils-task runAfter: - package-build-container params: @@ -335,8 +335,8 @@ spec: echo "This is a placeholder for provision-provision-dev" - name: deploy-deploy-in-dev taskRef: - kind: ClusterTask - name: appstudio-utils + bundle: ${CONTAINER_REPO}/appstudio-tasks:utils-task-${TAG} + name: utils-task runAfter: - publish-push-to-quay - provision-provision-dev @@ -347,8 +347,8 @@ spec: echo "This is a placeholder for deploy-deploy-in-dev" - name: verify-deployment-verify-dev-deployment taskRef: - kind: ClusterTask - name: appstudio-utils + bundle: ${CONTAINER_REPO}/appstudio-tasks:utils-task-${TAG} + name: utils-task runAfter: - deploy-deploy-in-dev params: @@ -358,8 +358,8 @@ spec: echo "This is a placeholder for verify-deployment-verify-dev-deployment" - name: test-acceptance-test taskRef: - kind: ClusterTask - name: appstudio-utils + bundle: ${CONTAINER_REPO}/appstudio-tasks:utils-task-${TAG} + name: utils-task runAfter: - verify-deployment-verify-dev-deployment params: @@ -369,8 +369,8 @@ spec: echo "This is a placeholder for test-acceptance-test" - name: scan-dynamic-security-test taskRef: - kind: ClusterTask - name: appstudio-utils + bundle: ${CONTAINER_REPO}/appstudio-tasks:utils-task-${TAG} + name: utils-task runAfter: - verify-deployment-verify-dev-deployment params: @@ -380,8 +380,8 @@ spec: echo "This is a placeholder for scan-dynamic-security-test" - name: cleanup-deprovision-dev taskRef: - kind: ClusterTask - name: appstudio-utils + bundle: ${CONTAINER_REPO}/appstudio-tasks:utils-task-${TAG} + name: utils-task runAfter: - scan-dynamic-security-test - scan-twistlock @@ -395,8 +395,8 @@ spec: runAfter: - cleanup-deprovision-dev taskRef: - kind: ClusterTask - name: appstudio-summary + bundle: ${CONTAINER_REPO}/appstudio-tasks:summary-${TAG} + name: summary params: - name: pipeline-run-name value: "$(context.pipelineRun.name)" @@ -412,8 +412,8 @@ spec: runAfter: - record-results-show-summary taskRef: - kind: ClusterTask - name: appstudio-utils + bundle: ${CONTAINER_REPO}/appstudio-tasks:utils-task-${TAG} + name: utils-task params: - name: SCRIPT value: | @@ -424,4 +424,4 @@ spec: - name: registry-auth optional: true - name: git-auth - optional: true \ No newline at end of file + optional: true diff --git a/pipelines/build-templates-bundle/tekton-bundle-build.yaml b/pipelines/build-templates-bundle/tekton-bundle-build.yaml old mode 100755 new mode 100644 index 10095f55e1..5a884c6651 --- a/pipelines/build-templates-bundle/tekton-bundle-build.yaml +++ b/pipelines/build-templates-bundle/tekton-bundle-build.yaml @@ -32,8 +32,8 @@ spec: - name: image-url value: "$(params.output-image)" taskRef: - kind: ClusterTask - name: appstudio-init + bundle: ${CONTAINER_REPO}/appstudio-tasks:init-${TAG} + name: init workspaces: - name: source workspace: workspace @@ -70,8 +70,8 @@ spec: runAfter: - clone-repository taskRef: - kind: ClusterTask - name: appstudio-tekton-bundle + bundle: ${CONTAINER_REPO}/appstudio-tasks:tekton-bundle-${TAG} + name: init workspaces: - name: source workspace: workspace @@ -81,8 +81,8 @@ spec: runAfter: - build-container taskRef: - kind: ClusterTask - name: appstudio-summary + bundle: ${CONTAINER_REPO}/appstudio-tasks:summary-${TAG} + name: summary params: - name: pipeline-run-name value: "$(context.pipelineRun.name)" @@ -98,8 +98,8 @@ spec: runAfter: - appstudio-init taskRef: - kind: ClusterTask - name: appstudio-summary + bundle: ${CONTAINER_REPO}/appstudio-tasks:summary-${TAG} + name: summary params: - name: pipeline-run-name value: "$(context.pipelineRun.name)" diff --git a/pipelines/dev-build.sh b/pipelines/dev-build.sh index 5a2d0bcb15..bf578c5840 100755 --- a/pipelines/dev-build.sh +++ b/pipelines/dev-build.sh @@ -11,10 +11,14 @@ if [ "$MY_QUAY_USER" = "redhat-appstudio" ]; then echo "Cannot use devmode as redhat-appstudio user " exit 1 fi -BUILD_TAG=$(date +"%Y-%m-%d-%H%M%S") -BUNDLE=quay.io/$MY_QUAY_USER/build-templates-bundle:v$BUILD_TAG +if [ -z "$BUILD_TAG" ]; then + echo "Set BUILD_TAG to use devmode" + exit 1 +fi + +BUNDLE=quay.io/$MY_QUAY_USER/build-templates-bundle:$BUILD_TAG # create a new bundle and install as default for this namespace $SCRIPTDIR/util-package-bundle.sh $BUNDLE $SCRIPTDIR/util-install-bundle.sh $BUNDLE - \ No newline at end of file + diff --git a/pipelines/release-build.sh b/pipelines/release-build.sh index 2fc171c65e..fa2fc4de24 100755 --- a/pipelines/release-build.sh +++ b/pipelines/release-build.sh @@ -2,7 +2,7 @@ SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" TEMPLATES=$SCRIPTDIR/build-templates-bundle -BUNDLE=quay.io/redhat-appstudio/build-templates-bundle:v0.1.3 +BUNDLE=quay.io/redhat-appstudio/build-templates-bundle:$BUILD_TAG # TODO for CI # IMAGE_FULL_TAG=$(git ls-remote $GITREPO HEAD) # IMAGE_SHORT_TAG=${IMAGE_FULL_TAG:position:7} @@ -16,3 +16,4 @@ else exit 1 fi $SCRIPTDIR/util-package-bundle.sh $BUNDLE +$SCRIPTDIR/util-install-bundle.sh $BUNDLE diff --git a/pipelines/util-package-bundle.sh b/pipelines/util-package-bundle.sh index c43baad0d2..7cf683e7d9 100755 --- a/pipelines/util-package-bundle.sh +++ b/pipelines/util-package-bundle.sh @@ -6,19 +6,21 @@ BUNDLE=$1 if [ -z "$BUNDLE" ]; then echo "No Bundle Name" exit 1 -fi +fi +export TAG=$(echo $BUNDLE | sed "s/^.*://") +export CONTAINER_REPO=$(dirname $BUNDLE) echo -echo "Package Templates from: $SCRIPTDIR/build-templates-bundle" +echo "Package Templates from: $TEMPLATES" echo "Building $BUNDLE" echo -PARAMS="" -for i in $TEMPLATES/*.yaml ; do - PARAMS="$PARAMS -f $i " -done +PARAMS="" +TMP_DIR=$(mktemp -d) +for file in $TEMPLATES/*.yaml; do + BASENAME=$(basename $file) + envsubst < $file > ${TMP_DIR}/$BASENAME + PARAMS="$PARAMS -f ${TMP_DIR}/$BASENAME " +done tkn bundle push $BUNDLE $PARAMS +rm -rf ${TPM_DIR} echo - - - - \ No newline at end of file diff --git a/release.sh b/release.sh new file mode 100755 index 0000000000..19f5070b3e --- /dev/null +++ b/release.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +export BUILD_TAG=$1 + +if [ -z "$BUILD_TAG" ]; then + echo "./release.sh BUILD_TAG" + echo "Pass BUILD_TAG, tag must match with pushed git tag" + exit 1 +fi + +CURRENT_HEAD_TAG=$(git describe --exact-match --tags 2>/dev/null) + +if [ -z "$CURRENT_HEAD_TAG" ]; then + echo "Current git branch is not tagged, tag with the BUILD tag first" + exit 1 +elif [ "$CURRENT_HEAD_TAG" != "$BUILD_TAG" ]; then + echo "BUILD_TAG $BUILD_TAG is not matching current branch tag $CURRENT_HEAD_TAG" + exit 1 +fi + +./tasks/appstudio-utils/release-build.sh -confirm +./pipelines/release-build.sh -confirm diff --git a/tasks/README.md b/tasks/README.md index a688be0d0c..97d5da8ee5 100644 --- a/tasks/README.md +++ b/tasks/README.md @@ -1,5 +1,3 @@ - -This directory contains all the task definitions provided by App Studio. The tasks need to be installed as part of the Build deployment component via ClusterTask as AppStudio initial releases will not allow user defined tasks. -See +This directory contains all the task definitions provided by App Studio. The tasks will be bundled and used by Pipelines of App Studio. Initial releases of App Studio will not allow user defined tasks. +See `https://github.com/redhat-appstudio/infra-deployments/tree/main/components/build` - diff --git a/tasks/appstudio-utils/Dockerfile b/tasks/appstudio-utils/Dockerfile index 982025d5d5..689d27b4e0 100755 --- a/tasks/appstudio-utils/Dockerfile +++ b/tasks/appstudio-utils/Dockerfile @@ -1,15 +1,9 @@ -FROM registry.access.redhat.com/ubi8/ubi -RUN dnf -y install wget -RUN wget https://github.com/mikefarah/yq/releases/download/v4.15.1/yq_linux_amd64 -O /usr/bin/yq -RUN chmod +x /usr/bin/yq -RUN dnf -y install jq -RUN dnf -y install skopeo -RUN wget https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/latest-4.9/openshift-client-linux.tar.gz -RUN tar xvf openshift-client-linux.tar.gz -RUN mv oc /usr/bin/oc -RUN mv kubectl /usr/bin/kubectl -RUN chmod +x /usr/bin/oc -RUN chmod +x /usr/bin/kubectl -RUN mkdir /appstudio-utils -COPY util-scripts /appstudio-utils/util-scripts -RUN chmod +x /appstudio-utils/util-scripts/*.sh \ No newline at end of file +FROM registry.access.redhat.com/ubi8/ubi + +RUN curl -L https://github.com/mikefarah/yq/releases/download/v4.15.1/yq_linux_amd64 -o /usr/bin/yq && chmod +x /usr/bin/yq +RUN curl -L https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/latest-4.9/openshift-client-linux.tar.gz | tar -xz -C /usr/bin/ +RUN dnf -y --setopt=tsflags=nodocs install \ + jq \ + skopeo && \ + dnf clean all +COPY util-scripts /appstudio-utils/util-scripts diff --git a/tasks/appstudio-utils/dev-build.sh b/tasks/appstudio-utils/dev-build.sh index 13fa847ab5..88b0fc7189 100755 --- a/tasks/appstudio-utils/dev-build.sh +++ b/tasks/appstudio-utils/dev-build.sh @@ -1,4 +1,5 @@ #!/bin/bash + # local dev build script SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" @@ -10,23 +11,20 @@ if [ "$MY_QUAY_USER" = "redhat-appstudio" ]; then echo "Cannot use devmode as redhat-appstudio user " exit 1 fi -BUILD_TAG=$(date +"%Y-%m-%d-%H%M%S") +if [ -z "$BUILD_TAG" ]; then + echo "Set BUILD_TAG to use devmode" + exit 1 +fi IMG="quay.io/$MY_QUAY_USER/appstudio-utils:$BUILD_TAG" echo "Using $MY_QUAY_USER to push results " -docker build -t $IMG . +docker build -t $IMG $SCRIPTDIR docker push $IMG for TASK in $SCRIPTDIR/util-tasks/*.yaml ; do - echo $TASK - cat $TASK | - yq -M e ".spec.steps[0].image=\"$IMG\"" - | \ - yq -M e ".kind=\"Task\"" - | \ - oc apply -f - + TASK_NAME=$(basename $TASK | sed 's/\.yaml//') + if [ "$TASK_NAME" == "kustomization" ]; then + continue + fi + yq -M e ".spec.steps[0].image=\"$IMG\"" $TASK | \ + tkn bundle push -f - quay.io/$MY_QUAY_USER/appstudio-tasks:$TASK_NAME-$BUILD_TAG done - - - - - - - \ No newline at end of file diff --git a/tasks/appstudio-utils/release-build.sh b/tasks/appstudio-utils/release-build.sh index 6dab7a9b61..fb7a5f6a3e 100755 --- a/tasks/appstudio-utils/release-build.sh +++ b/tasks/appstudio-utils/release-build.sh @@ -1,6 +1,13 @@ +#!/bin/bash + # local build script +SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" + +if [ -z "$BUILD_TAG" ]; then + echo "BUILD_TAG environment variable has to be set." + exit 1 +fi -BUILD_TAG=v0.1.3 IMG="quay.io/redhat-appstudio/appstudio-utils:$BUILD_TAG" echo "Warning: You are updating an image in redhat-appstudio" @@ -8,17 +15,21 @@ echo "This is disabled unless you pass -confirm on the cmdline" if [ "$1" = "-confirm" ]; then echo "Creating Release $IMG " echo "Using redhat-appstudio quay.io user to push results " - echo "The tasks in util-tasks need to be updated to reference this tag " - echo "The gitops repo for app studio needs to have ClusterTasks created for the tasks in util-task." - docker build -t $IMG . - docker push $IMG + echo "The tasks in util-tasks need to be updated to reference this tag" + if [ "$SKIP_DOCKER_BUILD" != "true" ]; then + docker build -t $IMG $SCRIPTDIR + docker push $IMG + fi + for TASK in $SCRIPTDIR/util-tasks/*.yaml ; do + TASK_NAME=$(basename $TASK | sed 's/\.yaml//') + if [ "$TASK_NAME" == "kustomization" ]; then + continue + fi + yq -M e ".spec.steps[0].image=\"$IMG\"" $TASK | \ + tkn bundle push -f - quay.io/redhat-appstudio/appstudio-tasks:$TASK_NAME-$BUILD_TAG + done + else echo "Cannot push to redhat-appstudio without a -confirm on command line." exit 1 fi - - - - - - diff --git a/tasks/appstudio-utils/test-all-tasks.sh b/tasks/appstudio-utils/test-all-tasks.sh index 3dd725dbad..75b21894e3 100755 --- a/tasks/appstudio-utils/test-all-tasks.sh +++ b/tasks/appstudio-utils/test-all-tasks.sh @@ -1,162 +1,8 @@ #!/bin/bash SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" - -read -r -d '' PIPELINE <<'PIPELINE_DEF' -apiVersion: tekton.dev/v1beta1 -kind: Pipeline -metadata: - name: test-all-tasks -spec: - params: - - description: 'Fully Qualified Image URL' - name: test-image - type: string - - description: 'For testing, a non-existant image' - name: non-existant-image - type: string - default: "quay.io/redhat-appstudio/appstudio-utils:not-real" - tasks: - - name: clone-repository - params: - - name: url - value: https://github.com/devfile-samples/devfile-sample-python-basic - taskRef: - kind: ClusterTask - name: git-clone - workspaces: - - name: output - workspace: workspace - - name: analyze-devfile - runAfter: - - clone-repository - taskRef: - kind: ClusterTask - name: analyze-devfile - workspaces: - - name: source - workspace: workspace - - name: post-devfile - taskRef: - kind: ClusterTask - name: appstudio-utils - runAfter: - - analyze-devfile - params: - - name: SCRIPT - value: | - #!/usr/bin/env bash - echo "Devfile dockerfile : $(tasks.analyze-devfile.results.dockerfile)" - echo "Devfile path: $(tasks.analyze-devfile.results.path)" - echo "Devfile deploy:" - echo $(tasks.analyze-devfile.results.deploy) | base64 -d - workspaces: - - name: source - workspace: workspace - - name: yes-image-exists - taskRef: - kind: ClusterTask - name: image-exists - params: - - name: image-url - value: "$(params.test-image)" - workspaces: - - name: source - workspace: workspace - - name: no-image-exists - taskRef: - kind: ClusterTask - name: image-exists - params: - - name: image-url - value: "$(params.non-existant-image)" - workspaces: - - name: source - workspace: workspace - - name: post - taskRef: - kind: ClusterTask - name: appstudio-utils - runAfter: - - no-image-exists - - yes-image-exists - params: - - name: SCRIPT - value: | - #!/usr/bin/env bash - echo "Image: $(params.test-image) exists: $(tasks.yes-image-exists.results.exists)" - echo "Image: $(params.non-existant-image) exists: $(tasks.no-image-exists.results.exists)" - workspaces: - - name: source - workspace: workspace - - name: utils-with-script - taskRef: - kind: ClusterTask - name: appstudio-utils - runAfter: - - post - params: - - name: SCRIPT - value: | - #!/usr/bin/env bash - echo "The image: $(params.test-image) exists: $(tasks.yes-image-exists.results.exists)" - - name: utils-no-script - taskRef: - kind: ClusterTask - name: appstudio-utils - runAfter: - - post - workspaces: - - name: workspace -PIPELINE_DEF - -read -r -d '' PRUN <<'PRUN' -apiVersion: tekton.dev/v1beta1 -kind: PipelineRun -metadata: - name: test-all-tasks -spec: - params: - - name: test-image - value: "quay.io/redhat-appstudio/appstudio-utils:v0.1.3" - pipelineRef: - name: test-all-tasks - workspaces: - - name: workspace - persistentVolumeClaim: - claimName: app-studio-default-workspace - subPath: . -PRUN - -read -r -d '' PVC <<'PVC' -apiVersion: v1 -items: - - apiVersion: v1 - kind: PersistentVolumeClaim - metadata: - finalizers: - - kubernetes.io/pvc-protection - name: app-studio-default-workspace - spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 1Gi - volumeMode: Filesystem -kind: List -metadata: - resourceVersion: "" - selfLink: "" -PVC - -echo "$PVC" | oc apply -f - - -#oc apply -f $SCRIPTDIR/util-tasks/ -echo "$PIPELINE" | oc apply -f - -oc delete pr test-all-tasks -echo "$PRUN" | oc apply -f - -tkn pr logs test-all-tasks -f +oc apply -k $SCRIPTDIR/test-all-tasks +tkn pipeline start test-all-tasks -w name=workspace,claimName=app-studio-default-workspace -p test-image=quay.io/redhat-appstudio/appstudio-utils:v0.1.3 --showlog --use-param-defaults # cleanup manually, this is so you can inspect the results # if you delete immediately, the results are gone diff --git a/tasks/appstudio-utils/test-all-tasks/kustomization.yaml b/tasks/appstudio-utils/test-all-tasks/kustomization.yaml new file mode 100644 index 0000000000..78d0dd17d7 --- /dev/null +++ b/tasks/appstudio-utils/test-all-tasks/kustomization.yaml @@ -0,0 +1,14 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: +- ../util-tasks +- pipeline.yaml +- pvc.yaml + +patches: +- target: + kind: Task + patch: |- + - op: replace + path: /spec/steps/0/image + value: quay.io/redhat-appstudio/appstudio-utils:v0.1.3 diff --git a/tasks/appstudio-utils/test-all-tasks/pipeline.yaml b/tasks/appstudio-utils/test-all-tasks/pipeline.yaml new file mode 100644 index 0000000000..b1f0ce0376 --- /dev/null +++ b/tasks/appstudio-utils/test-all-tasks/pipeline.yaml @@ -0,0 +1,98 @@ +apiVersion: tekton.dev/v1beta1 +kind: Pipeline +metadata: + name: test-all-tasks +spec: + params: + - description: 'Fully Qualified Image URL' + name: test-image + type: string + - description: 'For testing, a non-existant image' + name: non-existant-image + type: string + default: "quay.io/redhat-appstudio/appstudio-utils:not-real" + tasks: + - name: clone-repository + params: + - name: url + value: https://github.com/devfile-samples/devfile-sample-python-basic + taskRef: + kind: ClusterTask + name: git-clone + workspaces: + - name: output + workspace: workspace + - name: analyze-devfile + runAfter: + - clone-repository + taskRef: + name: analyze-devfile + workspaces: + - name: source + workspace: workspace + - name: post-devfile + taskRef: + name: utils-task + runAfter: + - analyze-devfile + params: + - name: SCRIPT + value: | + #!/usr/bin/env bash + echo "Devfile dockerfile : $(tasks.analyze-devfile.results.dockerfile)" + echo "Devfile path: $(tasks.analyze-devfile.results.path)" + echo "Devfile deploy:" + echo $(tasks.analyze-devfile.results.deploy) | base64 -d + workspaces: + - name: source + workspace: workspace + - name: yes-image-exists + taskRef: + name: image-exists + params: + - name: image-url + value: "$(params.test-image)" + workspaces: + - name: source + workspace: workspace + - name: no-image-exists + taskRef: + name: image-exists + params: + - name: image-url + value: "$(params.non-existant-image)" + workspaces: + - name: source + workspace: workspace + - name: post + taskRef: + name: utils-task + runAfter: + - no-image-exists + - yes-image-exists + params: + - name: SCRIPT + value: | + #!/usr/bin/env bash + echo "Image: $(params.test-image) exists: $(tasks.yes-image-exists.results.exists)" + echo "Image: $(params.non-existant-image) exists: $(tasks.no-image-exists.results.exists)" + workspaces: + - name: source + workspace: workspace + - name: utils-with-script + taskRef: + name: utils-task + runAfter: + - post + params: + - name: SCRIPT + value: | + #!/usr/bin/env bash + echo "The image: $(params.test-image) exists: $(tasks.yes-image-exists.results.exists)" + - name: utils-no-script + taskRef: + name: utils-task + runAfter: + - post + workspaces: + - name: workspace diff --git a/tasks/appstudio-utils/test-all-tasks/pvc.yaml b/tasks/appstudio-utils/test-all-tasks/pvc.yaml new file mode 100644 index 0000000000..c3df45bafa --- /dev/null +++ b/tasks/appstudio-utils/test-all-tasks/pvc.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + finalizers: + - kubernetes.io/pvc-protection + name: app-studio-default-workspace +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi + volumeMode: Filesystem diff --git a/tasks/appstudio-utils/util-scripts/analyze-devfile.sh b/tasks/appstudio-utils/util-scripts/analyze-devfile.sh old mode 100644 new mode 100755 diff --git a/tasks/appstudio-utils/util-scripts/cleanup-build-directories.sh b/tasks/appstudio-utils/util-scripts/cleanup-build-directories.sh old mode 100644 new mode 100755 diff --git a/tasks/appstudio-utils/util-scripts/image-exists.sh b/tasks/appstudio-utils/util-scripts/image-exists.sh old mode 100644 new mode 100755 diff --git a/tasks/appstudio-utils/util-tasks/analyze-devfile.yaml b/tasks/appstudio-utils/util-tasks/analyze-devfile.yaml index eabcb01c10..3ab418239d 100644 --- a/tasks/appstudio-utils/util-tasks/analyze-devfile.yaml +++ b/tasks/appstudio-utils/util-tasks/analyze-devfile.yaml @@ -1,5 +1,5 @@ apiVersion: tekton.dev/v1beta1 -kind: ClusterTask +kind: Task metadata: name: analyze-devfile spec: @@ -16,7 +16,7 @@ spec: - name: source steps: - name: analyze-devfile - image: quay.io/redhat-appstudio/appstudio-utils:v0.1.3 + image: appstudio-utils script: | #!/usr/bin/env bash { set +x ;} 2> /dev/null diff --git a/tasks/appstudio-utils/util-tasks/cleanup-build-directories.yaml b/tasks/appstudio-utils/util-tasks/cleanup-build-directories.yaml index 136cc483a7..abf6df1598 100644 --- a/tasks/appstudio-utils/util-tasks/cleanup-build-directories.yaml +++ b/tasks/appstudio-utils/util-tasks/cleanup-build-directories.yaml @@ -1,5 +1,5 @@ apiVersion: tekton.dev/v1beta1 -kind: ClusterTask +kind: Task metadata: name: cleanup-build-directories spec: @@ -12,7 +12,7 @@ spec: - name: source steps: - name: cleanup-build-directories - image: quay.io/redhat-appstudio/appstudio-utils:v0.1.3 + image: appstudio-utils script: | #!/usr/bin/env bash { set +x ;} 2> /dev/null diff --git a/tasks/appstudio-utils/util-tasks/appstudio-configure-build.yaml b/tasks/appstudio-utils/util-tasks/configure-build.yaml similarity index 93% rename from tasks/appstudio-utils/util-tasks/appstudio-configure-build.yaml rename to tasks/appstudio-utils/util-tasks/configure-build.yaml index 46709156fa..e2b57ad6b8 100644 --- a/tasks/appstudio-utils/util-tasks/appstudio-configure-build.yaml +++ b/tasks/appstudio-utils/util-tasks/configure-build.yaml @@ -1,7 +1,7 @@ apiVersion: tekton.dev/v1beta1 -kind: ClusterTask +kind: Task metadata: - name: appstudio-configure-build + name: configure-build spec: description: >- App Studio Configure Build Secrets in Source. @@ -21,7 +21,7 @@ spec: optional: true steps: - name: appstudio-configure-build - image: quay.io/redhat-appstudio/appstudio-utils:v0.1.3 + image: appstudio-utils script: | #!/usr/bin/env bash echo "App Studio Configure Build" diff --git a/tasks/appstudio-utils/util-tasks/image-exists.yaml b/tasks/appstudio-utils/util-tasks/image-exists.yaml index 7ed9540b2a..79731d37a5 100644 --- a/tasks/appstudio-utils/util-tasks/image-exists.yaml +++ b/tasks/appstudio-utils/util-tasks/image-exists.yaml @@ -1,5 +1,5 @@ apiVersion: tekton.dev/v1beta1 -kind: ClusterTask +kind: Task metadata: name: image-exists spec: @@ -16,7 +16,7 @@ spec: optional: true steps: - name: test-image-exists - image: quay.io/redhat-appstudio/appstudio-utils:v0.1.3 + image: appstudio-utils script: | #!/usr/bin/env bash { set +x ;} 2> /dev/null diff --git a/tasks/appstudio-utils/util-tasks/appstudio-init.yaml b/tasks/appstudio-utils/util-tasks/init.yaml similarity index 89% rename from tasks/appstudio-utils/util-tasks/appstudio-init.yaml rename to tasks/appstudio-utils/util-tasks/init.yaml index d0571fde0b..b138eea07d 100644 --- a/tasks/appstudio-utils/util-tasks/appstudio-init.yaml +++ b/tasks/appstudio-utils/util-tasks/init.yaml @@ -1,7 +1,7 @@ apiVersion: tekton.dev/v1beta1 -kind: ClusterTask +kind: Task metadata: - name: appstudio-init + name: init spec: description: >- App Studio Initialize Pipeline Task, include flags for rebuild and auth. @@ -26,9 +26,9 @@ spec: optional: true steps: - name: appstudio-init - image: quay.io/redhat-appstudio/appstudio-utils:v0.1.3 + image: appstudio-utils script: | - #!/usr/bin/env bash + #!/bin/bash echo "App Studio Build Initialize: $(params.image-url)" echo echo "Determine if Image Already Exists" diff --git a/tasks/appstudio-utils/util-tasks/kustomization.yaml b/tasks/appstudio-utils/util-tasks/kustomization.yaml index a9ac219cf4..d592d6df23 100644 --- a/tasks/appstudio-utils/util-tasks/kustomization.yaml +++ b/tasks/appstudio-utils/util-tasks/kustomization.yaml @@ -2,10 +2,10 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - analyze-devfile.yaml -- appstudio-configure-build.yaml -- appstudio-init.yaml -- appstudio-summary.yaml -- appstudio-tekton-bundle.yaml -- appstudio-utils.yaml - cleanup-build-directories.yaml +- configure-build.yaml - image-exists.yaml +- init.yaml +- summary.yaml +- tekton-bundle.yaml +- utils-task.yaml diff --git a/tasks/appstudio-utils/util-tasks/appstudio-summary.yaml b/tasks/appstudio-utils/util-tasks/summary.yaml similarity index 94% rename from tasks/appstudio-utils/util-tasks/appstudio-summary.yaml rename to tasks/appstudio-utils/util-tasks/summary.yaml index 6bf7cbc0ce..a0a182be8f 100644 --- a/tasks/appstudio-utils/util-tasks/appstudio-summary.yaml +++ b/tasks/appstudio-utils/util-tasks/summary.yaml @@ -1,7 +1,7 @@ apiVersion: tekton.dev/v1beta1 -kind: ClusterTask +kind: Task metadata: - name: appstudio-summary + name: summary spec: description: >- App Studio Summary Pipeline Task. @@ -20,7 +20,7 @@ spec: optional: true steps: - name: appstudio-summary - image: quay.io/redhat-appstudio/appstudio-utils:v0.1.3 + image: appstudio-utils script: | #!/usr/bin/env bash echo diff --git a/tasks/appstudio-utils/util-tasks/appstudio-tekton-bundle.yaml b/tasks/appstudio-utils/util-tasks/tekton-bundle.yaml similarity index 90% rename from tasks/appstudio-utils/util-tasks/appstudio-tekton-bundle.yaml rename to tasks/appstudio-utils/util-tasks/tekton-bundle.yaml index 09975e22a0..f254dee21c 100644 --- a/tasks/appstudio-utils/util-tasks/appstudio-tekton-bundle.yaml +++ b/tasks/appstudio-utils/util-tasks/tekton-bundle.yaml @@ -1,7 +1,7 @@ apiVersion: tekton.dev/v1beta1 -kind: ClusterTask +kind: Task metadata: - name: appstudio-tekton-bundle + name: tekton-bundle spec: description: >- Bundle tekton manifests into OCI image and push to registry @@ -16,7 +16,7 @@ spec: - name: registry-auth steps: - name: appstudio-tekton-bundle - image: quay.io/redhat-appstudio/appstudio-utils:v0.1.3 + image: appstudio-utils workingDir: $(workspaces.source.path)/$(params.path-context) script: | #!/bin/bash diff --git a/tasks/appstudio-utils/util-tasks/appstudio-utils.yaml b/tasks/appstudio-utils/util-tasks/utils-task.yaml similarity index 81% rename from tasks/appstudio-utils/util-tasks/appstudio-utils.yaml rename to tasks/appstudio-utils/util-tasks/utils-task.yaml index 1bdc0fb468..b62514360b 100644 --- a/tasks/appstudio-utils/util-tasks/appstudio-utils.yaml +++ b/tasks/appstudio-utils/util-tasks/utils-task.yaml @@ -1,7 +1,7 @@ apiVersion: tekton.dev/v1beta1 -kind: ClusterTask +kind: Task metadata: - name: appstudio-utils + name: utils-task spec: description: >- Utilities @@ -14,7 +14,7 @@ spec: optional: true steps: - name: script - image: quay.io/redhat-appstudio/appstudio-utils:v0.1.3 + image: appstudio-utils script: | { set +x ;} 2> /dev/null echo "App Studio Utility Task $(context.task.name)"