File tree Expand file tree Collapse file tree 5 files changed +69
-2
lines changed
set-vendir-channels-path-to-imgpkg-bundle Expand file tree Collapse file tree 5 files changed +69
-2
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,12 @@ All notable changes to this project will be documented in this file.
99The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.1.0/ ) ,
1010and this project adheres to [ Semantic Versioning] ( https://semver.org/spec/v2.0.0.html ) .
1111
12+ ## [ Unreleased]
13+
14+ ### Added
15+
16+ - Initial release of the set-vendir-channels-path-to-imgpkg-bundle action.
17+
1218## [ 1.1.0] - 2024-11-10
1319
1420### Added
Original file line number Diff line number Diff line change 66 IMAGE_REPOSITORY_URL=" $1 "
77fi
88BEARER_TOKEN=$2
9- INITIAL_NUMBER=${3:- 1 }
10- TAG_PREFIX=${4:- " build- " }
9+ INITIAL_NUMBER=${3}
10+ TAG_PREFIX=${4}
1111
1212if [ -n " $BEARER_TOKEN " ]; then
1313 AUTH_HEADER=" -H \" Authorization: Bearer ${BEARER_TOKEN} \" "
Original file line number Diff line number Diff line change 1+ FROM alpine:latest
2+ RUN apk add --update --no-cache --no-progress yq
3+
4+ # perl-utils: https://github.com/carvel-dev/ytt/issues/537
5+ RUN apk add --update --no-cache --no-progress bash perl-utils \
6+ && wget -O- https://carvel.dev/install.sh | bash \
7+ && apk del bash perl-utils
8+
9+ COPY action.sh /action.sh
10+ ENTRYPOINT ["/action.sh" ]
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env sh
2+
3+ CHANNEL_NAME=$1
4+ IMGPKG_BUNDLE_IMAGE=$2
5+ BASE_PATH=$3
6+
7+ mkdir -p " $BASE_PATH "
8+ cd " $BASE_PATH "
9+ VENDIR_FILE=" vendir.yml"
10+
11+ if [ ! -f " $VENDIR_FILE " ]; then
12+ yq - > " $VENDIR_FILE " << 'EOF '
13+ ---
14+ apiVersion: vendir.k14s.io/v1alpha1
15+ kind: Config
16+ EOF
17+ fi
18+
19+ yq -i "
20+ .directories = .directories // []
21+ | .directories = .directories + [{\" path\" : \" channels\" , \" contents\" : []}]
22+ | .directories |= unique_by(.path)
23+ | with(
24+ .directories[] | select(.path == \" channels\" );
25+ .contents = [{\" path\" : \" $CHANNEL_NAME \" , \" imgpkgBundle\" : {\" image\" : \" $IMGPKG_BUNDLE_IMAGE \" }}] + .contents
26+ | .contents |= unique_by(.path)
27+ )
28+ | .directories |= sort_by(.path == \" channels\" | not)
29+ " " $VENDIR_FILE "
Original file line number Diff line number Diff line change 1+ name : Set Vendir Channels Path to Imgpkg Bundle
2+ description : Sets a vendir directory to a imgpkg bundle image.
3+
4+ inputs :
5+ channel_name :
6+ description : " The path under the channels directory to update."
7+ required : true
8+ imgpkg_bundle_image :
9+ description : " The imgpkg bundle image."
10+ required : true
11+ path :
12+ description : " The base directory path where vendir.yml is located."
13+ required : false
14+ default : " ."
15+
16+ runs :
17+ using : docker
18+ image : Dockerfile
19+ args :
20+ - ${{ inputs.channel_name }}
21+ - ${{ inputs.imgpkg_bundle_image }}
22+ - ${{ inputs.path }}
You can’t perform that action at this time.
0 commit comments