-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
219 additions
and
53 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
pipeline/*secret*.yaml | ||
listener/*secret*.yaml | ||
listener/*secret*.yaml | ||
.history/ |
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,11 @@ | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: ansible-builder-pvc | ||
spec: | ||
accessModes: | ||
- ReadWriteMany | ||
resources: | ||
requests: | ||
storage: 1Gi | ||
volumeMode: Filesystem |
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,50 @@ | ||
apiVersion: tekton.dev/v1beta1 | ||
kind: Task | ||
metadata: | ||
name: ansible-builder | ||
labels: | ||
app.kubernetes.io/version: "0.1" | ||
annotations: | ||
tekton.dev/pipelines.minVersion: "0.12.0" | ||
tekton.dev/displayName: ansible-builder | ||
tekton.dev/categories: Build Tools | ||
tekton.dev/tags: ansible, ansible-builder, build-tool, automation | ||
tekton.dev/platforms: "linux/amd64" | ||
spec: | ||
description: >- | ||
Creates a build context (including a Containerfile) from an execution environment spec. | ||
This build context is populated with dependencies including requirements files. | ||
workspaces: | ||
- name: source | ||
description: The source workspace where the execution environment code is cloned. | ||
params: | ||
- description: Execution environment file definition. | ||
name: FILENAME | ||
type: string | ||
default: execution-environment.yml | ||
- description: Execution environment build context. | ||
name: BUILD_CONTEXT | ||
type: string | ||
default: context | ||
- name: OUTPUT_FILENAME | ||
description: Name of file to write image definition to. Either Dockerfile or Containerfile. | ||
type: string | ||
default: Containerfile | ||
- description: ansible-builder output verbosity. | ||
name: VERBOSITY | ||
type: string | ||
default: "2" | ||
- name: BUILDER_IMAGE | ||
description: The location of the ansible-builder image. | ||
type: string | ||
default: quay.io/ansible/ansible-builder:latest | ||
steps: | ||
|
||
- name: ansible-builder-create | ||
workingDir: $(workspaces.source.path) | ||
image: $(params.BUILDER_IMAGE) | ||
script: | | ||
#!/bin/sh | ||
set -eux -o | ||
ansible-builder create -f "$(params.FILENAME)" -c "$(params.BUILD_CONTEXT)" --output-filename "$(params.OUTPUT_FILENAME)" -v "$(params.VERBOSITY)" |
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,125 @@ | ||
apiVersion: tekton.dev/v1beta1 | ||
kind: Pipeline | ||
metadata: | ||
name: ansible-builder | ||
spec: | ||
workspaces: | ||
- name: ee-repo | ||
params: | ||
# Fetch Task | ||
- name: git-url | ||
type: string | ||
description: url of the git repo for the code of deployment | ||
default: https://github.com/jtudelag/ansible-execution-environments.git | ||
- name: git-revision | ||
type: string | ||
description: revision to be used from repo of the code for deployment (Commit id) | ||
default: main | ||
# ansible-builder task | ||
- name: ANSIBLE_BUILDER_IMAGE | ||
description: The location of the ansible-builder image. | ||
type: string | ||
default: registry.redhat.io/ansible-automation-platform-21/ansible-builder-rhel8:1.0.1-47 | ||
- description: Name of the container image to be built | ||
name: NAME | ||
type: string | ||
- description: Tag of the container image to be built | ||
name: TAG | ||
type: string | ||
default: "latest" | ||
# Buildah task | ||
- description: Path to the directory to use as context for buildah. | ||
name: CONTEXT | ||
type: string | ||
default: "context/" | ||
- description: The path to the Dockerfile to execute. | ||
name: DOCKERFILE | ||
type: string | ||
default: "Containerfile" | ||
- description: buildah build Args | ||
name: BUILD_ARGS | ||
type: string | ||
default: "" | ||
- description: buildah push Args | ||
name: PUSH_ARGS | ||
type: string | ||
default: "" | ||
- description: Verify the TLS on the registry endpoint (for push/pull to a non-TLS registry) | ||
name: TLSVERIFY | ||
type: string | ||
default: "false" | ||
tasks: | ||
|
||
- name: fetch-repository | ||
taskRef: | ||
name: git-clone-1-6-0 | ||
kind: ClusterTask | ||
workspaces: | ||
- name: output | ||
workspace: ee-repo | ||
params: | ||
- name: url | ||
value: $(params.git-url) | ||
- name: deleteExisting | ||
value: "true" | ||
- name: revision | ||
value: $(params.git-revision) | ||
|
||
- name: ansible-builder-create | ||
taskRef: | ||
name: ansible-builder | ||
kind: Task | ||
workspaces: | ||
- name: source | ||
workspace: ee-repo | ||
runAfter: | ||
- fetch-repository | ||
params: | ||
- name: BUILDER_IMAGE | ||
value: $(params.ANSIBLE_BUILDER_IMAGE) | ||
|
||
- name: build-image-tag | ||
taskRef: | ||
name: buildah | ||
kind: ClusterTask | ||
workspaces: | ||
- name: source | ||
workspace: ee-repo | ||
runAfter: | ||
- ansible-builder-create | ||
params: | ||
- name: TLSVERIFY | ||
value: "false" | ||
- name: IMAGE | ||
value: $(params.NAME):$(params.TAG) | ||
- name: CONTEXT | ||
value: "$(params.CONTEXT)" | ||
- name: DOCKERFILE | ||
value: "$(params.DOCKERFILE)" | ||
- name: BUILD_EXTRA_ARGS | ||
value: "$(params.BUILD_ARGS)" | ||
- name: PUSH_EXTRA_ARGS | ||
value: "$(params.PUSH_ARGS)" | ||
|
||
- name: build-image-latest | ||
taskRef: | ||
name: buildah | ||
kind: ClusterTask | ||
workspaces: | ||
- name: source | ||
workspace: ee-repo | ||
runAfter: | ||
- ansible-builder-create | ||
params: | ||
- name: TLSVERIFY | ||
value: "false" | ||
- name: IMAGE | ||
value: $(params.NAME):latest | ||
- name: CONTEXT | ||
value: "$(params.CONTEXT)" | ||
- name: DOCKERFILE | ||
value: "$(params.DOCKERFILE)" | ||
- name: BUILD_EXTRA_ARGS | ||
value: "$(params.BUILD_ARGS)" | ||
- name: PUSH_EXTRA_ARGS | ||
value: "$(params.PUSH_ARGS)" |
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
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