-
Notifications
You must be signed in to change notification settings - Fork 3
/
action.yaml
91 lines (86 loc) · 3.09 KB
/
action.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
---
name: Shipwright Setup (CI)
description: Installs Shipwright Build Controller, CLI and Container Registry
branding:
color: blue
icon: anchor
inputs:
tekton-version:
description: Tekton Pipelines release version
required: false
default: v0.38.3
shipwright-ref:
description: Shipwright Build Controller repository reference, tag or SHA
required: false
default: v0.11.0
cli-ref:
description: Shipwright CLI repository reference, tag or SHA
required: false
default: v0.11.0
kind-cluster-name:
description: KinD cluster name, by default "kind"
required: false
default: kind
setup-registry:
description: When enabled, the action deploys a Container Registry instance
required: true
default: "true"
registry-hostname:
description: Container Registry hostname inside KinD
required: true
default: registry.registry.svc.cluster.local
patch-etc-hosts:
description: Patch "/etc/hosts" to alias the Container Registry hostname to "127.0.0.1"
required: true
default: "true"
runs:
using: composite
steps:
# pre-flight checks, making sure the dependencies needed for the upcoming steps are available
- shell: bash
working-directory: ${{ github.action_path }}
run: ./probe.sh
# deploying the container registry when input flag is set, waiting for the deployment to reach
# ready status before proceeding
- shell: bash
if: ${{ inputs.setup-registry == 'true' }}
working-directory: ${{ github.action_path }}
run: ./install-registry.sh
# deploying tekton pipline controller and dependencies, waiting for it to reach ready status
- shell: bash
env:
TEKTON_VERSION: ${{ inputs.tekton-version }}
working-directory: ${{ github.action_path }}
run: ./install-tekton.sh
# patches the /etc/hosts to include the container registry hostname resolving to 127.0.0.1
- shell: bash
if: ${{ inputs.patch-etc-hosts == 'true' }}
env:
REGISTRY_HOSTNAME: ${{ inputs.registry-hostname }}
working-directory: ${{ github.action_path }}
run: sudo ./patch-etc-hosts.sh
# checking out the build controller project locally to perform the rollout and inspection of the
# controller instance in the cluster
- uses: actions/checkout@v3
with:
repository: shipwright-io/build
ref: ${{ inputs.shipwright-ref }}
path: src/build
if: ${{ inputs.shipwright-ref != '_ignore' }}
- shell: bash
env:
KIND_CLUSTER_NAME: ${{ inputs.kind-cluster-name }}
working-directory: ${{ github.action_path }}
if: ${{ inputs.shipwright-ref != '_ignore' }}
run: ./install-shipwright.sh
# checking out the CLI project locally, performing the installation to let it available on PATH
- uses: actions/checkout@v3
with:
repository: shipwright-io/cli
ref: ${{ inputs.cli-ref }}
path: src/cli
if: ${{ inputs.cli-ref != '_ignore' }}
- shell: bash
working-directory: ${{ github.action_path }}
if: ${{ inputs.cli-ref != '_ignore' }}
run: ./install-cli.sh