File tree 5 files changed +68
-2
lines changed
set-vendir-channels-path-to-imgpkg-bundle
5 files changed +68
-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.
9
9
The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.1.0/ ) ,
10
10
and this project adheres to [ Semantic Versioning] ( https://semver.org/spec/v2.0.0.html ) .
11
11
12
+ ## [ Unreleased]
13
+
14
+ ### Added
15
+
16
+ - Initial release of the set-vendir-channels-path-to-imgpkg-bundle action.
17
+
12
18
## [ 1.1.0] - 2024-11-10
13
19
14
20
### Added
Original file line number Diff line number Diff line change 6
6
IMAGE_REPOSITORY_URL=" $1 "
7
7
fi
8
8
BEARER_TOKEN=$2
9
- INITIAL_NUMBER=${3:- 1 }
10
- TAG_PREFIX=${4:- " build- " }
9
+ INITIAL_NUMBER=${3}
10
+ TAG_PREFIX=${4}
11
11
12
12
if [ -n " $BEARER_TOKEN " ]; then
13
13
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
+ VENDIR_FILE=" $BASE_PATH /vendir.yml"
9
+
10
+ if [ ! -f " $VENDIR_FILE " ]; then
11
+ yq - > " $VENDIR_FILE " << 'EOF '
12
+ ---
13
+ apiVersion: vendir.k14s.io/v1alpha1
14
+ kind: Config
15
+ EOF
16
+ fi
17
+
18
+ yq -i "
19
+ .directories = .directories // []
20
+ | .directories = .directories + [{\" path\" : \" channels\" , \" contents\" : []}]
21
+ | .directories |= unique_by(.path)
22
+ | with(
23
+ .directories[] | select(.path == \" channels\" );
24
+ .contents = [{\" path\" : \" $CHANNEL_NAME \" , \" imgpkgBundle\" : {\" image\" : \" $IMGPKG_BUNDLE_IMAGE \" }}] + .contents
25
+ | .contents |= unique_by(.path)
26
+ )
27
+ | .directories |= sort_by(.path == \" channels\" | not)
28
+ " " $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