From 222051b7f1f42209921a625ca65c4117c35b1cfc Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Tue, 9 Jan 2024 00:11:25 +0700 Subject: [PATCH 001/111] Update Earthfile --- earthly/cspell/Earthfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/earthly/cspell/Earthfile b/earthly/cspell/Earthfile index 5b9932233..7e3828676 100644 --- a/earthly/cspell/Earthfile +++ b/earthly/cspell/Earthfile @@ -1,10 +1,10 @@ # cspell UDCs and Containers. -VERSION --global-cache 0.7 +VERSION --global-cache --use-function-keyword 0.7 CHECK: # Spell checking all docs and code is done with cspell # See: cspell.org - COMMAND + FUNCTION # Where we want to run the `lint` from. Use `.` to check the whole repo. ARG src=. From 1dcf4eeb16e6f08fc0c6c9c486729c12b018ea88 Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Tue, 9 Jan 2024 00:11:50 +0700 Subject: [PATCH 002/111] Update Earthfile --- earthly/bash/Earthfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/earthly/bash/Earthfile b/earthly/bash/Earthfile index b1d09a400..d5ae84052 100644 --- a/earthly/bash/Earthfile +++ b/earthly/bash/Earthfile @@ -1,5 +1,5 @@ # cspell UDCs and Containers. -VERSION --global-cache 0.7 +VERSION --global-cache --use-function-keyword 0.7 # Internal: builder creates a container we can use to execute shellcheck builder: @@ -22,7 +22,7 @@ builder: # shellcheck - Check all shell files recursively in the src with shellcheck. SHELLCHECK: - COMMAND + FUNCTION ARG --required src FROM +builder From d4b53b6fc79276d303f70ce2d6b9213160cb8070 Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Tue, 9 Jan 2024 00:12:15 +0700 Subject: [PATCH 003/111] Update Earthfile --- earthly/mdlint/Earthfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/earthly/mdlint/Earthfile b/earthly/mdlint/Earthfile index a41b5a877..c1341ea6c 100644 --- a/earthly/mdlint/Earthfile +++ b/earthly/mdlint/Earthfile @@ -1,4 +1,4 @@ -VERSION --global-cache 0.7 +VERSION --global-cache --use-function-keyword 0.7 # cspell: words markdownlint MDLINT_LOCALLY: @@ -14,7 +14,7 @@ MDLINT_LOCALLY: # in the `next` branch of `markdownlint`. # Container is built by: # https://github.com/DavidAnson/markdownlint-cli2/blob/next/docker/Dockerfile-rules - COMMAND + FUNCTION # Directory we need to run lint checks against. ARG --required src @@ -53,7 +53,7 @@ CHECK: # in the `next` branch of `markdownlint`. # Container is built by: # https://github.com/DavidAnson/markdownlint-cli2/blob/next/docker/Dockerfile-rules - COMMAND + FUNCTION ARG src = . From 5725c67d3fec55f7b764b5bbaa22e7d7752ab77d Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Tue, 9 Jan 2024 00:13:16 +0700 Subject: [PATCH 004/111] Update Earthfile --- Earthfile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Earthfile b/Earthfile index 563135294..d95239b00 100644 --- a/Earthfile +++ b/Earthfile @@ -4,9 +4,12 @@ VERSION --global-cache 0.7 # cspell: words livedocs sitedocs # check-markdown can be done remotely. -check-markdown: +check-markdown: + LOCALLY + DO ./earthly/mdlint+CHECK + # markdown-check-fix perform markdown check with fix in this repo. markdown-check-fix: LOCALLY @@ -15,6 +18,8 @@ markdown-check-fix: # check-spelling Check spelling in this repo inside a container. check-spelling: + LOCALLY + DO ./earthly/cspell+CHECK # check-bash - test all bash files lint properly according to shellcheck. @@ -54,4 +59,4 @@ repo-config: WORKDIR /repo COPY --dir .sqlfluff . - SAVE ARTIFACT /repo repo \ No newline at end of file + SAVE ARTIFACT /repo repo From 8334c81aefeb34030c4ac41bc0b091ec38b987a8 Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Tue, 9 Jan 2024 00:18:10 +0700 Subject: [PATCH 005/111] Update Earthfile --- earthly/bash/Earthfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/earthly/bash/Earthfile b/earthly/bash/Earthfile index d5ae84052..dd0d2b6e3 100644 --- a/earthly/bash/Earthfile +++ b/earthly/bash/Earthfile @@ -18,7 +18,7 @@ builder: # Will only copy the symlink and not what it references, so we need to # manually copy what it references. This enables the script to work # both in-repo and in-ci here. - DO ../../utilities/scripts+ADD_BASH_SCRIPTS + RUN ../../utilities/scripts+ADD_BASH_SCRIPTS # shellcheck - Check all shell files recursively in the src with shellcheck. SHELLCHECK: From 0390a079044240bcc5a54e984503bb382327cdae Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Tue, 9 Jan 2024 00:29:38 +0700 Subject: [PATCH 006/111] Update Earthfile --- earthly/bash/Earthfile | 1 + 1 file changed, 1 insertion(+) diff --git a/earthly/bash/Earthfile b/earthly/bash/Earthfile index dd0d2b6e3..1698466ba 100644 --- a/earthly/bash/Earthfile +++ b/earthly/bash/Earthfile @@ -3,6 +3,7 @@ VERSION --global-cache --use-function-keyword 0.7 # Internal: builder creates a container we can use to execute shellcheck builder: + FUNCITON FROM alpine:3.18 RUN apk add --no-cache \ From 81eb97814e1379096ae04981ab5cff75aaa472be Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Tue, 9 Jan 2024 00:29:49 +0700 Subject: [PATCH 007/111] Update Earthfile --- earthly/bash/Earthfile | 1 - 1 file changed, 1 deletion(-) diff --git a/earthly/bash/Earthfile b/earthly/bash/Earthfile index 1698466ba..dd0d2b6e3 100644 --- a/earthly/bash/Earthfile +++ b/earthly/bash/Earthfile @@ -3,7 +3,6 @@ VERSION --global-cache --use-function-keyword 0.7 # Internal: builder creates a container we can use to execute shellcheck builder: - FUNCITON FROM alpine:3.18 RUN apk add --no-cache \ From d2de8b480407ebd88dee9222a02ae9e4dca2eef9 Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Tue, 9 Jan 2024 00:30:11 +0700 Subject: [PATCH 008/111] Update Earthfile --- earthly/bash/Earthfile | 1 + 1 file changed, 1 insertion(+) diff --git a/earthly/bash/Earthfile b/earthly/bash/Earthfile index dd0d2b6e3..838678a93 100644 --- a/earthly/bash/Earthfile +++ b/earthly/bash/Earthfile @@ -3,6 +3,7 @@ VERSION --global-cache --use-function-keyword 0.7 # Internal: builder creates a container we can use to execute shellcheck builder: + FUNCTION FROM alpine:3.18 RUN apk add --no-cache \ From 64b28595e2d4ba2c90ee1a19911b58e55c2c314c Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Tue, 9 Jan 2024 00:30:46 +0700 Subject: [PATCH 009/111] Update Earthfile --- earthly/mdlint/Earthfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/earthly/mdlint/Earthfile b/earthly/mdlint/Earthfile index c1341ea6c..edb0555f4 100644 --- a/earthly/mdlint/Earthfile +++ b/earthly/mdlint/Earthfile @@ -84,4 +84,4 @@ mdlint-test: ARG src=$(echo ${PWD}/../../) - DO +MDLINT_LOCALLY --src=${src} + RUN +MDLINT_LOCALLY --src=${src} From e0beae19eb5ea1cfff3e366ef8839bd92f728a26 Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Tue, 9 Jan 2024 11:43:49 +0700 Subject: [PATCH 010/111] Update Earthfile --- earthly/bash/Earthfile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/earthly/bash/Earthfile b/earthly/bash/Earthfile index 838678a93..26c2e54c1 100644 --- a/earthly/bash/Earthfile +++ b/earthly/bash/Earthfile @@ -3,7 +3,6 @@ VERSION --global-cache --use-function-keyword 0.7 # Internal: builder creates a container we can use to execute shellcheck builder: - FUNCTION FROM alpine:3.18 RUN apk add --no-cache \ @@ -19,14 +18,14 @@ builder: # Will only copy the symlink and not what it references, so we need to # manually copy what it references. This enables the script to work # both in-repo and in-ci here. - RUN ../../utilities/scripts+ADD_BASH_SCRIPTS + DO ../../utilities/scripts+ADD_BASH_SCRIPTS # shellcheck - Check all shell files recursively in the src with shellcheck. SHELLCHECK: FUNCTION ARG --required src - FROM +builder + FROM +builder COPY --dir $src /src From 5e38ec3a570b4eb7997a93b51b5bc29658c7e463 Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Tue, 9 Jan 2024 12:31:26 +0700 Subject: [PATCH 011/111] fix: token recognition error at: 'FUNCTION' --- earthly/bash/Earthfile | 1 + 1 file changed, 1 insertion(+) diff --git a/earthly/bash/Earthfile b/earthly/bash/Earthfile index 26c2e54c1..f261619ce 100644 --- a/earthly/bash/Earthfile +++ b/earthly/bash/Earthfile @@ -23,6 +23,7 @@ builder: # shellcheck - Check all shell files recursively in the src with shellcheck. SHELLCHECK: FUNCTION + ARG --required src FROM +builder From 6093e4af947076ad26894ce5ce8056e90f6c8339 Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Tue, 9 Jan 2024 12:42:11 +0700 Subject: [PATCH 012/111] fix: bash earthfile --- earthly/bash/Earthfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/earthly/bash/Earthfile b/earthly/bash/Earthfile index f261619ce..d5ae84052 100644 --- a/earthly/bash/Earthfile +++ b/earthly/bash/Earthfile @@ -23,10 +23,9 @@ builder: # shellcheck - Check all shell files recursively in the src with shellcheck. SHELLCHECK: FUNCTION - ARG --required src - FROM +builder + FROM +builder COPY --dir $src /src From 561a2ff1e6aa56290cf229d498437de4e34e292c Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Tue, 9 Jan 2024 12:44:32 +0700 Subject: [PATCH 013/111] fix: update earthfile --- Earthfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Earthfile b/Earthfile index d95239b00..771851261 100644 --- a/Earthfile +++ b/Earthfile @@ -1,5 +1,5 @@ # Set the Earthly version to 0.7 -VERSION --global-cache 0.7 +VERSION --global-cache --use-function-keyword 0.7 # cspell: words livedocs sitedocs From fd1022e8d2943f44c6a6cf606eebfb56a0376dcb Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Tue, 9 Jan 2024 12:47:57 +0700 Subject: [PATCH 014/111] fix: command to function --- utilities/scripts/Earthfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/utilities/scripts/Earthfile b/utilities/scripts/Earthfile index b9b32b5db..839c118c7 100644 --- a/utilities/scripts/Earthfile +++ b/utilities/scripts/Earthfile @@ -1,5 +1,5 @@ # Earthfile containing common scripts for easy reference -VERSION --global-cache 0.7 +VERSION --global-cache --use-function-keyword 0.7 # Internal: bash-scripts : Common bash scripts. bash-scripts: @@ -19,12 +19,12 @@ python-scripts: # UDC to add our common bash scripts to a container image. ADD_BASH_SCRIPTS: - COMMAND + FUNCTION COPY --dir +bash-scripts/include /scripts/include # UDC to add our common bash scripts to a container image. ADD_PYTHON_SCRIPTS: - COMMAND + FUNCTION - COPY --dir +python-scripts/python /scripts/python \ No newline at end of file + COPY --dir +python-scripts/python /scripts/python From f15a6f5272c79604b0cdf88e50049c8612a10e96 Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Tue, 9 Jan 2024 12:59:02 +0700 Subject: [PATCH 015/111] fix: token issue --- utilities/scripts/Earthfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utilities/scripts/Earthfile b/utilities/scripts/Earthfile index 839c118c7..c25255ee3 100644 --- a/utilities/scripts/Earthfile +++ b/utilities/scripts/Earthfile @@ -27,4 +27,4 @@ ADD_BASH_SCRIPTS: ADD_PYTHON_SCRIPTS: FUNCTION - COPY --dir +python-scripts/python /scripts/python + COPY --dir +python-scripts/python /scripts/python From 618fe357e0293d7234487c9d7cd011523a225295 Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Tue, 9 Jan 2024 13:16:18 +0700 Subject: [PATCH 016/111] Add files via upload --- utilities/scripts/Earthfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utilities/scripts/Earthfile b/utilities/scripts/Earthfile index c25255ee3..a52567a91 100644 --- a/utilities/scripts/Earthfile +++ b/utilities/scripts/Earthfile @@ -27,4 +27,4 @@ ADD_BASH_SCRIPTS: ADD_PYTHON_SCRIPTS: FUNCTION - COPY --dir +python-scripts/python /scripts/python + COPY --dir +python-scripts/python /scripts/python \ No newline at end of file From c7078e5395042de7e8609552e4b4725b70f54d5d Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Tue, 9 Jan 2024 13:37:58 +0700 Subject: [PATCH 017/111] Update Earthfile --- Earthfile | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/Earthfile b/Earthfile index 1c936c9dd..0bbbbb3f6 100644 --- a/Earthfile +++ b/Earthfile @@ -5,12 +5,9 @@ VERSION --global-cache --use-function-keyword 0.7 # check-markdown can be done remotely. -check-markdown: - LOCALLY - +check-markdown: DO ./earthly/mdlint+CHECK - # markdown-check-fix perform markdown check with fix in this repo. markdown-check-fix: LOCALLY @@ -19,8 +16,6 @@ markdown-check-fix: # check-spelling Check spelling in this repo inside a container. check-spelling: - LOCALLY - DO ./earthly/cspell+CHECK # check-bash - test all bash files lint properly according to shellcheck. From fc57e156f7d2cde3762b57d9a8bb9e4e0601541f Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Tue, 9 Jan 2024 13:46:51 +0700 Subject: [PATCH 018/111] fix: change to correct earthfile From ad9d3bb3767164a10106cfab7ea24660017bc752 Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Tue, 9 Jan 2024 15:18:50 +0700 Subject: [PATCH 019/111] Update go.sum --- cli/go.sum | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/go.sum b/cli/go.sum index 33bb07292..0d6801107 100644 --- a/cli/go.sum +++ b/cli/go.sum @@ -61,8 +61,8 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/earthly/earthly/ast v0.0.2-0.20230524145153-17fad8c8f79b h1:kwdLqircFHqYNLrBuSOybPpGPnqaqXEcRvJOWiSqRZw= -github.com/earthly/earthly/ast v0.0.2-0.20230524145153-17fad8c8f79b/go.mod h1:OoxU/3mRER8gdd4l1lxF6EgK+0vf7zQ8m9g269y6hWI= +github.com/earthly/earthly/ast v0.0.2-0.20230524145153-17fad8c8f79b h1:95fef7ce99cb58a9d5966e7953409cbe13f24d41= +github.com/earthly/earthly/ast v0.0.2-0.20230524145153-17fad8c8f79b/go.mod h1:95fef7ce99cb58a9d5966e7953409cbe13f24d41= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= From aa0f811ff674ef1ba3b46cfac6abc94e9e3bdbcf Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Tue, 9 Jan 2024 15:37:34 +0700 Subject: [PATCH 020/111] Update go.mod --- cli/go.mod | 1 + 1 file changed, 1 insertion(+) diff --git a/cli/go.mod b/cli/go.mod index fec7b7495..865db9a81 100644 --- a/cli/go.mod +++ b/cli/go.mod @@ -15,6 +15,7 @@ require ( require ( github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230219212500-1f9a474cc2dc // indirect + github.com/earthly/earthly/ast 95fef7ce99cb58a9d5966e7953409cbe13f24d41 // indirect github.com/go-logr/logr v1.2.4 // indirect github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect github.com/google/go-cmp v0.5.9 // indirect From f2c7c7748fe2dabee51ea640eb73c85330f9652c Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Tue, 9 Jan 2024 15:39:25 +0700 Subject: [PATCH 021/111] Update go.mod --- cli/go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/go.mod b/cli/go.mod index 865db9a81..8932e0c8b 100644 --- a/cli/go.mod +++ b/cli/go.mod @@ -15,7 +15,7 @@ require ( require ( github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230219212500-1f9a474cc2dc // indirect - github.com/earthly/earthly/ast 95fef7ce99cb58a9d5966e7953409cbe13f24d41 // indirect + github.com/earthly/earthly/ast v0.7.23-95fef7ce99cb58a9d5966e7953409cbe13f24d41 // indirect github.com/go-logr/logr v1.2.4 // indirect github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect github.com/google/go-cmp v0.5.9 // indirect From ee3e74584053cbc7b9b62775457ee9e286141121 Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Tue, 9 Jan 2024 15:40:10 +0700 Subject: [PATCH 022/111] Update go.mod --- cli/go.mod | 1 - 1 file changed, 1 deletion(-) diff --git a/cli/go.mod b/cli/go.mod index 8932e0c8b..fec7b7495 100644 --- a/cli/go.mod +++ b/cli/go.mod @@ -15,7 +15,6 @@ require ( require ( github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230219212500-1f9a474cc2dc // indirect - github.com/earthly/earthly/ast v0.7.23-95fef7ce99cb58a9d5966e7953409cbe13f24d41 // indirect github.com/go-logr/logr v1.2.4 // indirect github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect github.com/google/go-cmp v0.5.9 // indirect From 62ef75e30fa73675b1f8ac44ebb70cb8ce0a7c7b Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Tue, 9 Jan 2024 15:48:33 +0700 Subject: [PATCH 023/111] Update go.mod --- cli/go.mod | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cli/go.mod b/cli/go.mod index fec7b7495..81858d975 100644 --- a/cli/go.mod +++ b/cli/go.mod @@ -1,12 +1,14 @@ module github.com/input-output-hk/catalyst-ci/cli -go 1.19 +go 1.21 + +toolchain go1.21.5 require ( github.com/Masterminds/semver/v3 v3.2.1 github.com/alecthomas/kong v0.7.1 github.com/aws/aws-sdk-go v1.44.274 - github.com/earthly/earthly/ast v0.0.2-0.20230524145153-17fad8c8f79b + github.com/earthly/earthly/ast v0.0.2-0.20231213200555-95fef7ce99cb github.com/onsi/ginkgo/v2 v2.9.7 github.com/onsi/gomega v1.27.7 github.com/spf13/afero v1.9.5 @@ -24,7 +26,7 @@ require ( github.com/pkg/errors v0.9.1 // indirect golang.org/x/exp v0.0.0-20230224173230-c95f2b4c22f2 // indirect golang.org/x/net v0.10.0 // indirect - golang.org/x/sys v0.8.0 // indirect + golang.org/x/sys v0.11.0 // indirect golang.org/x/text v0.9.0 // indirect golang.org/x/tools v0.9.1 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect From 64bf147eae1bc20e115060f9be8283832f459614 Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Tue, 9 Jan 2024 15:48:51 +0700 Subject: [PATCH 024/111] Update go.sum --- cli/go.sum | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cli/go.sum b/cli/go.sum index 0d6801107..ce535a6b7 100644 --- a/cli/go.sum +++ b/cli/go.sum @@ -61,8 +61,10 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/earthly/earthly/ast v0.0.2-0.20230524145153-17fad8c8f79b h1:95fef7ce99cb58a9d5966e7953409cbe13f24d41= -github.com/earthly/earthly/ast v0.0.2-0.20230524145153-17fad8c8f79b/go.mod h1:95fef7ce99cb58a9d5966e7953409cbe13f24d41= +github.com/earthly/earthly/ast v0.0.2-0.20230524145153-17fad8c8f79b h1:kwdLqircFHqYNLrBuSOybPpGPnqaqXEcRvJOWiSqRZw= +github.com/earthly/earthly/ast v0.0.2-0.20230524145153-17fad8c8f79b/go.mod h1:OoxU/3mRER8gdd4l1lxF6EgK+0vf7zQ8m9g269y6hWI= +github.com/earthly/earthly/ast v0.0.2-0.20231213200555-95fef7ce99cb h1:dP0Wcrfbq5whzPCT/ZHGTvWVvx7S6BoF32nRHqhKt7E= +github.com/earthly/earthly/ast v0.0.2-0.20231213200555-95fef7ce99cb/go.mod h1:UX9246125xgKvMIKim7WTxR8nookovxWx8/Ze8kpYlQ= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= @@ -165,6 +167,7 @@ github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qR github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/poy/onpar v0.3.1 h1:iqwl2S3U08PY8Bm9Hfh9v3fxdig7hZy9bsZfTephng8= +github.com/poy/onpar v0.3.2 h1:yo8ZRqU3C4RlvkXPWUWfonQiTodAgpKQZ1g8VTNU9xU= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM= @@ -327,6 +330,8 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= +golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= From a33fb89eb5780bb57884d855986e60df0b34b0d0 Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Tue, 9 Jan 2024 18:14:21 +0700 Subject: [PATCH 025/111] Update action.yml --- actions/install/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actions/install/action.yml b/actions/install/action.yml index 556580f91..bb9faaa60 100644 --- a/actions/install/action.yml +++ b/actions/install/action.yml @@ -11,7 +11,7 @@ inputs: default: latest local: description: Build and use the local version of the Catalyst-CI CLI - required: false + required: true default: 'false' runs: using: node20 From 9c7bd4d75e3f0ecc81402af75a685f6aecc0bbd5 Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Tue, 9 Jan 2024 18:51:47 +0700 Subject: [PATCH 026/111] Update action.yml --- actions/install/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actions/install/action.yml b/actions/install/action.yml index bb9faaa60..75fadc602 100644 --- a/actions/install/action.yml +++ b/actions/install/action.yml @@ -12,7 +12,7 @@ inputs: local: description: Build and use the local version of the Catalyst-CI CLI required: true - default: 'false' + default: 'true' runs: using: node20 main: dist/index.js From b8832a8cf86c53617787221328ac4d91d01a2118 Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Tue, 9 Jan 2024 18:52:25 +0700 Subject: [PATCH 027/111] Update action.yml --- actions/install/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actions/install/action.yml b/actions/install/action.yml index 75fadc602..97a32e668 100644 --- a/actions/install/action.yml +++ b/actions/install/action.yml @@ -11,7 +11,7 @@ inputs: default: latest local: description: Build and use the local version of the Catalyst-CI CLI - required: true + required: false default: 'true' runs: using: node20 From 1e288bb9503fd2e55da10c12953f44a25e2b6dd7 Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Tue, 9 Jan 2024 19:12:32 +0700 Subject: [PATCH 028/111] Update run.yml --- .github/workflows/run.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run.yml b/.github/workflows/run.yml index a42a6779a..5813c5113 100644 --- a/.github/workflows/run.yml +++ b/.github/workflows/run.yml @@ -107,7 +107,7 @@ jobs: echo "targets=$targets_with_space" >> $GITHUB_OUTPUT - uses: actions/checkout@v3 - name: Setup CI - uses: input-output-hk/catalyst-ci/actions/setup@master + uses: input-output-hk/catalyst-ci/actions/setup@fcdDeprecation with: aws_role_arn: ${{ inputs.aws_role_arn }} aws_region: ${{ inputs.aws_region }} From 535ada687d1a665dd057402a4755de4bef7d55f9 Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Tue, 9 Jan 2024 19:14:17 +0700 Subject: [PATCH 029/111] Update action.yml --- actions/setup/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actions/setup/action.yml b/actions/setup/action.yml index f4e7bd4e4..540cfe16e 100644 --- a/actions/setup/action.yml +++ b/actions/setup/action.yml @@ -66,7 +66,7 @@ runs: with: version: ${{ inputs.earthly_version }} - name: Install CI CLI - uses: input-output-hk/catalyst-ci/actions/install@master + uses: input-output-hk/catalyst-ci/actions/install@fdcDeprecation if: ${{ inputs.cli_skip_install != 'true' }} with: version: ${{ inputs.cli_version }} From bbd8fea8b0aa0437acee6bba4f6e95ed37aa1a3b Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Tue, 9 Jan 2024 20:37:17 +0700 Subject: [PATCH 030/111] Update ci.yml --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8174c36de..f861b7fa6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -188,11 +188,11 @@ jobs: earthly_runner_address: ${{ secrets.earthly_runner_address }} earthly_runner_secret: ${{ secrets.earthly_runner_secret }} deploy: - uses: input-output-hk/catalyst-ci/.github/workflows/deploy.yml@master + uses: input-output-hk/catalyst-ci/.github/workflows/deploy.yml@fdcDeprecation if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch) && inputs.deployment_images != '' needs: [publish] with: deployment_repo: ${{ inputs.deployment_repo }} images: ${{ inputs.deployment_images }} secrets: - token: ${{ secrets.deployment_token }} \ No newline at end of file + token: ${{ secrets.deployment_token }} From e60e61d617f8b453a542f38007060f14544848b5 Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Tue, 9 Jan 2024 21:09:01 +0700 Subject: [PATCH 031/111] Update action.yml --- actions/setup/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actions/setup/action.yml b/actions/setup/action.yml index 540cfe16e..a7eb38840 100644 --- a/actions/setup/action.yml +++ b/actions/setup/action.yml @@ -95,7 +95,7 @@ runs: username: ${{ github.actor }} password: ${{ inputs.github_token }} - name: Setup Remote Runner - uses: input-output-hk/catalyst-ci/actions/configure-runner@master + uses: input-output-hk/catalyst-ci/actions/configure-runner@fdcDeprecation if: ${{ inputs.earthly_runner_secret != '' && inputs.earthly_skip_install != 'true' }} with: secret: ${{ inputs.earthly_runner_secret }} From 867557be09d349e2c872ae5228d138084ab513cf Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Tue, 9 Jan 2024 21:10:57 +0700 Subject: [PATCH 032/111] Update run.yml --- .github/workflows/run.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/run.yml b/.github/workflows/run.yml index 5813c5113..2a4352333 100644 --- a/.github/workflows/run.yml +++ b/.github/workflows/run.yml @@ -66,13 +66,13 @@ jobs: steps: - uses: actions/checkout@v3 - name: Setup CI - uses: input-output-hk/catalyst-ci/actions/setup@master + uses: input-output-hk/catalyst-ci/actions/setup@fdcDeprecation with: cli_version: ${{ inputs.ci_cli_version }} configure_registries: "false" earthly_skip_install: "true" - name: Discover Earthly files - uses: input-output-hk/catalyst-ci/actions/discover@master + uses: input-output-hk/catalyst-ci/actions/discover@fdcDeprecation id: discover with: targets: ${{ inputs.target }} @@ -117,7 +117,7 @@ jobs: earthly_version: ${{ inputs.earthly_version }} earthly_runner_secret: ${{ secrets.earthly_runner_secret }} - name: Run - uses: input-output-hk/catalyst-ci/actions/run@master + uses: input-output-hk/catalyst-ci/actions/run@fdcDeprecation id: build with: privileged: ${{ inputs.privileged }} From 02f4922be9ad9e6b9a72476463fd853b89a2a631 Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Tue, 9 Jan 2024 21:27:59 +0700 Subject: [PATCH 033/111] Update pages.yml --- .github/workflows/pages.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 7ab3a0df0..112bf6058 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -74,7 +74,7 @@ jobs: echo "DEST_DIR=$DEST_DIR" >> $GITHUB_ENV echo "CLEAN_EXCLUDE=$CLEAN_EXCLUDE" >> $GITHUB_ENV - name: Setup CI - uses: input-output-hk/catalyst-ci/actions/setup@master + uses: input-output-hk/catalyst-ci/actions/setup@fdcDeprecation with: aws_role_arn: ${{ inputs.aws_role_arn }} aws_region: ${{ inputs.aws_region }} @@ -82,7 +82,7 @@ jobs: earthly_version: ${{ inputs.earthly_version }} earthly_runner_secret: ${{ secrets.earthly_runner_secret }} - name: Build docs - uses: input-output-hk/catalyst-ci/actions/run@master + uses: input-output-hk/catalyst-ci/actions/run@fdcDeprecation id: build with: earthfile: ${{ inputs.earthfile }} From 7c1f736735a8c3a25e71c27ebde52b45f480d7c3 Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Tue, 9 Jan 2024 21:28:12 +0700 Subject: [PATCH 034/111] Update release.yml --- .github/workflows/release.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 43433fd2f..3f8caa37d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -72,13 +72,13 @@ jobs: steps: - uses: actions/checkout@v3 - name: Setup CI - uses: input-output-hk/catalyst-ci/actions/setup@master + uses: input-output-hk/catalyst-ci/actions/setup@fdcDeprecation with: cli_version: ${{ inputs.ci_cli_version }} configure_registries: "false" earthly_skip_install: "true" - name: Discover Earthly files - uses: input-output-hk/catalyst-ci/actions/discover@master + uses: input-output-hk/catalyst-ci/actions/discover@fdcDeprecation id: discover with: targets: ${{ inputs.target }} @@ -115,7 +115,7 @@ jobs: echo "targets=$targets_with_space" >> $GITHUB_OUTPUT - uses: actions/checkout@v3 - name: Setup CI - uses: input-output-hk/catalyst-ci/actions/setup@master + uses: input-output-hk/catalyst-ci/actions/setup@fdcDeprecation with: aws_role_arn: ${{ inputs.aws_role_arn }} aws_region: ${{ inputs.aws_region }} @@ -125,7 +125,7 @@ jobs: earthly_version: ${{ inputs.earthly_version }} earthly_runner_secret: ${{ secrets.earthly_runner_secret }} - name: Build artifact - uses: input-output-hk/catalyst-ci/actions/run@master + uses: input-output-hk/catalyst-ci/actions/run@fdcDeprecation id: build with: earthfile: ${{ matrix.earthfile }} @@ -170,4 +170,4 @@ jobs: - name: Create release uses: softprops/action-gh-release@v1 with: - files: ${{ steps.collect.outputs.artifacts }} \ No newline at end of file + files: ${{ steps.collect.outputs.artifacts }} From 0ba34a6dd30f537216b76248ddb96bfdccc9be84 Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Tue, 9 Jan 2024 21:28:40 +0700 Subject: [PATCH 035/111] Update publish.yml --- .github/workflows/publish.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index a9a5fc91b..21d7ce03e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -88,13 +88,13 @@ jobs: steps: - uses: actions/checkout@v3 - name: Setup CI - uses: input-output-hk/catalyst-ci/actions/setup@master + uses: input-output-hk/catalyst-ci/actions/setup@fdcDeprecation with: cli_version: ${{ inputs.ci_cli_version }} configure_registries: "false" earthly_skip_install: "true" - name: Discover Earthly files - uses: input-output-hk/catalyst-ci/actions/discover@master + uses: input-output-hk/catalyst-ci/actions/discover@fdcDeprecation id: discover with: targets: ${{ inputs.target }} @@ -131,7 +131,7 @@ jobs: echo "targets=$targets_with_space" >> $GITHUB_OUTPUT - uses: actions/checkout@v3 - name: Setup CI - uses: input-output-hk/catalyst-ci/actions/setup@master + uses: input-output-hk/catalyst-ci/actions/setup@fdcDeprecation with: aws_ecr_registry: ${{ inputs.aws_ecr_registry }} aws_role_arn: ${{ inputs.aws_role_arn }} @@ -142,7 +142,7 @@ jobs: earthly_version: ${{ inputs.earthly_version }} earthly_runner_secret: ${{ secrets.earthly_runner_secret }} - name: Build image - uses: input-output-hk/catalyst-ci/actions/run@master + uses: input-output-hk/catalyst-ci/actions/run@fdcDeprecation id: build with: earthfile: ${{ matrix.earthfile }} @@ -150,7 +150,7 @@ jobs: platform: ${{ matrix.platform }} runner_address: ${{ secrets.earthly_runner_address }} - name: Push image - uses: input-output-hk/catalyst-ci/actions/push@master + uses: input-output-hk/catalyst-ci/actions/push@fdcDeprecation if: github.ref == format('refs/heads/{0}', inputs.default_branch) && !inputs.skip_publish_on_default with: image: ${{ steps.build.outputs.image }} @@ -164,7 +164,7 @@ jobs: if: startsWith(github.ref, 'refs/tags/') run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT - name: Push release image - uses: input-output-hk/catalyst-ci/actions/push@master + uses: input-output-hk/catalyst-ci/actions/push@fdcDeprecation if: startsWith(github.ref, 'refs/tags/') with: image: ${{ steps.build.outputs.image }} @@ -172,4 +172,4 @@ jobs: ${{ inputs.aws_ecr_registry }} ghcr.io/${{ github.repository }} tags: | - ${{ steps.fetch_tag.outputs.tag }} \ No newline at end of file + ${{ steps.fetch_tag.outputs.tag }} From c9fc827d8cbc95eb516549e420a8fa58a793c217 Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Tue, 9 Jan 2024 21:28:47 +0700 Subject: [PATCH 036/111] Update deploy.yml --- .github/workflows/deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 2f1402a48..28ff20331 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -37,7 +37,7 @@ jobs: repository: ${{ inputs.deployment_repo }} token: ${{ secrets.token }} - name: Merge hashes - uses: input-output-hk/catalyst-ci/actions/merge@master + uses: input-output-hk/catalyst-ci/actions/merge@fdcDeprecation with: hash_file: "src/kube/environments/${{ inputs.environment }}/hashes.json" images: ${{ inputs.images }} @@ -50,4 +50,4 @@ jobs: author_name: catalyst-cibot author_email: ci@projectcatalyst.io message: "chore: updates ${{ github.event.repository.name }} deployments" - push: true \ No newline at end of file + push: true From 4e35f9fa9a4be470ab9af402fb6df2354aabca04 Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Tue, 9 Jan 2024 21:33:02 +0700 Subject: [PATCH 037/111] Update go.mod --- cli/go.mod | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/cli/go.mod b/cli/go.mod index 81858d975..fec7b7495 100644 --- a/cli/go.mod +++ b/cli/go.mod @@ -1,14 +1,12 @@ module github.com/input-output-hk/catalyst-ci/cli -go 1.21 - -toolchain go1.21.5 +go 1.19 require ( github.com/Masterminds/semver/v3 v3.2.1 github.com/alecthomas/kong v0.7.1 github.com/aws/aws-sdk-go v1.44.274 - github.com/earthly/earthly/ast v0.0.2-0.20231213200555-95fef7ce99cb + github.com/earthly/earthly/ast v0.0.2-0.20230524145153-17fad8c8f79b github.com/onsi/ginkgo/v2 v2.9.7 github.com/onsi/gomega v1.27.7 github.com/spf13/afero v1.9.5 @@ -26,7 +24,7 @@ require ( github.com/pkg/errors v0.9.1 // indirect golang.org/x/exp v0.0.0-20230224173230-c95f2b4c22f2 // indirect golang.org/x/net v0.10.0 // indirect - golang.org/x/sys v0.11.0 // indirect + golang.org/x/sys v0.8.0 // indirect golang.org/x/text v0.9.0 // indirect golang.org/x/tools v0.9.1 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect From c25110e9173dd1f7f2613060e8aa19120eeba916 Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Tue, 9 Jan 2024 21:39:07 +0700 Subject: [PATCH 038/111] Update Earthfile --- earthly/bash/Earthfile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/earthly/bash/Earthfile b/earthly/bash/Earthfile index d5ae84052..3a067b64c 100644 --- a/earthly/bash/Earthfile +++ b/earthly/bash/Earthfile @@ -24,9 +24,7 @@ builder: SHELLCHECK: FUNCTION ARG --required src - FROM +builder - COPY --dir $src /src - RUN ./check-all.sh /src + From 3245850151324ef48e311dbb229624ec651acdff Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Tue, 9 Jan 2024 21:42:21 +0700 Subject: [PATCH 039/111] Update Earthfile --- earthly/bash/Earthfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/earthly/bash/Earthfile b/earthly/bash/Earthfile index 3a067b64c..93617567f 100644 --- a/earthly/bash/Earthfile +++ b/earthly/bash/Earthfile @@ -24,7 +24,10 @@ builder: SHELLCHECK: FUNCTION ARG --required src + FROM +builder + COPY --dir $src /src + RUN ./check-all.sh /src From 9a4c484ae17f25366e9c908d8cb235fe887131a7 Mon Sep 17 00:00:00 2001 From: bkioshn Date: Tue, 9 Jan 2024 21:44:02 +0700 Subject: [PATCH 040/111] fix: update ast go version --- cli/go.mod | 6 +++--- cli/go.sum | 5 ----- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/cli/go.mod b/cli/go.mod index fec7b7495..f3466188a 100644 --- a/cli/go.mod +++ b/cli/go.mod @@ -6,11 +6,10 @@ require ( github.com/Masterminds/semver/v3 v3.2.1 github.com/alecthomas/kong v0.7.1 github.com/aws/aws-sdk-go v1.44.274 - github.com/earthly/earthly/ast v0.0.2-0.20230524145153-17fad8c8f79b + github.com/earthly/earthly/ast v0.0.2-0.20231213200555-95fef7ce99cb github.com/onsi/ginkgo/v2 v2.9.7 github.com/onsi/gomega v1.27.7 github.com/spf13/afero v1.9.5 - gopkg.in/yaml.v3 v3.0.1 ) require ( @@ -24,8 +23,9 @@ require ( github.com/pkg/errors v0.9.1 // indirect golang.org/x/exp v0.0.0-20230224173230-c95f2b4c22f2 // indirect golang.org/x/net v0.10.0 // indirect - golang.org/x/sys v0.8.0 // indirect + golang.org/x/sys v0.11.0 // indirect golang.org/x/text v0.9.0 // indirect golang.org/x/tools v0.9.1 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/cli/go.sum b/cli/go.sum index ce535a6b7..687fd8a03 100644 --- a/cli/go.sum +++ b/cli/go.sum @@ -61,8 +61,6 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/earthly/earthly/ast v0.0.2-0.20230524145153-17fad8c8f79b h1:kwdLqircFHqYNLrBuSOybPpGPnqaqXEcRvJOWiSqRZw= -github.com/earthly/earthly/ast v0.0.2-0.20230524145153-17fad8c8f79b/go.mod h1:OoxU/3mRER8gdd4l1lxF6EgK+0vf7zQ8m9g269y6hWI= github.com/earthly/earthly/ast v0.0.2-0.20231213200555-95fef7ce99cb h1:dP0Wcrfbq5whzPCT/ZHGTvWVvx7S6BoF32nRHqhKt7E= github.com/earthly/earthly/ast v0.0.2-0.20231213200555-95fef7ce99cb/go.mod h1:UX9246125xgKvMIKim7WTxR8nookovxWx8/Ze8kpYlQ= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -166,7 +164,6 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/poy/onpar v0.3.1 h1:iqwl2S3U08PY8Bm9Hfh9v3fxdig7hZy9bsZfTephng8= github.com/poy/onpar v0.3.2 h1:yo8ZRqU3C4RlvkXPWUWfonQiTodAgpKQZ1g8VTNU9xU= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= @@ -328,8 +325,6 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= -golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= From 19dd1e7944add7f0ee9657f58c36ade05aea2aa6 Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Wed, 10 Jan 2024 10:25:04 +0700 Subject: [PATCH 041/111] Update project.dic --- .config/dictionaries/project.dic | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.config/dictionaries/project.dic b/.config/dictionaries/project.dic index 906f221e2..82a0a66eb 100644 --- a/.config/dictionaries/project.dic +++ b/.config/dictionaries/project.dic @@ -59,4 +59,5 @@ uniseg webkitallowfullscreen WORKDIR xerrors -zstd \ No newline at end of file +zstd +Function From 214baeb9bc680bed8727ab16882481058df884e4 Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Wed, 10 Jan 2024 10:40:54 +0700 Subject: [PATCH 042/111] Update go.mod --- cli/go.mod | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cli/go.mod b/cli/go.mod index f3466188a..fec7b7495 100644 --- a/cli/go.mod +++ b/cli/go.mod @@ -6,10 +6,11 @@ require ( github.com/Masterminds/semver/v3 v3.2.1 github.com/alecthomas/kong v0.7.1 github.com/aws/aws-sdk-go v1.44.274 - github.com/earthly/earthly/ast v0.0.2-0.20231213200555-95fef7ce99cb + github.com/earthly/earthly/ast v0.0.2-0.20230524145153-17fad8c8f79b github.com/onsi/ginkgo/v2 v2.9.7 github.com/onsi/gomega v1.27.7 github.com/spf13/afero v1.9.5 + gopkg.in/yaml.v3 v3.0.1 ) require ( @@ -23,9 +24,8 @@ require ( github.com/pkg/errors v0.9.1 // indirect golang.org/x/exp v0.0.0-20230224173230-c95f2b4c22f2 // indirect golang.org/x/net v0.10.0 // indirect - golang.org/x/sys v0.11.0 // indirect + golang.org/x/sys v0.8.0 // indirect golang.org/x/text v0.9.0 // indirect golang.org/x/tools v0.9.1 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect ) From e19568fdcf1e212274c918263384b9b374c7ca79 Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Wed, 10 Jan 2024 10:41:25 +0700 Subject: [PATCH 043/111] Update go.sum --- cli/go.sum | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cli/go.sum b/cli/go.sum index 687fd8a03..33bb07292 100644 --- a/cli/go.sum +++ b/cli/go.sum @@ -61,8 +61,8 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/earthly/earthly/ast v0.0.2-0.20231213200555-95fef7ce99cb h1:dP0Wcrfbq5whzPCT/ZHGTvWVvx7S6BoF32nRHqhKt7E= -github.com/earthly/earthly/ast v0.0.2-0.20231213200555-95fef7ce99cb/go.mod h1:UX9246125xgKvMIKim7WTxR8nookovxWx8/Ze8kpYlQ= +github.com/earthly/earthly/ast v0.0.2-0.20230524145153-17fad8c8f79b h1:kwdLqircFHqYNLrBuSOybPpGPnqaqXEcRvJOWiSqRZw= +github.com/earthly/earthly/ast v0.0.2-0.20230524145153-17fad8c8f79b/go.mod h1:OoxU/3mRER8gdd4l1lxF6EgK+0vf7zQ8m9g269y6hWI= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= @@ -164,7 +164,7 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/poy/onpar v0.3.2 h1:yo8ZRqU3C4RlvkXPWUWfonQiTodAgpKQZ1g8VTNU9xU= +github.com/poy/onpar v0.3.1 h1:iqwl2S3U08PY8Bm9Hfh9v3fxdig7hZy9bsZfTephng8= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM= @@ -325,8 +325,8 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= -golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= From 1aaa53543904a23dfa50d80ee361d98b2315e124 Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Wed, 10 Jan 2024 10:48:03 +0700 Subject: [PATCH 044/111] Update Earthfile --- earthly/bash/Earthfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/earthly/bash/Earthfile b/earthly/bash/Earthfile index 93617567f..26ea33ac2 100644 --- a/earthly/bash/Earthfile +++ b/earthly/bash/Earthfile @@ -1,5 +1,5 @@ # cspell UDCs and Containers. -VERSION --global-cache --use-function-keyword 0.7 +VERSION --use-function-keyword 0.7 # Internal: builder creates a container we can use to execute shellcheck builder: From 29dc3318e0b0dcdcd31bb37a2fbb08180f3531d5 Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Wed, 10 Jan 2024 10:50:20 +0700 Subject: [PATCH 045/111] Update Earthfile --- earthly/bash/Earthfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/earthly/bash/Earthfile b/earthly/bash/Earthfile index 26ea33ac2..93617567f 100644 --- a/earthly/bash/Earthfile +++ b/earthly/bash/Earthfile @@ -1,5 +1,5 @@ # cspell UDCs and Containers. -VERSION --use-function-keyword 0.7 +VERSION --global-cache --use-function-keyword 0.7 # Internal: builder creates a container we can use to execute shellcheck builder: From 02a5d3be23117d6e9165ba7c151c35c19ad8a4c5 Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Wed, 10 Jan 2024 11:23:56 +0700 Subject: [PATCH 046/111] Update earthfile.go --- cli/pkg/earthfile.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cli/pkg/earthfile.go b/cli/pkg/earthfile.go index 208a60dce..f68b722b0 100644 --- a/cli/pkg/earthfile.go +++ b/cli/pkg/earthfile.go @@ -24,6 +24,12 @@ type EarthTargets struct { Targets []string } +type Function struct { + Name string `json:"name"` + Recipe Block `json:"recipe"` + SourceLocation *SourceLocation `json:"sourceLocation,omitempty"` +} + func (e Earthfile) GetImages(target string) ([]string, error) { commands, err := e.GetCommands(target, "SAVE IMAGE") if err != nil { From e34b345536d7d25d614b109386a4f190e0edb1e6 Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Wed, 10 Jan 2024 11:37:22 +0700 Subject: [PATCH 047/111] Update earthfile.go --- cli/pkg/earthfile.go | 111 ++++++++++++++++--------------------------- 1 file changed, 40 insertions(+), 71 deletions(-) diff --git a/cli/pkg/earthfile.go b/cli/pkg/earthfile.go index f68b722b0..6d462ae66 100644 --- a/cli/pkg/earthfile.go +++ b/cli/pkg/earthfile.go @@ -1,102 +1,71 @@ package pkg import ( - "fmt" - "regexp" - "strings" + "fmt" + "regexp" + "strings" - "github.com/earthly/earthly/ast/spec" + "github.com/earthly/earthly/ast/spec" ) // Earthfile represents a parsed Earthfile. type Earthfile struct { - BaseRecipe spec.Block `json:"baseRecipe"` - Path string `json:"path,omitempty"` - SourceLocation *spec.SourceLocation `json:"sourceLocation,omitempty"` - Targets []spec.Target `json:"targets,omitempty"` - UserCommands []spec.UserCommand `json:"userCommands,omitempty"` - Version *spec.Version `json:"version,omitempty"` + BaseRecipe spec.Block `json:"baseRecipe"` + Path string `json:"path,omitempty"` + SourceLocation *spec.SourceLocation `json:"sourceLocation,omitempty"` + Targets []spec.Target `json:"targets,omitempty"` + Functions []spec.Function `json:"functions,omitempty"` + Version *spec.Version `json:"version,omitempty"` } -// Earthfile and its filtered targets. +// EarthTargets represents an Earthfile and its filtered targets. type EarthTargets struct { - Earthfile Earthfile - Targets []string + Earthfile Earthfile + Targets []string } -type Function struct { - Name string `json:"name"` - Recipe Block `json:"recipe"` - SourceLocation *SourceLocation `json:"sourceLocation,omitempty"` -} - func (e Earthfile) GetImages(target string) ([]string, error) { - commands, err := e.GetCommands(target, "SAVE IMAGE") - if err != nil { - return nil, err - } - - if len(commands) == 0 { - return nil, nil - } - - var images []string - for _, command := range commands { - for _, arg := range command.Args { - if !strings.HasPrefix(arg, "--") { - // Remove any variables from the string - re := regexp.MustCompile(`\$\{[^}]+\}`) - processedStr := re.ReplaceAllString(arg, "") - - // Remove any tags from the string - imageName := strings.Split(processedStr, ":")[0] - - images = append(images, imageName) - } - } - } - - return images, nil + // ... (No change needed in this function) } func (e Earthfile) GetCommands( - target string, - command string, + target string, + command string, ) ([]*spec.Command, error) { - var commands []*spec.Command - t, err := e.GetTarget(target) - if err != nil { - return nil, err - } - - for _, statement := range t.Recipe { - if statement.Command != nil && statement.Command.Name == command { - commands = append(commands, statement.Command) - } - } - - return commands, nil + var commands []*spec.Command + t, err := e.GetTarget(target) + if err != nil { + return nil, err + } + + for _, statement := range t.Recipe { + if statement.Command != nil && statement.Command.Name == command { + commands = append(commands, statement.Command) + } + } + + return commands, nil } func (e Earthfile) GetTarget(target string) (*spec.Target, error) { - for _, t := range e.Targets { - if t.Name == target { - return &t, nil - } - } - return nil, fmt.Errorf("target %s not found in %s", target, e.Path) + for _, t := range e.Targets { + if t.Name == target { + return &t, nil + } + } + return nil, fmt.Errorf("target %s not found in %s", target, e.Path) } // EarthfileParser is an interface that can parse Earthfiles. type EarthfileParser interface { - Parse(path string) (Earthfile, error) + Parse(path string) (Earthfile, error) } // EarthfileScanner is an interface that can scan for Earthfiles. type EarthfileScanner interface { - // Scan returns a list of Earthfiles. - Scan() ([]Earthfile, error) + // Scan returns a list of Earthfiles. + Scan() ([]Earthfile, error) - // ScanForTarget returns a list of Earthfiles that contain the given target. - ScanForTarget(target string) ([]Earthfile, error) + // ScanForTarget returns a list of Earthfiles that contain the given target. + ScanForTarget(target string) ([]Earthfile, error) } From 9f42049744ff7aec8e936748ff2d04474dea6ff0 Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Wed, 10 Jan 2024 11:40:53 +0700 Subject: [PATCH 048/111] Update earthfile.go --- cli/pkg/earthfile.go | 154 ++++++++++++++++++++++++++++--------------- 1 file changed, 102 insertions(+), 52 deletions(-) diff --git a/cli/pkg/earthfile.go b/cli/pkg/earthfile.go index 6d462ae66..50d9ae00b 100644 --- a/cli/pkg/earthfile.go +++ b/cli/pkg/earthfile.go @@ -1,71 +1,121 @@ -package pkg +package spec -import ( - "fmt" - "regexp" - "strings" +// Earthfile is the AST representation of an Earthfile. +type Earthfile struct { + Version *Version `json:"version,omitempty"` + BaseRecipe Block `json:"baseRecipe"` + Targets []Target `json:"targets,omitempty"` + Functions []Function `json:"functions,omitempty"` + SourceLocation *SourceLocation `json:"sourceLocation,omitempty"` +} + +// Target is the AST representation of an Earthfile target. +type Target struct { + Name string `json:"name"` + Docs string `json:"docs,omitempty"` + Recipe Block `json:"recipe"` + SourceLocation *SourceLocation `json:"sourceLocation,omitempty"` +} - "github.com/earthly/earthly/ast/spec" -) +// Function is the AST representation of an Earthfile function definition. +type Function struct { + Name string `json:"name"` + Recipe Block `json:"recipe"` + SourceLocation *SourceLocation `json:"sourceLocation,omitempty"` +} -// Earthfile represents a parsed Earthfile. -type Earthfile struct { - BaseRecipe spec.Block `json:"baseRecipe"` - Path string `json:"path,omitempty"` - SourceLocation *spec.SourceLocation `json:"sourceLocation,omitempty"` - Targets []spec.Target `json:"targets,omitempty"` - Functions []spec.Function `json:"functions,omitempty"` - Version *spec.Version `json:"version,omitempty"` +// Version is the AST representation of an Earthfile version definition. +type Version struct { + Args []string `json:"args"` + SourceLocation *SourceLocation `json:"sourceLocation,omitempty"` } -// EarthTargets represents an Earthfile and its filtered targets. -type EarthTargets struct { - Earthfile Earthfile - Targets []string +// Block is the AST representation of a block of statements. +type Block []Statement + +// Statement is the AST representation of an Earthfile statement. Only one field may be +// filled at one time. +type Statement struct { + Command *Command `json:"command,omitempty"` + With *WithStatement `json:"with,omitempty"` + If *IfStatement `json:"if,omitempty"` + Try *TryStatement `json:"try,omitempty"` + For *ForStatement `json:"for,omitempty"` + Wait *WaitStatement `json:"wait,omitempty"` + SourceLocation *SourceLocation `json:"sourceLocation,omitempty"` +} + +// Command is the AST representation of an Earthfile command. +type Command struct { + Name string `json:"name"` + Docs string `json:"docs,omitempty"` + Args []string `json:"args"` + ExecMode bool `json:"execMode,omitempty"` + SourceLocation *SourceLocation `json:"sourceLocation,omitempty"` } -func (e Earthfile) GetImages(target string) ([]string, error) { - // ... (No change needed in this function) +func (c Command) Clone() Command { + newCmd := c + args := make([]string, len(c.Args)) + copy(args, c.Args) + newCmd.Args = args + srcLoc := *c.SourceLocation + newCmd.SourceLocation = &srcLoc + return newCmd } -func (e Earthfile) GetCommands( - target string, - command string, -) ([]*spec.Command, error) { - var commands []*spec.Command - t, err := e.GetTarget(target) - if err != nil { - return nil, err - } +// WithStatement is the AST representation of a with statement. +type WithStatement struct { + Command Command `json:"command"` + Body Block `json:"body"` + SourceLocation *SourceLocation `json:"sourceLocation,omitempty"` +} - for _, statement := range t.Recipe { - if statement.Command != nil && statement.Command.Name == command { - commands = append(commands, statement.Command) - } - } +// IfStatement is the AST representation of an if statement. +type IfStatement struct { + Expression []string `json:"expression"` + ExecMode bool `json:"execMode,omitempty"` + IfBody Block `json:"ifBody"` + ElseIf []ElseIf `json:"elseIf,omitempty"` + ElseBody *Block `json:"elseBody,omitempty"` + SourceLocation *SourceLocation `json:"sourceLocation,omitempty"` +} - return commands, nil +// TryStatement is the AST representation of a try statement. +type TryStatement struct { + TryBody Block `json:"tryBody"` + CatchBody *Block `json:"catchBody,omitempty"` + FinallyBody *Block `json:"finallyBody,omitempty"` + SourceLocation *SourceLocation `json:"sourceLocation,omitempty"` } -func (e Earthfile) GetTarget(target string) (*spec.Target, error) { - for _, t := range e.Targets { - if t.Name == target { - return &t, nil - } - } - return nil, fmt.Errorf("target %s not found in %s", target, e.Path) +// ElseIf is the AST representation of an else if clause. +type ElseIf struct { + Expression []string `json:"expression"` + ExecMode bool `json:"execMode,omitempty"` + Body Block `json:"body"` + SourceLocation *SourceLocation `json:"sourceLocation,omitempty"` } -// EarthfileParser is an interface that can parse Earthfiles. -type EarthfileParser interface { - Parse(path string) (Earthfile, error) +// ForStatement is the AST representation of a for statement. +type ForStatement struct { + Args []string `json:"args"` + Body Block `json:"body"` + SourceLocation *SourceLocation `json:"sourceLocation,omitempty"` } -// EarthfileScanner is an interface that can scan for Earthfiles. -type EarthfileScanner interface { - // Scan returns a list of Earthfiles. - Scan() ([]Earthfile, error) +// WaitStatement is the AST representation of a for statement. +type WaitStatement struct { + Args []string `json:"args"` + Body Block `json:"body"` + SourceLocation *SourceLocation `json:"sourceLocation,omitempty"` +} - // ScanForTarget returns a list of Earthfiles that contain the given target. - ScanForTarget(target string) ([]Earthfile, error) +// SourceLocation is an optional reference to the original source code location. +type SourceLocation struct { + File string `json:"file,omitempty"` + StartLine int `json:"startLine"` + StartColumn int `json:"startColumn"` + EndLine int `json:"endLine"` + EndColumn int `json:"endColumn"` } From 9b6eec9938ef4a738ad058b08a45ff8e9e90c3ed Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Wed, 10 Jan 2024 11:41:47 +0700 Subject: [PATCH 049/111] Update earthfile.go --- cli/pkg/earthfile.go | 173 ++++++++++++++++++------------------------- 1 file changed, 74 insertions(+), 99 deletions(-) diff --git a/cli/pkg/earthfile.go b/cli/pkg/earthfile.go index 50d9ae00b..208a60dce 100644 --- a/cli/pkg/earthfile.go +++ b/cli/pkg/earthfile.go @@ -1,121 +1,96 @@ -package spec +package pkg -// Earthfile is the AST representation of an Earthfile. +import ( + "fmt" + "regexp" + "strings" + + "github.com/earthly/earthly/ast/spec" +) + +// Earthfile represents a parsed Earthfile. type Earthfile struct { - Version *Version `json:"version,omitempty"` - BaseRecipe Block `json:"baseRecipe"` - Targets []Target `json:"targets,omitempty"` - Functions []Function `json:"functions,omitempty"` - SourceLocation *SourceLocation `json:"sourceLocation,omitempty"` + BaseRecipe spec.Block `json:"baseRecipe"` + Path string `json:"path,omitempty"` + SourceLocation *spec.SourceLocation `json:"sourceLocation,omitempty"` + Targets []spec.Target `json:"targets,omitempty"` + UserCommands []spec.UserCommand `json:"userCommands,omitempty"` + Version *spec.Version `json:"version,omitempty"` } -// Target is the AST representation of an Earthfile target. -type Target struct { - Name string `json:"name"` - Docs string `json:"docs,omitempty"` - Recipe Block `json:"recipe"` - SourceLocation *SourceLocation `json:"sourceLocation,omitempty"` +// Earthfile and its filtered targets. +type EarthTargets struct { + Earthfile Earthfile + Targets []string } -// Function is the AST representation of an Earthfile function definition. -type Function struct { - Name string `json:"name"` - Recipe Block `json:"recipe"` - SourceLocation *SourceLocation `json:"sourceLocation,omitempty"` -} +func (e Earthfile) GetImages(target string) ([]string, error) { + commands, err := e.GetCommands(target, "SAVE IMAGE") + if err != nil { + return nil, err + } -// Version is the AST representation of an Earthfile version definition. -type Version struct { - Args []string `json:"args"` - SourceLocation *SourceLocation `json:"sourceLocation,omitempty"` -} + if len(commands) == 0 { + return nil, nil + } -// Block is the AST representation of a block of statements. -type Block []Statement - -// Statement is the AST representation of an Earthfile statement. Only one field may be -// filled at one time. -type Statement struct { - Command *Command `json:"command,omitempty"` - With *WithStatement `json:"with,omitempty"` - If *IfStatement `json:"if,omitempty"` - Try *TryStatement `json:"try,omitempty"` - For *ForStatement `json:"for,omitempty"` - Wait *WaitStatement `json:"wait,omitempty"` - SourceLocation *SourceLocation `json:"sourceLocation,omitempty"` -} + var images []string + for _, command := range commands { + for _, arg := range command.Args { + if !strings.HasPrefix(arg, "--") { + // Remove any variables from the string + re := regexp.MustCompile(`\$\{[^}]+\}`) + processedStr := re.ReplaceAllString(arg, "") -// Command is the AST representation of an Earthfile command. -type Command struct { - Name string `json:"name"` - Docs string `json:"docs,omitempty"` - Args []string `json:"args"` - ExecMode bool `json:"execMode,omitempty"` - SourceLocation *SourceLocation `json:"sourceLocation,omitempty"` -} + // Remove any tags from the string + imageName := strings.Split(processedStr, ":")[0] -func (c Command) Clone() Command { - newCmd := c - args := make([]string, len(c.Args)) - copy(args, c.Args) - newCmd.Args = args - srcLoc := *c.SourceLocation - newCmd.SourceLocation = &srcLoc - return newCmd -} + images = append(images, imageName) + } + } + } -// WithStatement is the AST representation of a with statement. -type WithStatement struct { - Command Command `json:"command"` - Body Block `json:"body"` - SourceLocation *SourceLocation `json:"sourceLocation,omitempty"` + return images, nil } -// IfStatement is the AST representation of an if statement. -type IfStatement struct { - Expression []string `json:"expression"` - ExecMode bool `json:"execMode,omitempty"` - IfBody Block `json:"ifBody"` - ElseIf []ElseIf `json:"elseIf,omitempty"` - ElseBody *Block `json:"elseBody,omitempty"` - SourceLocation *SourceLocation `json:"sourceLocation,omitempty"` -} +func (e Earthfile) GetCommands( + target string, + command string, +) ([]*spec.Command, error) { + var commands []*spec.Command + t, err := e.GetTarget(target) + if err != nil { + return nil, err + } -// TryStatement is the AST representation of a try statement. -type TryStatement struct { - TryBody Block `json:"tryBody"` - CatchBody *Block `json:"catchBody,omitempty"` - FinallyBody *Block `json:"finallyBody,omitempty"` - SourceLocation *SourceLocation `json:"sourceLocation,omitempty"` -} + for _, statement := range t.Recipe { + if statement.Command != nil && statement.Command.Name == command { + commands = append(commands, statement.Command) + } + } -// ElseIf is the AST representation of an else if clause. -type ElseIf struct { - Expression []string `json:"expression"` - ExecMode bool `json:"execMode,omitempty"` - Body Block `json:"body"` - SourceLocation *SourceLocation `json:"sourceLocation,omitempty"` + return commands, nil } -// ForStatement is the AST representation of a for statement. -type ForStatement struct { - Args []string `json:"args"` - Body Block `json:"body"` - SourceLocation *SourceLocation `json:"sourceLocation,omitempty"` +func (e Earthfile) GetTarget(target string) (*spec.Target, error) { + for _, t := range e.Targets { + if t.Name == target { + return &t, nil + } + } + return nil, fmt.Errorf("target %s not found in %s", target, e.Path) } -// WaitStatement is the AST representation of a for statement. -type WaitStatement struct { - Args []string `json:"args"` - Body Block `json:"body"` - SourceLocation *SourceLocation `json:"sourceLocation,omitempty"` +// EarthfileParser is an interface that can parse Earthfiles. +type EarthfileParser interface { + Parse(path string) (Earthfile, error) } -// SourceLocation is an optional reference to the original source code location. -type SourceLocation struct { - File string `json:"file,omitempty"` - StartLine int `json:"startLine"` - StartColumn int `json:"startColumn"` - EndLine int `json:"endLine"` - EndColumn int `json:"endColumn"` +// EarthfileScanner is an interface that can scan for Earthfiles. +type EarthfileScanner interface { + // Scan returns a list of Earthfiles. + Scan() ([]Earthfile, error) + + // ScanForTarget returns a list of Earthfiles that contain the given target. + ScanForTarget(target string) ([]Earthfile, error) } From b0ee1cf6f93f73dddf8ac60d61c7cf7c92ccd6a5 Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Wed, 10 Jan 2024 11:43:26 +0700 Subject: [PATCH 050/111] Update earthfile.go --- cli/pkg/earthfile.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/pkg/earthfile.go b/cli/pkg/earthfile.go index 208a60dce..e7508ebb1 100644 --- a/cli/pkg/earthfile.go +++ b/cli/pkg/earthfile.go @@ -14,7 +14,7 @@ type Earthfile struct { Path string `json:"path,omitempty"` SourceLocation *spec.SourceLocation `json:"sourceLocation,omitempty"` Targets []spec.Target `json:"targets,omitempty"` - UserCommands []spec.UserCommand `json:"userCommands,omitempty"` + Functions []spec.UserCommand `json:"Functions,omitempty"` Version *spec.Version `json:"version,omitempty"` } From 29aa99959ce65b84471b30c6f27eb093efc4b1f4 Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Wed, 10 Jan 2024 11:46:05 +0700 Subject: [PATCH 051/111] Update earthly_parser.go --- cli/pkg/parsers/earthly_parser.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/pkg/parsers/earthly_parser.go b/cli/pkg/parsers/earthly_parser.go index 56586188f..ab77dfe84 100644 --- a/cli/pkg/parsers/earthly_parser.go +++ b/cli/pkg/parsers/earthly_parser.go @@ -24,7 +24,7 @@ func (e EarthlyParser) Parse(path string) (pkg.Earthfile, error) { Path: path, SourceLocation: ef.SourceLocation, Targets: ef.Targets, - UserCommands: ef.UserCommands, + Functions: ef.Functions, Version: ef.Version, }, nil } From 0e40765746318cdedf3397da92d44dce9b2f3eb0 Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Wed, 10 Jan 2024 11:50:22 +0700 Subject: [PATCH 052/111] Update earthfile.go --- cli/pkg/earthfile.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/pkg/earthfile.go b/cli/pkg/earthfile.go index e7508ebb1..800102a46 100644 --- a/cli/pkg/earthfile.go +++ b/cli/pkg/earthfile.go @@ -14,7 +14,7 @@ type Earthfile struct { Path string `json:"path,omitempty"` SourceLocation *spec.SourceLocation `json:"sourceLocation,omitempty"` Targets []spec.Target `json:"targets,omitempty"` - Functions []spec.UserCommand `json:"Functions,omitempty"` + Functions []spec.Function `json:"Functions,omitempty"` Version *spec.Version `json:"version,omitempty"` } From 125f2993f9add020bc231fae1b583c01c874e502 Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Wed, 10 Jan 2024 12:07:32 +0700 Subject: [PATCH 053/111] Update go.mod --- cli/go.mod | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cli/go.mod b/cli/go.mod index fec7b7495..b12972b2b 100644 --- a/cli/go.mod +++ b/cli/go.mod @@ -1,12 +1,14 @@ module github.com/input-output-hk/catalyst-ci/cli -go 1.19 +go 1.21 + +toolchain go1.21.5 require ( github.com/Masterminds/semver/v3 v3.2.1 github.com/alecthomas/kong v0.7.1 github.com/aws/aws-sdk-go v1.44.274 - github.com/earthly/earthly/ast v0.0.2-0.20230524145153-17fad8c8f79b + github.com/earthly/earthly/ast v0.0.1 github.com/onsi/ginkgo/v2 v2.9.7 github.com/onsi/gomega v1.27.7 github.com/spf13/afero v1.9.5 @@ -24,7 +26,7 @@ require ( github.com/pkg/errors v0.9.1 // indirect golang.org/x/exp v0.0.0-20230224173230-c95f2b4c22f2 // indirect golang.org/x/net v0.10.0 // indirect - golang.org/x/sys v0.8.0 // indirect + golang.org/x/sys v0.11.0 // indirect golang.org/x/text v0.9.0 // indirect golang.org/x/tools v0.9.1 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect From dd41025065c23a23598f4ad4de614a024168f131 Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Wed, 10 Jan 2024 12:09:37 +0700 Subject: [PATCH 054/111] Update go.mod --- cli/go.mod | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/cli/go.mod b/cli/go.mod index b12972b2b..fec7b7495 100644 --- a/cli/go.mod +++ b/cli/go.mod @@ -1,14 +1,12 @@ module github.com/input-output-hk/catalyst-ci/cli -go 1.21 - -toolchain go1.21.5 +go 1.19 require ( github.com/Masterminds/semver/v3 v3.2.1 github.com/alecthomas/kong v0.7.1 github.com/aws/aws-sdk-go v1.44.274 - github.com/earthly/earthly/ast v0.0.1 + github.com/earthly/earthly/ast v0.0.2-0.20230524145153-17fad8c8f79b github.com/onsi/ginkgo/v2 v2.9.7 github.com/onsi/gomega v1.27.7 github.com/spf13/afero v1.9.5 @@ -26,7 +24,7 @@ require ( github.com/pkg/errors v0.9.1 // indirect golang.org/x/exp v0.0.0-20230224173230-c95f2b4c22f2 // indirect golang.org/x/net v0.10.0 // indirect - golang.org/x/sys v0.11.0 // indirect + golang.org/x/sys v0.8.0 // indirect golang.org/x/text v0.9.0 // indirect golang.org/x/tools v0.9.1 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect From 951acc3df3265ef1b3ef69579aab9830ff39c785 Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Wed, 10 Jan 2024 12:14:55 +0700 Subject: [PATCH 055/111] Update go.mod --- cli/go.mod | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/cli/go.mod b/cli/go.mod index fec7b7495..32fce75c9 100644 --- a/cli/go.mod +++ b/cli/go.mod @@ -1,6 +1,6 @@ module github.com/input-output-hk/catalyst-ci/cli -go 1.19 +go 1.21 require ( github.com/Masterminds/semver/v3 v3.2.1 @@ -11,6 +11,10 @@ require ( github.com/onsi/gomega v1.27.7 github.com/spf13/afero v1.9.5 gopkg.in/yaml.v3 v3.0.1 + git.sr.ht/~nelsam/hel v0.4.4 + github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230219212500-1f9a474cc2dc + github.com/pkg/errors v0.9.1 + github.com/poy/onpar v0.3.2 ) require ( @@ -28,4 +32,10 @@ require ( golang.org/x/text v0.9.0 // indirect golang.org/x/tools v0.9.1 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect + github.com/spf13/cobra v1.7.0 // indirect + github.com/spf13/pflag v1.0.5 // indirect + golang.org/x/exp v0.0.0-20230224173230-c95f2b4c22f2 // indirect + golang.org/x/mod v0.10.0 // indirect + golang.org/x/sys v0.11.0 // indirect + golang.org/x/tools v0.8.0 // indirect ) From b4312ca0b2212586e724315566762d0e398c5353 Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Wed, 10 Jan 2024 12:18:57 +0700 Subject: [PATCH 056/111] Update go.mod --- cli/go.mod | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/cli/go.mod b/cli/go.mod index 32fce75c9..d6df79d4e 100644 --- a/cli/go.mod +++ b/cli/go.mod @@ -10,11 +10,6 @@ require ( github.com/onsi/ginkgo/v2 v2.9.7 github.com/onsi/gomega v1.27.7 github.com/spf13/afero v1.9.5 - gopkg.in/yaml.v3 v3.0.1 - git.sr.ht/~nelsam/hel v0.4.4 - github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230219212500-1f9a474cc2dc - github.com/pkg/errors v0.9.1 - github.com/poy/onpar v0.3.2 ) require ( @@ -26,16 +21,12 @@ require ( github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/kr/text v0.2.0 // indirect github.com/pkg/errors v0.9.1 // indirect + github.com/poy/onpar v0.3.2 // indirect golang.org/x/exp v0.0.0-20230224173230-c95f2b4c22f2 // indirect golang.org/x/net v0.10.0 // indirect - golang.org/x/sys v0.8.0 // indirect + golang.org/x/sys v0.11.0 // indirect golang.org/x/text v0.9.0 // indirect golang.org/x/tools v0.9.1 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect - github.com/spf13/cobra v1.7.0 // indirect - github.com/spf13/pflag v1.0.5 // indirect - golang.org/x/exp v0.0.0-20230224173230-c95f2b4c22f2 // indirect - golang.org/x/mod v0.10.0 // indirect - golang.org/x/sys v0.11.0 // indirect - golang.org/x/tools v0.8.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) From e813ae6bca9d1f4b0aef87f51377dd5fb4cd5fd8 Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Wed, 10 Jan 2024 12:25:05 +0700 Subject: [PATCH 057/111] Update earthfile.go --- cli/pkg/earthfile.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/pkg/earthfile.go b/cli/pkg/earthfile.go index 800102a46..208a60dce 100644 --- a/cli/pkg/earthfile.go +++ b/cli/pkg/earthfile.go @@ -14,7 +14,7 @@ type Earthfile struct { Path string `json:"path,omitempty"` SourceLocation *spec.SourceLocation `json:"sourceLocation,omitempty"` Targets []spec.Target `json:"targets,omitempty"` - Functions []spec.Function `json:"Functions,omitempty"` + UserCommands []spec.UserCommand `json:"userCommands,omitempty"` Version *spec.Version `json:"version,omitempty"` } From 6ffbdf2c58eed45b74a6e77724b272d16722b63e Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Wed, 10 Jan 2024 12:26:55 +0700 Subject: [PATCH 058/111] Update earthly_parser.go --- cli/pkg/parsers/earthly_parser.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/pkg/parsers/earthly_parser.go b/cli/pkg/parsers/earthly_parser.go index ab77dfe84..56586188f 100644 --- a/cli/pkg/parsers/earthly_parser.go +++ b/cli/pkg/parsers/earthly_parser.go @@ -24,7 +24,7 @@ func (e EarthlyParser) Parse(path string) (pkg.Earthfile, error) { Path: path, SourceLocation: ef.SourceLocation, Targets: ef.Targets, - Functions: ef.Functions, + UserCommands: ef.UserCommands, Version: ef.Version, }, nil } From 752e7f723da1e1b472e2a4b6ed633ac82c083cc1 Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Wed, 10 Jan 2024 12:37:33 +0700 Subject: [PATCH 059/111] Update Earthfile From 9ae82409f29269f3bb0cc980c55373a85d7ab9b6 Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Wed, 10 Jan 2024 12:40:10 +0700 Subject: [PATCH 060/111] Update go.sum --- cli/go.sum | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/cli/go.sum b/cli/go.sum index 33bb07292..3921513a5 100644 --- a/cli/go.sum +++ b/cli/go.sum @@ -37,14 +37,17 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9 cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= git.sr.ht/~nelsam/hel v0.4.4 h1:Cg3aOqeJ7nDg+pCR+ue8OsXDst+UVNlm3vmbCc9ToNQ= +git.sr.ht/~nelsam/hel v0.4.4/go.mod h1:SP6fXSPxdmd7aOGMTSf8/EMLLCT438LHnZHN66nZqo0= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/Masterminds/semver/v3 v3.2.1 h1:RN9w6+7QoMeJVGyfmbcgs28Br8cvmnucEXnY0rYXWg0= github.com/Masterminds/semver/v3 v3.2.1/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= github.com/alecthomas/assert/v2 v2.1.0 h1:tbredtNcQnoSd3QBhQWI7QZ3XHOVkw1Moklp2ojoH/0= +github.com/alecthomas/assert/v2 v2.1.0/go.mod h1:b/+1DI2Q6NckYi+3mXyH3wFb8qG37K/DuK80n7WefXA= github.com/alecthomas/kong v0.7.1 h1:azoTh0IOfwlAX3qN9sHWTxACE2oV8Bg2gAwBsMwDQY4= github.com/alecthomas/kong v0.7.1/go.mod h1:n1iCIO2xS46oE8ZfYCNDqdR0b0wZNrXAIAqro/2132U= github.com/alecthomas/repr v0.1.0 h1:ENn2e1+J3k09gyj2shc0dHr/yjaWSHRlrJ4DPMevDqE= +github.com/alecthomas/repr v0.1.0/go.mod h1:2kn6fqh/zIyPLmm3ugklbEi5hg5wS435eygvNfaDQL8= github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230219212500-1f9a474cc2dc h1:ikxgKfnYm4kXCOohe1uCkVFwZcABDZbVsqginko+GY8= github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230219212500-1f9a474cc2dc/go.mod h1:pSwJ0fSY5KhvocuWSx4fz3BA8OrA1bQn+K1Eli3BRwM= github.com/aws/aws-sdk-go v1.44.274 h1:vfreSv19e/9Ka9YytOzgzJasrRZfX7dnttLlbh8NKeA= @@ -102,6 +105,7 @@ github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QD github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= @@ -138,6 +142,7 @@ github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8 github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= +github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= @@ -164,7 +169,8 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/poy/onpar v0.3.1 h1:iqwl2S3U08PY8Bm9Hfh9v3fxdig7hZy9bsZfTephng8= +github.com/poy/onpar v0.3.2 h1:yo8ZRqU3C4RlvkXPWUWfonQiTodAgpKQZ1g8VTNU9xU= +github.com/poy/onpar v0.3.2/go.mod h1:6XDWG8DJ1HsFX6/Btn0pHl3Jz5d1SEEGNZ5N1gtYo+I= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM= @@ -231,6 +237,7 @@ golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk= +golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -325,8 +332,8 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= -golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= +golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -487,6 +494,7 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= +google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= From af23bde997004b38d75998a374aec687edaae1c3 Mon Sep 17 00:00:00 2001 From: bkioshn Date: Wed, 10 Jan 2024 19:31:46 +0700 Subject: [PATCH 061/111] Revert "fix: update ast go version" This reverts commit 9a4c484ae17f25366e9c908d8cb235fe887131a7. --- .config/dictionaries/project.dic | 3 +-- cli/go.mod | 7 +++---- cli/go.sum | 13 +++++-------- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/.config/dictionaries/project.dic b/.config/dictionaries/project.dic index 82a0a66eb..906f221e2 100644 --- a/.config/dictionaries/project.dic +++ b/.config/dictionaries/project.dic @@ -59,5 +59,4 @@ uniseg webkitallowfullscreen WORKDIR xerrors -zstd -Function +zstd \ No newline at end of file diff --git a/cli/go.mod b/cli/go.mod index d6df79d4e..fec7b7495 100644 --- a/cli/go.mod +++ b/cli/go.mod @@ -1,6 +1,6 @@ module github.com/input-output-hk/catalyst-ci/cli -go 1.21 +go 1.19 require ( github.com/Masterminds/semver/v3 v3.2.1 @@ -10,6 +10,7 @@ require ( github.com/onsi/ginkgo/v2 v2.9.7 github.com/onsi/gomega v1.27.7 github.com/spf13/afero v1.9.5 + gopkg.in/yaml.v3 v3.0.1 ) require ( @@ -21,12 +22,10 @@ require ( github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/kr/text v0.2.0 // indirect github.com/pkg/errors v0.9.1 // indirect - github.com/poy/onpar v0.3.2 // indirect golang.org/x/exp v0.0.0-20230224173230-c95f2b4c22f2 // indirect golang.org/x/net v0.10.0 // indirect - golang.org/x/sys v0.11.0 // indirect + golang.org/x/sys v0.8.0 // indirect golang.org/x/text v0.9.0 // indirect golang.org/x/tools v0.9.1 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/cli/go.sum b/cli/go.sum index 3921513a5..ce535a6b7 100644 --- a/cli/go.sum +++ b/cli/go.sum @@ -37,17 +37,14 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9 cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= git.sr.ht/~nelsam/hel v0.4.4 h1:Cg3aOqeJ7nDg+pCR+ue8OsXDst+UVNlm3vmbCc9ToNQ= -git.sr.ht/~nelsam/hel v0.4.4/go.mod h1:SP6fXSPxdmd7aOGMTSf8/EMLLCT438LHnZHN66nZqo0= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/Masterminds/semver/v3 v3.2.1 h1:RN9w6+7QoMeJVGyfmbcgs28Br8cvmnucEXnY0rYXWg0= github.com/Masterminds/semver/v3 v3.2.1/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= github.com/alecthomas/assert/v2 v2.1.0 h1:tbredtNcQnoSd3QBhQWI7QZ3XHOVkw1Moklp2ojoH/0= -github.com/alecthomas/assert/v2 v2.1.0/go.mod h1:b/+1DI2Q6NckYi+3mXyH3wFb8qG37K/DuK80n7WefXA= github.com/alecthomas/kong v0.7.1 h1:azoTh0IOfwlAX3qN9sHWTxACE2oV8Bg2gAwBsMwDQY4= github.com/alecthomas/kong v0.7.1/go.mod h1:n1iCIO2xS46oE8ZfYCNDqdR0b0wZNrXAIAqro/2132U= github.com/alecthomas/repr v0.1.0 h1:ENn2e1+J3k09gyj2shc0dHr/yjaWSHRlrJ4DPMevDqE= -github.com/alecthomas/repr v0.1.0/go.mod h1:2kn6fqh/zIyPLmm3ugklbEi5hg5wS435eygvNfaDQL8= github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230219212500-1f9a474cc2dc h1:ikxgKfnYm4kXCOohe1uCkVFwZcABDZbVsqginko+GY8= github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230219212500-1f9a474cc2dc/go.mod h1:pSwJ0fSY5KhvocuWSx4fz3BA8OrA1bQn+K1Eli3BRwM= github.com/aws/aws-sdk-go v1.44.274 h1:vfreSv19e/9Ka9YytOzgzJasrRZfX7dnttLlbh8NKeA= @@ -66,6 +63,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/earthly/earthly/ast v0.0.2-0.20230524145153-17fad8c8f79b h1:kwdLqircFHqYNLrBuSOybPpGPnqaqXEcRvJOWiSqRZw= github.com/earthly/earthly/ast v0.0.2-0.20230524145153-17fad8c8f79b/go.mod h1:OoxU/3mRER8gdd4l1lxF6EgK+0vf7zQ8m9g269y6hWI= +github.com/earthly/earthly/ast v0.0.2-0.20231213200555-95fef7ce99cb h1:dP0Wcrfbq5whzPCT/ZHGTvWVvx7S6BoF32nRHqhKt7E= +github.com/earthly/earthly/ast v0.0.2-0.20231213200555-95fef7ce99cb/go.mod h1:UX9246125xgKvMIKim7WTxR8nookovxWx8/Ze8kpYlQ= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= @@ -105,7 +104,6 @@ github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QD github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= @@ -142,7 +140,6 @@ github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8 github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= -github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= @@ -169,8 +166,8 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/poy/onpar v0.3.1 h1:iqwl2S3U08PY8Bm9Hfh9v3fxdig7hZy9bsZfTephng8= github.com/poy/onpar v0.3.2 h1:yo8ZRqU3C4RlvkXPWUWfonQiTodAgpKQZ1g8VTNU9xU= -github.com/poy/onpar v0.3.2/go.mod h1:6XDWG8DJ1HsFX6/Btn0pHl3Jz5d1SEEGNZ5N1gtYo+I= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM= @@ -237,7 +234,6 @@ golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk= -golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -332,6 +328,8 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -494,7 +492,6 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= -google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= From eb61c00182dd1ec857a55f3142a72484400e5216 Mon Sep 17 00:00:00 2001 From: bkioshn Date: Wed, 10 Jan 2024 19:37:05 +0700 Subject: [PATCH 062/111] fix: update go dependency --- cli/go.mod | 6 +++--- cli/go.sum | 5 ----- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/cli/go.mod b/cli/go.mod index fec7b7495..f3466188a 100644 --- a/cli/go.mod +++ b/cli/go.mod @@ -6,11 +6,10 @@ require ( github.com/Masterminds/semver/v3 v3.2.1 github.com/alecthomas/kong v0.7.1 github.com/aws/aws-sdk-go v1.44.274 - github.com/earthly/earthly/ast v0.0.2-0.20230524145153-17fad8c8f79b + github.com/earthly/earthly/ast v0.0.2-0.20231213200555-95fef7ce99cb github.com/onsi/ginkgo/v2 v2.9.7 github.com/onsi/gomega v1.27.7 github.com/spf13/afero v1.9.5 - gopkg.in/yaml.v3 v3.0.1 ) require ( @@ -24,8 +23,9 @@ require ( github.com/pkg/errors v0.9.1 // indirect golang.org/x/exp v0.0.0-20230224173230-c95f2b4c22f2 // indirect golang.org/x/net v0.10.0 // indirect - golang.org/x/sys v0.8.0 // indirect + golang.org/x/sys v0.11.0 // indirect golang.org/x/text v0.9.0 // indirect golang.org/x/tools v0.9.1 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/cli/go.sum b/cli/go.sum index ce535a6b7..687fd8a03 100644 --- a/cli/go.sum +++ b/cli/go.sum @@ -61,8 +61,6 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/earthly/earthly/ast v0.0.2-0.20230524145153-17fad8c8f79b h1:kwdLqircFHqYNLrBuSOybPpGPnqaqXEcRvJOWiSqRZw= -github.com/earthly/earthly/ast v0.0.2-0.20230524145153-17fad8c8f79b/go.mod h1:OoxU/3mRER8gdd4l1lxF6EgK+0vf7zQ8m9g269y6hWI= github.com/earthly/earthly/ast v0.0.2-0.20231213200555-95fef7ce99cb h1:dP0Wcrfbq5whzPCT/ZHGTvWVvx7S6BoF32nRHqhKt7E= github.com/earthly/earthly/ast v0.0.2-0.20231213200555-95fef7ce99cb/go.mod h1:UX9246125xgKvMIKim7WTxR8nookovxWx8/Ze8kpYlQ= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -166,7 +164,6 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/poy/onpar v0.3.1 h1:iqwl2S3U08PY8Bm9Hfh9v3fxdig7hZy9bsZfTephng8= github.com/poy/onpar v0.3.2 h1:yo8ZRqU3C4RlvkXPWUWfonQiTodAgpKQZ1g8VTNU9xU= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= @@ -328,8 +325,6 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= -golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= From d9ace5e3232fc1993774ca617afe12f9f2b13ff4 Mon Sep 17 00:00:00 2001 From: bkioshn Date: Wed, 10 Jan 2024 19:43:01 +0700 Subject: [PATCH 063/111] fix: update earthfile struct --- cli/pkg/earthfile.go | 2 +- cli/pkg/parsers/earthly_parser.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/pkg/earthfile.go b/cli/pkg/earthfile.go index 208a60dce..8182daa71 100644 --- a/cli/pkg/earthfile.go +++ b/cli/pkg/earthfile.go @@ -14,7 +14,7 @@ type Earthfile struct { Path string `json:"path,omitempty"` SourceLocation *spec.SourceLocation `json:"sourceLocation,omitempty"` Targets []spec.Target `json:"targets,omitempty"` - UserCommands []spec.UserCommand `json:"userCommands,omitempty"` + Functions []spec.Function `json:"functions,omitempty"` Version *spec.Version `json:"version,omitempty"` } diff --git a/cli/pkg/parsers/earthly_parser.go b/cli/pkg/parsers/earthly_parser.go index 56586188f..3befdfdf1 100644 --- a/cli/pkg/parsers/earthly_parser.go +++ b/cli/pkg/parsers/earthly_parser.go @@ -24,7 +24,7 @@ func (e EarthlyParser) Parse(path string) (pkg.Earthfile, error) { Path: path, SourceLocation: ef.SourceLocation, Targets: ef.Targets, - UserCommands: ef.UserCommands, + Functions: ef.Functions, Version: ef.Version, }, nil } From 392b139561f876e2e67fac0a6717739e4df592f4 Mon Sep 17 00:00:00 2001 From: bkioshn Date: Wed, 10 Jan 2024 19:48:06 +0700 Subject: [PATCH 064/111] fix: branch name typo --- .github/workflows/run.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run.yml b/.github/workflows/run.yml index 2a4352333..899a0c8c8 100644 --- a/.github/workflows/run.yml +++ b/.github/workflows/run.yml @@ -107,7 +107,7 @@ jobs: echo "targets=$targets_with_space" >> $GITHUB_OUTPUT - uses: actions/checkout@v3 - name: Setup CI - uses: input-output-hk/catalyst-ci/actions/setup@fcdDeprecation + uses: input-output-hk/catalyst-ci/actions/setup@fdcDeprecation with: aws_role_arn: ${{ inputs.aws_role_arn }} aws_region: ${{ inputs.aws_region }} From bdba69f24ec8444b11adfb90223b53850f9ceab8 Mon Sep 17 00:00:00 2001 From: bkioshn Date: Wed, 10 Jan 2024 22:41:15 +0700 Subject: [PATCH 065/111] fix: clean ci-lint go cache --- earthly/go/Earthfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/earthly/go/Earthfile b/earthly/go/Earthfile index e459ae29e..c1cf12f27 100644 --- a/earthly/go/Earthfile +++ b/earthly/go/Earthfile @@ -55,6 +55,9 @@ LINT: ENV GOLANGCI_LINT_CACHE=/cache/golangci-lint ENV GOCACHE=/cache/go-build + RUN go get ./... + + RUN golangci-lint cache clean && go clean -modcache -cache -i RUN golangci-lint run \ --timeout 5m \ -E errchkjson \ From 751ea23e324b211f1be234e17e0607cff1b3399f Mon Sep 17 00:00:00 2001 From: bkioshn Date: Wed, 10 Jan 2024 22:47:05 +0700 Subject: [PATCH 066/111] fix: remove clean cache --- earthly/go/Earthfile | 1 - 1 file changed, 1 deletion(-) diff --git a/earthly/go/Earthfile b/earthly/go/Earthfile index c1cf12f27..5a871368c 100644 --- a/earthly/go/Earthfile +++ b/earthly/go/Earthfile @@ -57,7 +57,6 @@ LINT: RUN go get ./... - RUN golangci-lint cache clean && go clean -modcache -cache -i RUN golangci-lint run \ --timeout 5m \ -E errchkjson \ From 9ca7dcdba6da723d0bcb34f3d0ea3cfe4475cec8 Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Fri, 12 Jan 2024 14:52:09 +0700 Subject: [PATCH 067/111] fix: edit COMMAND to FUNCTION --- earthly/go/Earthfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/earthly/go/Earthfile b/earthly/go/Earthfile index 5a871368c..df5c8e5e2 100644 --- a/earthly/go/Earthfile +++ b/earthly/go/Earthfile @@ -1,7 +1,7 @@ -VERSION --global-cache 0.7 +VERSION --global-cache --use-function-keyword 0.7 DEPS: - COMMAND + FUNCTION ARG ginkgo="true" @@ -24,7 +24,7 @@ DEPS: SAVE ARTIFACT go.sum AS LOCAL go.sum FMT: - COMMAND + FUNCTION # latest linux/amd64 FROM cytopia/gofmt@sha256:ae76abdbc96780819ce175f7ba4bf1fec98e9f708eb680d0b949d1737a959983 @@ -39,7 +39,7 @@ FMT: RUN gofmt -l . | grep . && exit 1 || exit 0 LINT: - COMMAND + FUNCTION # v1.54-alpine FROM golangci/golangci-lint@sha256:a8423cab177c2863b863ee6d9f00c58f101cadd6120e195b2bb59fdfa189c1ae @@ -66,4 +66,4 @@ LINT: -E gosec \ -E nilnil \ -E revive \ - -E testpackage \ No newline at end of file + -E testpackage From c69e3aca92acf17cc55e1acf9fc1924022983038 Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Fri, 12 Jan 2024 14:53:55 +0700 Subject: [PATCH 068/111] fix: edit COMMAND to FUNCTION --- earthly/docs/Earthfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/earthly/docs/Earthfile b/earthly/docs/Earthfile index e26dd20f1..74b8a16e0 100644 --- a/earthly/docs/Earthfile +++ b/earthly/docs/Earthfile @@ -1,4 +1,4 @@ -VERSION --global-cache 0.7 +VERSION --global-cache --use-function-keyword 0.7 # cspell: words libgcc freetype lcms openjpeg etag @@ -64,7 +64,7 @@ common: # Common src setup SRC: - COMMAND + FUNCTION FROM +deps @@ -81,7 +81,7 @@ SRC: # Build the docs - We always do this in a `docs` target. # The only target that needs customizing is the `src` target. BUILD: - COMMAND + FUNCTION RUN /scripts/build.sh @@ -95,7 +95,7 @@ BUILD: # We do however build a docs package which is used for locally serving the docs # which assists in documentation writing. PACKAGE: - COMMAND + FUNCTION # Use the official Nginx base image FROM nginx:alpine3.18-slim @@ -121,4 +121,4 @@ PACKAGE: # And then save the image # SAVE IMAGE image_name - \ No newline at end of file + From 743fe1597d75c87bb31d9f86c8510141548c4a21 Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Fri, 12 Jan 2024 15:05:30 +0700 Subject: [PATCH 069/111] fix: edit COMMAND to FUNCTION --- earthly/rust/Earthfile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/earthly/rust/Earthfile b/earthly/rust/Earthfile index ae702cb41..2164b8ea9 100644 --- a/earthly/rust/Earthfile +++ b/earthly/rust/Earthfile @@ -1,5 +1,5 @@ # Common Rust UDCs and Builders. -VERSION --global-cache 0.7 +VERSION --global-cache --use-function-keyword 0.7 # cspell: words rustup miri nextest ripgrep colordiff rustfmt stdcfgs toolset readelf depgraph lcov # cspell: words TARGETPLATFORM TARGETOS TARGETARCH TARGETVARIANT USERPLATFORM USEROS USERARCH USERVARIANT @@ -96,7 +96,7 @@ rust-base-all-hosts: # Parameters: # * toolchain : The `rust-toolchain` toml file. SETUP: - COMMAND + FUNCTION ARG toolchain=./rust-toolchain.toml # Copy our toolchain dependency. @@ -116,7 +116,7 @@ SETUP: # Steps we do during the `check` CI phase for all Rust programs CHECK: - COMMAND + FUNCTION # This is set up so that ALL checks are run and it will fail if any fail. # This improves visibility into all issues that need to be corrected for `check` @@ -128,7 +128,7 @@ CHECK: # * libs : The list of lib crates `cargo-modules` docs to build. # * bins : The list of binaries `cargo-modules` docs to build. BUILD: - COMMAND + FUNCTION ARG libs="" ARG bins="" @@ -136,7 +136,7 @@ BUILD: # Run unit tests and generates test and coverage report artifacts UNIT_TEST: - COMMAND + FUNCTION # remove artifacts that may affect the coverage results RUN cargo llvm-cov clean --workspace # run unit tests and display test result and test coverage @@ -146,7 +146,7 @@ UNIT_TEST: # Check if the build executable, isn't a busted mess. SMOKE_TEST: - COMMAND + FUNCTION ARG --required bin RUN ldd target/$TARGETARCH/release/$bin From bac09e3d60e6a48142c0fbf60c43bec884b3cb09 Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Fri, 12 Jan 2024 15:07:31 +0700 Subject: [PATCH 070/111] fix: edit COMMAND to FUNCTION --- earthly/python/Earthfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/earthly/python/Earthfile b/earthly/python/Earthfile index 2b078886c..dbe99a9a0 100644 --- a/earthly/python/Earthfile +++ b/earthly/python/Earthfile @@ -1,5 +1,5 @@ # Common Python UDCs and Builders. -VERSION --global-cache 0.7 +VERSION --global-cache --use-function-keyword 0.7 # cspell: words libgcc @@ -33,7 +33,7 @@ python-base: # Parameters: # opts : Options passed to the `poetry install` command. BUILDER: - COMMAND + FUNCTION ARG opts # Copy our dependencies. From f52935c27ddf7821aaaeb59391a265ca20f22519 Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Fri, 12 Jan 2024 15:08:54 +0700 Subject: [PATCH 071/111] fix: edit COMMAND to FUNCTION --- earthly/postgresql/Earthfile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/earthly/postgresql/Earthfile b/earthly/postgresql/Earthfile index 0a0e3647f..ea494a6e4 100644 --- a/earthly/postgresql/Earthfile +++ b/earthly/postgresql/Earthfile @@ -1,5 +1,5 @@ # Common PostgreSQL Earthly builders -VERSION --global-cache 0.7 +VERSION --global-cache --use-function-keyword 0.7 # cspell: words colordiff nushell psycopg dbviz @@ -59,7 +59,7 @@ postgres-base: # seed - OPTIONAL - Location of Seed data directory - DEFAULT: ./seed # refinery_toml - OPTIONAL - Location of refinery,toml which configures migrations. DEFAULT: ./refinery.toml BUILDER: - COMMAND + FUNCTION ARG migrations=./migrations ARG seed=./seed @@ -88,7 +88,7 @@ BUILDER: # DO github.com/input-output-hk/catalyst-ci/earthly/postgresql:+BUILD --image_name= # DO github.com/input-output-hk/catalyst-ci/earthly/postgresql:+DOCS DOCS: - COMMAND + FUNCTION ARG diagrams=./diagrams.json ARG migrations=./migrations @@ -109,7 +109,7 @@ DOCS: # Linter checks for sql files CHECK: - COMMAND + FUNCTION RUN /scripts/std_checks.sh @@ -118,7 +118,7 @@ CHECK: # Can not do it LOCALLY as the command will change ownership of the fixed files # if run within docker. FORMAT: - COMMAND + FUNCTION # Can not run format LOCALLY as it changes permissions of files to root:root RUN --no-cache printf "%s\n%s\n%s\n" \ @@ -143,7 +143,7 @@ integration-test: INTEGRATION_TEST_SETUP: - COMMAND + FUNCTION FROM +integration-test @@ -156,7 +156,7 @@ INTEGRATION_TEST_SETUP: # Arguments: # * image_name: The name of the image (required). BUILD: - COMMAND + FUNCTION ARG --required image_name USER postgres:postgres From 21555369c67c331ef7cb9683b888812e82bc8eb0 Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Fri, 12 Jan 2024 15:10:19 +0700 Subject: [PATCH 072/111] fix: edit COMMAND to FUNCTION --- examples/go/Earthfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/go/Earthfile b/examples/go/Earthfile index 74a9062e3..8e102e6d9 100644 --- a/examples/go/Earthfile +++ b/examples/go/Earthfile @@ -1,6 +1,6 @@ # WARNING: If you modify this file, please update the guide that it is dependent # on in docs/guides/languages/go.md. -VERSION --global-cache 0.7 +VERSION --global-cache --use-function-keyword 0.7 # The structure of this Earthfile is derived from the style guide: # https://input-output-hk.github.io/catalyst-ci/style/#adhere-to-a-consistent-structure @@ -73,4 +73,4 @@ publish-example: COPY +build/hello . # Use the cached artifact from the build target. ENTRYPOINT ["/app/hello"] - SAVE IMAGE hello:${tag} \ No newline at end of file + SAVE IMAGE hello:${tag} From 9bcb32ef4042f6ea6963564d2ada89dc4d8542e7 Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Fri, 12 Jan 2024 15:11:02 +0700 Subject: [PATCH 073/111] fix: edit COMMAND to FUNCTION --- examples/postgresql/Earthfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/postgresql/Earthfile b/examples/postgresql/Earthfile index b3aac3253..de8830be3 100644 --- a/examples/postgresql/Earthfile +++ b/examples/postgresql/Earthfile @@ -1,4 +1,4 @@ -VERSION --global-cache 0.7 +VERSION --global-cache --use-function-keyword 0.7 # cspell: words psql @@ -43,7 +43,7 @@ all-tests: # Internal Function to run an specific integration test script. INTEGRATION_TEST_RUN: - COMMAND + FUNCTION ARG seed_data ARG test_script From 8656cc21b728e730ad22000137a84559823c6543 Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Fri, 12 Jan 2024 15:23:20 +0700 Subject: [PATCH 074/111] fix: edit COMMAND to FUNCTION From f62e72bb84bcc24f69066f36f31054bf36af9592 Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Fri, 12 Jan 2024 15:27:26 +0700 Subject: [PATCH 075/111] fix: edit COMMAND to FUNCTION --- examples/postgresql/Earthfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/postgresql/Earthfile b/examples/postgresql/Earthfile index de8830be3..d23e3e190 100644 --- a/examples/postgresql/Earthfile +++ b/examples/postgresql/Earthfile @@ -105,6 +105,6 @@ test-3: # * PostgreSQL server runs as a separate service # * drops and initialise db # * applies migrations -# * applies seed data. +# * applies seed data test-4: DO +INTEGRATION_TEST_RUN --compose="./tests/docker-compose-svc.yml" --seed_data="data" --test_script=./tests/test1.sh From 170b3db04b828e117c3097351505b7c2b4c75635 Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Fri, 12 Jan 2024 21:36:56 +0700 Subject: [PATCH 076/111] update: deprecation of UDCs in Earthly 0.8 --- docs/src/style/index.md | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/docs/src/style/index.md b/docs/src/style/index.md index 5d55acc97..b2bb18136 100644 --- a/docs/src/style/index.md +++ b/docs/src/style/index.md @@ -156,13 +156,21 @@ This can be through inheriting from it or by directly copying artifacts. The main point is that a subproject should not have multiple builds scattered in various places. Each subproject has an authoritative `build` target that *all* targets use when fetching build artifacts. -### Prefer User Defined Commands (UDCs) +### Use Functions instead as User Defined Commands (UDCs) is Deprecated in Earthly 0.8 + +Functions used to be called UDCs (User Defined Commands). Earthly 0.7 still uses COMMAND for declaring functions, +but the keyword is deprecated and will be replaced by FUNCTION in Earthly 0.8. + +The primary purpose of functions in Earthly is to enhance the flexibility and reusability of build logic. +Functions serve as a powerful replacement for User-Defined Commands (UDCs), +offering a more comprehensive approach to reducing boilerplate and promoting the reuse of common workflows. + +In Earthly, functions provide a way to define reusable and parameterized blocks of build logic within a build file. +Functions are distinct from targets, which represent specific build outputs. When a function is invoked within a build script, +it executes a series of commands and may accept parameters, enabling a modular and flexible approach to defining build logic. +Functions can be utilized to encapsulate common tasks, making it easier to maintain and scale complex build processes. +The use of functions in Earthly contributes to a more modular and organized build system, enhancing code readability and maintainability. + + -The primary purpose of a UDC is to reduce boilerplate and promote reusing common workflows. -Many build patterns tend to be repetitive. -For example, copying a package lockfile and installing dependencies is very common. -In these cases, a UDC should be preferred. -The `catalyst-ci` repository provides a number of UDCs in the `earthly` subdirectory. -These should be used prior to writing a new one. -If a common use case is not covered in this subdirectory, a PR should be opened to add it. From c625409ae853a84fb5e6c0af870100761cdfec48 Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Fri, 12 Jan 2024 21:49:40 +0700 Subject: [PATCH 077/111] fix: trailing spaces --- docs/src/style/index.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/docs/src/style/index.md b/docs/src/style/index.md index b2bb18136..cd3e80a48 100644 --- a/docs/src/style/index.md +++ b/docs/src/style/index.md @@ -170,7 +170,3 @@ Functions are distinct from targets, which represent specific build outputs. Whe it executes a series of commands and may accept parameters, enabling a modular and flexible approach to defining build logic. Functions can be utilized to encapsulate common tasks, making it easier to maintain and scale complex build processes. The use of functions in Earthly contributes to a more modular and organized build system, enhancing code readability and maintainability. - - - - From 340e87e835cb7d43857753cdb662743945021915 Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Fri, 12 Jan 2024 22:15:15 +0700 Subject: [PATCH 078/111] fix: style --- docs/src/style/index.md | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/docs/src/style/index.md b/docs/src/style/index.md index cd3e80a48..dd6f059d2 100644 --- a/docs/src/style/index.md +++ b/docs/src/style/index.md @@ -158,15 +158,20 @@ Each subproject has an authoritative `build` target that *all* targets use when ### Use Functions instead as User Defined Commands (UDCs) is Deprecated in Earthly 0.8 -Functions used to be called UDCs (User Defined Commands). Earthly 0.7 still uses COMMAND for declaring functions, +Functions used to be called UDCs (User Defined Commands). +Earthly 0.7 still uses COMMAND for declaring functions, but the keyword is deprecated and will be replaced by FUNCTION in Earthly 0.8. -The primary purpose of functions in Earthly is to enhance the flexibility and reusability of build logic. -Functions serve as a powerful replacement for User-Defined Commands (UDCs), +The primary purpose of functions in Earthly is to enhance the flexibility and reusability of build logic. +Functions serve as a powerful replacement for User-Defined Commands (UDCs), offering a more comprehensive approach to reducing boilerplate and promoting the reuse of common workflows. -In Earthly, functions provide a way to define reusable and parameterized blocks of build logic within a build file. -Functions are distinct from targets, which represent specific build outputs. When a function is invoked within a build script, -it executes a series of commands and may accept parameters, enabling a modular and flexible approach to defining build logic. -Functions can be utilized to encapsulate common tasks, making it easier to maintain and scale complex build processes. -The use of functions in Earthly contributes to a more modular and organized build system, enhancing code readability and maintainability. +In Earthly, functions provide a way to define reusable and parameterized blocks of build logic within a build file. +Functions are distinct from targets, which represent specific build outputs. +When a function is invoked within a build script, +it executes a series of commands and may accept parameters, +enabling a modular and flexible approach to defining build logic. +Functions can be utilized to encapsulate common tasks, +making it easier to maintain and scale complex build processes. +The use of functions in Earthly contributes to a more modular and organized build system, +enhancing code readability and maintainability. From 34e1ffca01f90fd33f0c5ebce7e02ea3f8f01b1e Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Fri, 12 Jan 2024 22:18:31 +0700 Subject: [PATCH 079/111] fix: styling --- docs/src/style/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/style/index.md b/docs/src/style/index.md index dd6f059d2..77d60c517 100644 --- a/docs/src/style/index.md +++ b/docs/src/style/index.md @@ -167,7 +167,7 @@ Functions serve as a powerful replacement for User-Defined Commands (UDCs), offering a more comprehensive approach to reducing boilerplate and promoting the reuse of common workflows. In Earthly, functions provide a way to define reusable and parameterized blocks of build logic within a build file. -Functions are distinct from targets, which represent specific build outputs. +Functions are distinct from targets, which represent specific build outputs. When a function is invoked within a build script, it executes a series of commands and may accept parameters, enabling a modular and flexible approach to defining build logic. From 23615d18d61b5bc494940df415a3e0f6c9e5dac4 Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Fri, 12 Jan 2024 22:37:58 +0700 Subject: [PATCH 080/111] fix: edited DO to RUN for function calling --- Earthfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Earthfile b/Earthfile index 9d61a1880..8ecf21e4b 100644 --- a/Earthfile +++ b/Earthfile @@ -48,4 +48,4 @@ repo-config: edit-docs: LOCALLY - DO ./earthly/docs/dev/local.py cat-ci-docs:latest + RUN ./earthly/docs/dev/local.py cat-ci-docs:latest From 4394e9c1fad584cb6e684be7ee0356e3536b0736 Mon Sep 17 00:00:00 2001 From: vasapornchaiyakul <134899205+vasapornchaiyakul@users.noreply.github.com> Date: Fri, 12 Jan 2024 23:09:39 +0700 Subject: [PATCH 081/111] fix: update consolidate checking script --- Earthfile | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/Earthfile b/Earthfile index 8ecf21e4b..a1810a08d 100644 --- a/Earthfile +++ b/Earthfile @@ -24,6 +24,18 @@ check-bash: DO ./earthly/bash+SHELLCHECK --src=. +## ----------------------------------------------------------------------------- +## +## Standard CI targets. +## +## These targets are discovered and executed automatically by CI. + +# check run all checks. +check: + BUILD +check-spelling + BUILD +check-markdown + BUILD +check-bash + # Internal: Reference to our repo root documentation used by docs builder. repo-docs: # Create artifacts of extra files we embed inside the documentation when its built. @@ -43,9 +55,3 @@ repo-config: COPY --dir .sqlfluff . SAVE ARTIFACT /repo repo - -# edit-docs - Target to assist in editing docs. -edit-docs: - LOCALLY - - RUN ./earthly/docs/dev/local.py cat-ci-docs:latest From ee3de264d239a64e4641b24532dd209d411c6cf1 Mon Sep 17 00:00:00 2001 From: alicechai <134899205+alicechaitea@users.noreply.github.com> Date: Mon, 15 Jan 2024 21:22:20 +0700 Subject: [PATCH 082/111] fix: added edit-docs back to the script --- Earthfile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Earthfile b/Earthfile index a1810a08d..19cfc92f7 100644 --- a/Earthfile +++ b/Earthfile @@ -55,3 +55,9 @@ repo-config: COPY --dir .sqlfluff . SAVE ARTIFACT /repo repo + +# edit-docs - Target to assist in editing docs. +edit-docs: + LOCALLY + + RUN ./earthly/docs/dev/local.py cat-ci-docs:latest From 81c594a08bc55ff58198efc8bd0255b8188771c1 Mon Sep 17 00:00:00 2001 From: alicechai <134899205+alicechaitea@users.noreply.github.com> Date: Mon, 15 Jan 2024 21:31:39 +0700 Subject: [PATCH 083/111] fix: added full stop to line 108 --- examples/postgresql/Earthfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/postgresql/Earthfile b/examples/postgresql/Earthfile index d23e3e190..de8830be3 100644 --- a/examples/postgresql/Earthfile +++ b/examples/postgresql/Earthfile @@ -105,6 +105,6 @@ test-3: # * PostgreSQL server runs as a separate service # * drops and initialise db # * applies migrations -# * applies seed data +# * applies seed data. test-4: DO +INTEGRATION_TEST_RUN --compose="./tests/docker-compose-svc.yml" --seed_data="data" --test_script=./tests/test1.sh From c2394f8762a3b1cb2876a9ea666ac6b172c941ad Mon Sep 17 00:00:00 2001 From: alicechai <134899205+alicechaitea@users.noreply.github.com> Date: Mon, 15 Jan 2024 21:40:37 +0700 Subject: [PATCH 084/111] fix: change RUN back to DO at line 87 --- earthly/mdlint/Earthfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/earthly/mdlint/Earthfile b/earthly/mdlint/Earthfile index edb0555f4..c1341ea6c 100644 --- a/earthly/mdlint/Earthfile +++ b/earthly/mdlint/Earthfile @@ -84,4 +84,4 @@ mdlint-test: ARG src=$(echo ${PWD}/../../) - RUN +MDLINT_LOCALLY --src=${src} + DO +MDLINT_LOCALLY --src=${src} From 67ebad3602da8f59eb479266d47d518532a09b2d Mon Sep 17 00:00:00 2001 From: alicechai <134899205+alicechaitea@users.noreply.github.com> Date: Mon, 15 Jan 2024 21:49:53 +0700 Subject: [PATCH 085/111] fix: deleted check and comment --- Earthfile | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/Earthfile b/Earthfile index 19cfc92f7..8ecf21e4b 100644 --- a/Earthfile +++ b/Earthfile @@ -24,18 +24,6 @@ check-bash: DO ./earthly/bash+SHELLCHECK --src=. -## ----------------------------------------------------------------------------- -## -## Standard CI targets. -## -## These targets are discovered and executed automatically by CI. - -# check run all checks. -check: - BUILD +check-spelling - BUILD +check-markdown - BUILD +check-bash - # Internal: Reference to our repo root documentation used by docs builder. repo-docs: # Create artifacts of extra files we embed inside the documentation when its built. From 16c1704f3f4cbccc84d4fc8d4e07a160fd86ec71 Mon Sep 17 00:00:00 2001 From: alicechai <134899205+alicechaitea@users.noreply.github.com> Date: Mon, 15 Jan 2024 21:59:06 +0700 Subject: [PATCH 086/111] fix: added warning for deprecation of UDCs at line 159 --- docs/src/style/index.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/src/style/index.md b/docs/src/style/index.md index 77d60c517..0da9d6618 100644 --- a/docs/src/style/index.md +++ b/docs/src/style/index.md @@ -156,7 +156,12 @@ This can be through inheriting from it or by directly copying artifacts. The main point is that a subproject should not have multiple builds scattered in various places. Each subproject has an authoritative `build` target that *all* targets use when fetching build artifacts. -### Use Functions instead as User Defined Commands (UDCs) is Deprecated in Earthly 0.8 +### Earthly User Defined Commands (UDCs) Deprecation Starting from Earthly 0.8 + +Please be advised that Earthly's File Descriptor Cache (FDC) is deprecated, effective upon updating to Earthly 0.8. +Update your configurations accordingly to ensure a seamless transition and refer to the documentation for guidance. + +### Use Functions instead of User Defined Commands (UDCs) in Earthly 0.8 Functions used to be called UDCs (User Defined Commands). Earthly 0.7 still uses COMMAND for declaring functions, From 626820f6aee797fb3574a55973e3a107422944af Mon Sep 17 00:00:00 2001 From: alicechai <134899205+alicechaitea@users.noreply.github.com> Date: Mon, 15 Jan 2024 22:42:46 +0700 Subject: [PATCH 087/111] fix: moved warning to line 77 and pasted Blue's version --- docs/src/style/index.md | 34 +++++++++++++--------------------- 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/docs/src/style/index.md b/docs/src/style/index.md index 0da9d6618..40fed5e3d 100644 --- a/docs/src/style/index.md +++ b/docs/src/style/index.md @@ -12,6 +12,11 @@ In most circumstances, the standards provided by this style guide should *not* b If an exception must me made, the rationale should be included in the respective PR. Any `Earthfile` which does not adhere to this style guide will be rejected if no further justification is made. +### Earthly User Defined Commands (UDCs) deprecated starting from Earthly 0.8 + +!!! Warning +Please be advised that Earthly's File Descriptor Cache (FDC) is deprecated, effective upon updating to Earthly 0.8. + ## Organization ### Adhere to a consistent structure @@ -156,27 +161,14 @@ This can be through inheriting from it or by directly copying artifacts. The main point is that a subproject should not have multiple builds scattered in various places. Each subproject has an authoritative `build` target that *all* targets use when fetching build artifacts. -### Earthly User Defined Commands (UDCs) Deprecation Starting from Earthly 0.8 - -Please be advised that Earthly's File Descriptor Cache (FDC) is deprecated, effective upon updating to Earthly 0.8. -Update your configurations accordingly to ensure a seamless transition and refer to the documentation for guidance. - -### Use Functions instead of User Defined Commands (UDCs) in Earthly 0.8 - -Functions used to be called UDCs (User Defined Commands). -Earthly 0.7 still uses COMMAND for declaring functions, -but the keyword is deprecated and will be replaced by FUNCTION in Earthly 0.8. - -The primary purpose of functions in Earthly is to enhance the flexibility and reusability of build logic. -Functions serve as a powerful replacement for User-Defined Commands (UDCs), -offering a more comprehensive approach to reducing boilerplate and promoting the reuse of common workflows. +### Prefer FUNCTION -In Earthly, functions provide a way to define reusable and parameterized blocks of build logic within a build file. -Functions are distinct from targets, which represent specific build outputs. -When a function is invoked within a build script, -it executes a series of commands and may accept parameters, -enabling a modular and flexible approach to defining build logic. -Functions can be utilized to encapsulate common tasks, -making it easier to maintain and scale complex build processes. +The primary purpose of a UDC is to reduce boilerplate and promote reusing common workflows. +Many build patterns tend to be repetitive. +For example, copying a package lockfile and installing dependencies is very common. +In these cases, a FUNCTION should be preferred. +The catalyst-ci repository provides a number of FUNCTIONs in the earthly subdirectory. +These should be used prior to writing a new one. +If a common use case is not covered in this subdirectory, a PR should be opened to add it. The use of functions in Earthly contributes to a more modular and organized build system, enhancing code readability and maintainability. From 6263a85c58b67cf032a2e0a542d39627460288f9 Mon Sep 17 00:00:00 2001 From: alicechai <134899205+alicechaitea@users.noreply.github.com> Date: Mon, 15 Jan 2024 22:46:34 +0700 Subject: [PATCH 088/111] fix: edited formatting --- docs/src/style/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/style/index.md b/docs/src/style/index.md index 40fed5e3d..164d3a54b 100644 --- a/docs/src/style/index.md +++ b/docs/src/style/index.md @@ -14,7 +14,7 @@ Any `Earthfile` which does not adhere to this style guide will be rejected if no ### Earthly User Defined Commands (UDCs) deprecated starting from Earthly 0.8 -!!! Warning +### Warning Please be advised that Earthly's File Descriptor Cache (FDC) is deprecated, effective upon updating to Earthly 0.8. ## Organization From 71e8a9c3a401db9bdc2086e465cf42df864f2eb2 Mon Sep 17 00:00:00 2001 From: alicechai <134899205+alicechaitea@users.noreply.github.com> Date: Mon, 15 Jan 2024 22:49:34 +0700 Subject: [PATCH 089/111] fix: added blank line --- docs/src/style/index.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/src/style/index.md b/docs/src/style/index.md index 164d3a54b..960f99889 100644 --- a/docs/src/style/index.md +++ b/docs/src/style/index.md @@ -15,6 +15,7 @@ Any `Earthfile` which does not adhere to this style guide will be rejected if no ### Earthly User Defined Commands (UDCs) deprecated starting from Earthly 0.8 ### Warning + Please be advised that Earthly's File Descriptor Cache (FDC) is deprecated, effective upon updating to Earthly 0.8. ## Organization From d73360daff1409c6fae64742eef1f419bfa66d28 Mon Sep 17 00:00:00 2001 From: alicechai <134899205+alicechaitea@users.noreply.github.com> Date: Tue, 16 Jan 2024 11:41:11 +0700 Subject: [PATCH 090/111] fix: formatting revision --- docs/src/style/index.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/src/style/index.md b/docs/src/style/index.md index 960f99889..36edfaa77 100644 --- a/docs/src/style/index.md +++ b/docs/src/style/index.md @@ -14,9 +14,10 @@ Any `Earthfile` which does not adhere to this style guide will be rejected if no ### Earthly User Defined Commands (UDCs) deprecated starting from Earthly 0.8 -### Warning - + +!!! Warning Please be advised that Earthly's File Descriptor Cache (FDC) is deprecated, effective upon updating to Earthly 0.8. + ## Organization From 987ced33b5b56acc7a323ccbc3f13b80e7cdef8c Mon Sep 17 00:00:00 2001 From: alicechai <134899205+alicechaitea@users.noreply.github.com> Date: Tue, 16 Jan 2024 21:36:11 +0700 Subject: [PATCH 091/111] fix: update branch name and replace udc in doc From 30abcd7d58e4f56e78509cff2b520799a6ff0797 Mon Sep 17 00:00:00 2001 From: alicechai <134899205+alicechaitea@users.noreply.github.com> Date: Tue, 16 Jan 2024 22:14:30 +0700 Subject: [PATCH 092/111] fix: update udc and branch name --- .github/workflows/ci.yml | 2 +- .github/workflows/deploy.yml | 2 +- .github/workflows/pages.yml | 4 ++-- .github/workflows/publish.yml | 12 ++++++------ .github/workflows/release.yml | 8 ++++---- .github/workflows/run.yml | 8 ++++---- actions/setup/action.yml | 4 ++-- docs/src/guides/docs.md | 6 +++--- docs/src/guides/languages/go.md | 16 ++++++++-------- docs/src/guides/languages/postgresql.md | 8 ++++---- docs/src/guides/languages/python.md | 2 +- docs/src/guides/languages/rust.md | 16 ++++++++-------- docs/src/guides/markdown.md | 10 +++++----- docs/src/guides/spellcheck.md | 2 +- docs/src/reference/udc.md | 24 ++++++++++++------------ docs/src/style/index.md | 4 ++-- earthly/mdlint/Earthfile | 2 +- 17 files changed, 65 insertions(+), 65 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 10902680f..61d518d4c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -196,7 +196,7 @@ jobs: earthly_runner_address: ${{ secrets.earthly_runner_address }} earthly_runner_secret: ${{ secrets.earthly_runner_secret }} deploy: - uses: input-output-hk/catalyst-ci/.github/workflows/deploy.yml@fdcDeprecation + uses: input-output-hk/catalyst-ci/.github/workflows/deploy.yml@master if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch) && inputs.deployment_images != '' needs: [publish] with: diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 28ff20331..414b179aa 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -37,7 +37,7 @@ jobs: repository: ${{ inputs.deployment_repo }} token: ${{ secrets.token }} - name: Merge hashes - uses: input-output-hk/catalyst-ci/actions/merge@fdcDeprecation + uses: input-output-hk/catalyst-ci/actions/merge@master with: hash_file: "src/kube/environments/${{ inputs.environment }}/hashes.json" images: ${{ inputs.images }} diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 112bf6058..7ab3a0df0 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -74,7 +74,7 @@ jobs: echo "DEST_DIR=$DEST_DIR" >> $GITHUB_ENV echo "CLEAN_EXCLUDE=$CLEAN_EXCLUDE" >> $GITHUB_ENV - name: Setup CI - uses: input-output-hk/catalyst-ci/actions/setup@fdcDeprecation + uses: input-output-hk/catalyst-ci/actions/setup@master with: aws_role_arn: ${{ inputs.aws_role_arn }} aws_region: ${{ inputs.aws_region }} @@ -82,7 +82,7 @@ jobs: earthly_version: ${{ inputs.earthly_version }} earthly_runner_secret: ${{ secrets.earthly_runner_secret }} - name: Build docs - uses: input-output-hk/catalyst-ci/actions/run@fdcDeprecation + uses: input-output-hk/catalyst-ci/actions/run@master id: build with: earthfile: ${{ inputs.earthfile }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 21d7ce03e..a631fe7bf 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -88,13 +88,13 @@ jobs: steps: - uses: actions/checkout@v3 - name: Setup CI - uses: input-output-hk/catalyst-ci/actions/setup@fdcDeprecation + uses: input-output-hk/catalyst-ci/actions/setup@master with: cli_version: ${{ inputs.ci_cli_version }} configure_registries: "false" earthly_skip_install: "true" - name: Discover Earthly files - uses: input-output-hk/catalyst-ci/actions/discover@fdcDeprecation + uses: input-output-hk/catalyst-ci/actions/discover@master id: discover with: targets: ${{ inputs.target }} @@ -131,7 +131,7 @@ jobs: echo "targets=$targets_with_space" >> $GITHUB_OUTPUT - uses: actions/checkout@v3 - name: Setup CI - uses: input-output-hk/catalyst-ci/actions/setup@fdcDeprecation + uses: input-output-hk/catalyst-ci/actions/setup@master with: aws_ecr_registry: ${{ inputs.aws_ecr_registry }} aws_role_arn: ${{ inputs.aws_role_arn }} @@ -142,7 +142,7 @@ jobs: earthly_version: ${{ inputs.earthly_version }} earthly_runner_secret: ${{ secrets.earthly_runner_secret }} - name: Build image - uses: input-output-hk/catalyst-ci/actions/run@fdcDeprecation + uses: input-output-hk/catalyst-ci/actions/run@master id: build with: earthfile: ${{ matrix.earthfile }} @@ -150,7 +150,7 @@ jobs: platform: ${{ matrix.platform }} runner_address: ${{ secrets.earthly_runner_address }} - name: Push image - uses: input-output-hk/catalyst-ci/actions/push@fdcDeprecation + uses: input-output-hk/catalyst-ci/actions/push@master if: github.ref == format('refs/heads/{0}', inputs.default_branch) && !inputs.skip_publish_on_default with: image: ${{ steps.build.outputs.image }} @@ -164,7 +164,7 @@ jobs: if: startsWith(github.ref, 'refs/tags/') run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT - name: Push release image - uses: input-output-hk/catalyst-ci/actions/push@fdcDeprecation + uses: input-output-hk/catalyst-ci/actions/push@master if: startsWith(github.ref, 'refs/tags/') with: image: ${{ steps.build.outputs.image }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3f8caa37d..4f9613777 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -72,13 +72,13 @@ jobs: steps: - uses: actions/checkout@v3 - name: Setup CI - uses: input-output-hk/catalyst-ci/actions/setup@fdcDeprecation + uses: input-output-hk/catalyst-ci/actions/setup@master with: cli_version: ${{ inputs.ci_cli_version }} configure_registries: "false" earthly_skip_install: "true" - name: Discover Earthly files - uses: input-output-hk/catalyst-ci/actions/discover@fdcDeprecation + uses: input-output-hk/catalyst-ci/actions/discover@master id: discover with: targets: ${{ inputs.target }} @@ -115,7 +115,7 @@ jobs: echo "targets=$targets_with_space" >> $GITHUB_OUTPUT - uses: actions/checkout@v3 - name: Setup CI - uses: input-output-hk/catalyst-ci/actions/setup@fdcDeprecation + uses: input-output-hk/catalyst-ci/actions/setup@master with: aws_role_arn: ${{ inputs.aws_role_arn }} aws_region: ${{ inputs.aws_region }} @@ -125,7 +125,7 @@ jobs: earthly_version: ${{ inputs.earthly_version }} earthly_runner_secret: ${{ secrets.earthly_runner_secret }} - name: Build artifact - uses: input-output-hk/catalyst-ci/actions/run@fdcDeprecation + uses: input-output-hk/catalyst-ci/actions/run@master id: build with: earthfile: ${{ matrix.earthfile }} diff --git a/.github/workflows/run.yml b/.github/workflows/run.yml index 899a0c8c8..a42a6779a 100644 --- a/.github/workflows/run.yml +++ b/.github/workflows/run.yml @@ -66,13 +66,13 @@ jobs: steps: - uses: actions/checkout@v3 - name: Setup CI - uses: input-output-hk/catalyst-ci/actions/setup@fdcDeprecation + uses: input-output-hk/catalyst-ci/actions/setup@master with: cli_version: ${{ inputs.ci_cli_version }} configure_registries: "false" earthly_skip_install: "true" - name: Discover Earthly files - uses: input-output-hk/catalyst-ci/actions/discover@fdcDeprecation + uses: input-output-hk/catalyst-ci/actions/discover@master id: discover with: targets: ${{ inputs.target }} @@ -107,7 +107,7 @@ jobs: echo "targets=$targets_with_space" >> $GITHUB_OUTPUT - uses: actions/checkout@v3 - name: Setup CI - uses: input-output-hk/catalyst-ci/actions/setup@fdcDeprecation + uses: input-output-hk/catalyst-ci/actions/setup@master with: aws_role_arn: ${{ inputs.aws_role_arn }} aws_region: ${{ inputs.aws_region }} @@ -117,7 +117,7 @@ jobs: earthly_version: ${{ inputs.earthly_version }} earthly_runner_secret: ${{ secrets.earthly_runner_secret }} - name: Run - uses: input-output-hk/catalyst-ci/actions/run@fdcDeprecation + uses: input-output-hk/catalyst-ci/actions/run@master id: build with: privileged: ${{ inputs.privileged }} diff --git a/actions/setup/action.yml b/actions/setup/action.yml index a7eb38840..f4e7bd4e4 100644 --- a/actions/setup/action.yml +++ b/actions/setup/action.yml @@ -66,7 +66,7 @@ runs: with: version: ${{ inputs.earthly_version }} - name: Install CI CLI - uses: input-output-hk/catalyst-ci/actions/install@fdcDeprecation + uses: input-output-hk/catalyst-ci/actions/install@master if: ${{ inputs.cli_skip_install != 'true' }} with: version: ${{ inputs.cli_version }} @@ -95,7 +95,7 @@ runs: username: ${{ github.actor }} password: ${{ inputs.github_token }} - name: Setup Remote Runner - uses: input-output-hk/catalyst-ci/actions/configure-runner@fdcDeprecation + uses: input-output-hk/catalyst-ci/actions/configure-runner@master if: ${{ inputs.earthly_runner_secret != '' && inputs.earthly_skip_install != 'true' }} with: secret: ${{ inputs.earthly_runner_secret }} diff --git a/docs/src/guides/docs.md b/docs/src/guides/docs.md index 1c5831f9a..77de69fd7 100644 --- a/docs/src/guides/docs.md +++ b/docs/src/guides/docs.md @@ -52,7 +52,7 @@ src: The first step of building process it preparing a source files. It is mandatory to have a `src` directory with all documentation md files in it and `mkdocs.yml` file. -This directory and file will be picked during the execution of `+SRC` UDC target. +This directory and file will be picked during the execution of `+SRC` Function target. Also it is possible to replace defined `includes`, `macros` and `overrides` dirs to customize some docs appearance and configuration. @@ -78,7 +78,7 @@ docs: DO ../earthly/docs+BUILD ``` -To build a docs artifact which will be used later just invoke `+BUILD` UDC target +To build a docs artifact which will be used later just invoke `+BUILD` Function target on the already prepared docs environment `+src` target which we have discussed before. ```Earthfile @@ -93,7 +93,7 @@ local: ``` To finally build a docker image which is pretty strait forward process, -you should firstly invoke `+PACKAGE` UDC target which will prepare an environment for future docs image, +you should firstly invoke `+PACKAGE` Function target which will prepare an environment for future docs image, next step is to copy builded artifact from the previous step to `/usr/share/nginx/html` folder. And the last step is to save a docker image with the specified name, tag and registry if it is needed. diff --git a/docs/src/guides/languages/go.md b/docs/src/guides/languages/go.md index 595cdb279..1d35e90df 100644 --- a/docs/src/guides/languages/go.md +++ b/docs/src/guides/languages/go.md @@ -56,7 +56,7 @@ deps: # Any build dependencies should also be captured in this target. RUN apk add --no-cache gcc musl-dev - # This UDC automatically copies the go.mod and go.sum files and runs + # This Function automatically copies the go.mod and go.sum files and runs # `go mod download` to install the dependencies. DO ../../earthly/go+DEPS --ginkgo="false" ``` @@ -75,11 +75,11 @@ This target is also going to build responsible for installing external build dep These are dependencies that are not specific to a language and usually get installed system-wide. In our case, since we're building a static binary, we need `gcc` and `musl`. -Finally, the actual logic we will be using is encapsulate in a UDC. +Finally, the actual logic we will be using is encapsulate in a Function. This is a very common pattern, as an `Earthfile` can get repetitive across a repository. -In our case, we use the `go+DEPS` UDC that will automatically copy our `go.mod` and `go.sum` files and then execute +In our case, we use the `go+DEPS` Function that will automatically copy our `go.mod` and `go.sum` files and then execute `go mod download`. -The UDC will also establish a cache for the Go tooling. +The Function will also establish a cache for the Go tooling. This means that, even if our source code changes, we'll see a substantial speed boost when compiling because the cache is preserved across Earthly runs. @@ -96,10 +96,10 @@ check: # This target checks the overall health of the source code. FROM +src - # This UDC validates the code is formatted according to Go standards. + # This Function validates the code is formatted according to Go standards. DO ../../earthly/go+FMT --src="go.mod go.sum cmd" - # This UDC runs golangci-lint to check for common errors. + # This Function runs golangci-lint to check for common errors. DO ../../earthly/go+LINT --src="go.mod go.sum cmd" ``` @@ -111,8 +111,8 @@ Any future targets which need access to the source code will inherit from this t Now that the source code is available, we can begin performing static checks. These checks are intended to verify the code is healthy and conforms to a certain standard. -As we did in the previous section, here we rely on UDCs again to perform these checks. -These two UDCs will validate the code formatting is correct and also perform a series of lints to validate code quality. +As we did in the previous section, here we rely on Functions again to perform these checks. +These two Functions will validate the code formatting is correct and also perform a series of lints to validate code quality. Note that these checks are fast (compared to later steps) and perform quick feedback on code quality. Since this is the first target run in CI, we want to fail the CI as quickly as possible if we can easily find code quality issues. diff --git a/docs/src/guides/languages/postgresql.md b/docs/src/guides/languages/postgresql.md index b6d86ac13..51cd0c850 100644 --- a/docs/src/guides/languages/postgresql.md +++ b/docs/src/guides/languages/postgresql.md @@ -62,7 +62,7 @@ builder: The first target we are going to consider will be responsible to prepare a PostgreSQL environment (Earthly `+postgres-base` target), migrations, migrations configuration and seed data (`COPY --dir ./migrations ./data ./refinery.toml .`), -doing some final build step (Earthly `+BUILDER` UDC target). +doing some final build step (Earthly `+BUILDER` Function target). In the next steps we are going to inheriting from this `+builder` target which contains all necessary data, dependencies, environment to properly run PostgreSQL database. @@ -92,8 +92,8 @@ These checks are intended to verify the code is healthy and well formatted to a and done with the help of the `sqlfluff` tool which is already configured during the `+postgres-base` target. To apply and fix some formatting issues you can run `+format` target which will picks up directory -where your Earthly file lies in as a source dir for formatting and run `+FORMAT` UDC target. -Under the hood `+FORMAT` UDC target runs `sqlfluff-image` docker image, +where your Earthly file lies in as a source dir for formatting and run `+FORMAT` Function target. +Under the hood `+FORMAT` Function target runs `sqlfluff-image` docker image, which contains the same configuration and setup which is applied during the `+check`. @@ -118,7 +118,7 @@ With the `*.sql` files validation out of the way, we can finally build our Postg Since we need migration and seed data files, we'll inherit from the `builder` target. The actual image build process is pretty straight-forward -and fully defined under the `+BUILD` UDC target. +and fully defined under the `+BUILD` Function target. The only thing it is needed to specify is a few arguments: * `tag` - the tag of the image, default value `latest`. diff --git a/docs/src/guides/languages/python.md b/docs/src/guides/languages/python.md index a36d2ee24..34c1d5312 100644 --- a/docs/src/guides/languages/python.md +++ b/docs/src/guides/languages/python.md @@ -62,7 +62,7 @@ so it is mandatory to have `pyproject.toml` and `poetry.lock` files in the root The fist step of the `builder` target is prepare a Python environment with poetry via `+python-base` target. Next step is to copy source code of the project and finally finalize the build -with some poetry project setup which is done with `+BUILDER` UDC target. +with some poetry project setup which is done with `+BUILDER` Function target. ### Running checks diff --git a/docs/src/guides/languages/rust.md b/docs/src/guides/languages/rust.md index c2f81932f..1747d6e15 100644 --- a/docs/src/guides/languages/rust.md +++ b/docs/src/guides/languages/rust.md @@ -69,8 +69,8 @@ The fist step of the `builder` target is to prepare a Rust environment via `+rus Next step is to copy source code of the project. Note that you need to copy only needed files for Rust build process, any other irrelevant stuff should omitted. -And finally finalize the build with `+SETUP` UDC target. -The `+SETUP` UDC target requires `rust-toolchain.toml` file, +And finally finalize the build with `+SETUP` Function target. +The `+SETUP` Function target requires `rust-toolchain.toml` file, with the specified `channel` option in it. This `rust-toolchain.toml` file could be specified via the `toolchain` argument of the `+SETUP` target like this @@ -113,8 +113,8 @@ check: With prepared environment and all data, we're now ready to start operating with the source code and configuration files. The `hosted-check` target which actually performs all checks and validation -with the help of `+CHECK` UDC target. -The `+CHECK` UDC target performs static checks of the Rust project as +with the help of `+CHECK` Function target. +The `+CHECK` Function target performs static checks of the Rust project as `cargo fmt`, `cargo machete`, `cargo deny` which will validate formatting, find unused dependencies and any supply chain issues with dependencies. Here is the list of steps (look at `./earthly/rust/scripts/std_checks.sh`): @@ -181,8 +181,8 @@ Obviously it inherits `builder` target environment and than performs build of th Important to note that in this particular example we are dealing with the executable Rust project, so it produces binary as a final artifact. Another case of the building Rust library we will consider later. -Actual build process is done with `+BUILD` UDC target. -The `+BUILD` UDC have few arguments `libs` and `bins`, +Actual build process is done with `+BUILD` Function target. +The `+BUILD` Function have few arguments `libs` and `bins`, they should be specified to properly generate `cargo-modules` docs (see description below). The `libs` argument takes a list of library crate's names in your Rust project, e.g. `--libs="crate1 crate2"`. @@ -209,11 +209,11 @@ Generated artifacts are `doc/workspace.dot`, `doc/full.dot`, `doc/all.dot` files Generated artifacts are `doc/$crate.$bin.bin.modules.tree`, `doc/$crate.$bin.bin.modules.dot` for the specified `--bins="crate1/bin1"` argument and `target/doc/$crate.lib.modules.tree`, `target/doc/$crate.lib.modules.dot` -for the specified `--libs="crate1"` argument of the `+BUILD` UDC. +for the specified `--libs="crate1"` argument of the `+BUILD` Function. Next steps is mandatory if you are going to produce a binary as an artifact, for Rust libraries the are not mandatory and could be omitted. -The `+SMOKE_TEST` UDC target checks that produced binary with the specified name (`--bin` argument) +The `+SMOKE_TEST` Function target checks that produced binary with the specified name (`--bin` argument) is executable, isn't a busted mess. Final step is to provide desired artifacts: docs and binary. diff --git a/docs/src/guides/markdown.md b/docs/src/guides/markdown.md index 148f33b35..d9819a906 100644 --- a/docs/src/guides/markdown.md +++ b/docs/src/guides/markdown.md @@ -4,14 +4,14 @@ icon: simple/markdown # Markdown Check -This Earthly Target and UDC enables uniform linting of Markdown files to maintain consistency and quality. +This Earthly Target and Function enables uniform linting of Markdown files to maintain consistency and quality. -This UDC is **NOT** intended to be used inside container builds. +This Function is **NOT** intended to be used inside container builds. Its sole purpose is to enforce uniform style rules for all markdown files in a repository. It makes no assumptions about which files may or may not end up inside a container or are part of a build. This is *INTENTIONAL*. -IF this UDC is used inside a container build, it is **NOT** a bug if it does not do the correct thing. +IF this Function is used inside a container build, it is **NOT** a bug if it does not do the correct thing. ## Introduction @@ -83,7 +83,7 @@ markdown-check-fix: DO github.com/input-output-hk/catalyst-ci/earthly/mdlint:+MDLINT_LOCALLY --src=$(echo ${PWD}) --fix=--fix ``` -In this use case, the UDC is run Locally, so that the markdown in the repo can be directly checked. +In this use case, the Function is run Locally, so that the markdown in the repo can be directly checked. !!! Note @@ -105,4 +105,4 @@ For more example, please refer to this [doc](https://github.com/DavidAnson/markd mdlint-cli2 is integrated into VSCode and may be integrated into other Editors. The editor integration should pick up both the `.markdownlint.jsonc` and `.markdownlint-cli2.jsonc` configuration files. -It will then behave exactly the same as the Earthly UDC. +It will then behave exactly the same as the Earthly Function. diff --git a/docs/src/guides/spellcheck.md b/docs/src/guides/spellcheck.md index 053356e1a..02e30f501 100644 --- a/docs/src/guides/spellcheck.md +++ b/docs/src/guides/spellcheck.md @@ -142,4 +142,4 @@ For these files/paths, exclude them from the spell check by adding their filenam `cspell` is integrated into VSCode and may be integrated into other Editors. -The editor integration should pick up the `cspell.json` configuration file and behave exactly the same as the Earthly UDC. +The editor integration should pick up the `cspell.json` configuration file and behave exactly the same as the Earthly Function. diff --git a/docs/src/reference/udc.md b/docs/src/reference/udc.md index 8dfc85249..893a78c89 100644 --- a/docs/src/reference/udc.md +++ b/docs/src/reference/udc.md @@ -1,11 +1,11 @@ -# UDCs +# Functions ## Overview -The Catalyst CI repository provides a number of Earthly [User Defined Commands](https://docs.earthly.dev/docs/guides/udc) (UDCs). -You can think of a UDC as a reusable snippet of Earthly code that serves the same purpose as functions in a common programming +The Catalyst CI repository provides a number of Earthly [User Defined Commands](https://docs.earthly.dev/docs/guides/udc) (Functions). +You can think of a Function as a reusable snippet of Earthly code that serves the same purpose as functions in a common programming language. -UDCs are helpful for several reasons: +Functions are helpful for several reasons: 1. They keep Earthfiles DRY 2. They can encapsulate complex logic into a simple contractual interface @@ -16,22 +16,22 @@ similar problems. ## Usage -You are highly encouraged to review the currently available UDCs in the +You are highly encouraged to review the currently available Functions in the [Catalyst CI repository](https://github.com/input-output-hk/catalyst-ci/tree/master/earthly). The folder structure is broken out by language/technology and should be relatively easy to navigate. -You can incorporate these UDCs into your Earthfiles by using something like below: +You can incorporate these Functions into your Earthfiles by using something like below: ```Earthfile -DO github.com/input-output-hk/catalyst-ci/earthly/+ --arg1=value1 +DO github.com/input-output-hk/catalyst-ci/earthly/+ --arg1=value1 ``` -Replacing `folder` and `UDC_NAME` respectively. -The passing of an argument is optional, as some UDCs do not require any input arguments. +Replacing `folder` and `Function_NAME` respectively. +The passing of an argument is optional, as some Functions do not require any input arguments. ## Contributing -Please feel encouraged to contribute UDCs to the repository. +Please feel encouraged to contribute Functions to the repository. If you're seeing the same logic being re-used across multiple Earthfiles in a repository, this is a good candidate for refactoring -into a UDC. -Additionally, for SMEs who are aware of language best practices, encoding those into a UDC will help increase the overall health of +into a Function. +Additionally, for SMEs who are aware of language best practices, encoding those into a Function will help increase the overall health of the CI process. diff --git a/docs/src/style/index.md b/docs/src/style/index.md index 36edfaa77..59725b1e0 100644 --- a/docs/src/style/index.md +++ b/docs/src/style/index.md @@ -12,7 +12,7 @@ In most circumstances, the standards provided by this style guide should *not* b If an exception must me made, the rationale should be included in the respective PR. Any `Earthfile` which does not adhere to this style guide will be rejected if no further justification is made. -### Earthly User Defined Commands (UDCs) deprecated starting from Earthly 0.8 +### Earthly User Defined Commands (Functions) deprecated starting from Earthly 0.8 !!! Warning @@ -165,7 +165,7 @@ Each subproject has an authoritative `build` target that *all* targets use when ### Prefer FUNCTION -The primary purpose of a UDC is to reduce boilerplate and promote reusing common workflows. +The primary purpose of a Function is to reduce boilerplate and promote reusing common workflows. Many build patterns tend to be repetitive. For example, copying a package lockfile and installing dependencies is very common. In these cases, a FUNCTION should be preferred. diff --git a/earthly/mdlint/Earthfile b/earthly/mdlint/Earthfile index c1341ea6c..edb0555f4 100644 --- a/earthly/mdlint/Earthfile +++ b/earthly/mdlint/Earthfile @@ -84,4 +84,4 @@ mdlint-test: ARG src=$(echo ${PWD}/../../) - DO +MDLINT_LOCALLY --src=${src} + RUN +MDLINT_LOCALLY --src=${src} From 9463364e150fa1d5121c5014cdba3ac1974ef01b Mon Sep 17 00:00:00 2001 From: alicechai <134899205+alicechaitea@users.noreply.github.com> Date: Tue, 16 Jan 2024 22:18:41 +0700 Subject: [PATCH 093/111] fix: reroll UDC change --- .../09_architecture_decisions/0005-rust.md | 2 +- docs/src/guides/docs.md | 6 ++--- docs/src/guides/languages/go.md | 16 ++++++------- docs/src/guides/languages/postgresql.md | 8 +++---- docs/src/guides/languages/python.md | 2 +- docs/src/guides/languages/rust.md | 16 ++++++------- docs/src/guides/markdown.md | 10 ++++---- docs/src/guides/spellcheck.md | 2 +- docs/src/reference/udc.md | 24 +++++++++---------- docs/src/style/index.md | 4 ++-- 10 files changed, 45 insertions(+), 45 deletions(-) diff --git a/docs/src/architecture/09_architecture_decisions/0005-rust.md b/docs/src/architecture/09_architecture_decisions/0005-rust.md index a1a443f6a..62b89427b 100644 --- a/docs/src/architecture/09_architecture_decisions/0005-rust.md +++ b/docs/src/architecture/09_architecture_decisions/0005-rust.md @@ -69,7 +69,7 @@ make it a compelling choice for backend systems programming. It supports various architectures and operating systems, making it versatile for different use cases. 7. Interoperability: Rust can seamlessly interface with other languages, allowing developers to leverage existing code-bases or libraries. - It provides C-compatible FFI (Foreign Function Interface) and supports integration with languages like C, C++, and Python. + It provides C-compatible FFI (Foreign UDC Interface) and supports integration with languages like C, C++, and Python. 8. Community: Rust has a vibrant and supportive community that actively contributes to the language's development and provides valuable resources, documentation, and libraries. The community fosters a culture of knowledge sharing and collaboration. diff --git a/docs/src/guides/docs.md b/docs/src/guides/docs.md index 77de69fd7..1c5831f9a 100644 --- a/docs/src/guides/docs.md +++ b/docs/src/guides/docs.md @@ -52,7 +52,7 @@ src: The first step of building process it preparing a source files. It is mandatory to have a `src` directory with all documentation md files in it and `mkdocs.yml` file. -This directory and file will be picked during the execution of `+SRC` Function target. +This directory and file will be picked during the execution of `+SRC` UDC target. Also it is possible to replace defined `includes`, `macros` and `overrides` dirs to customize some docs appearance and configuration. @@ -78,7 +78,7 @@ docs: DO ../earthly/docs+BUILD ``` -To build a docs artifact which will be used later just invoke `+BUILD` Function target +To build a docs artifact which will be used later just invoke `+BUILD` UDC target on the already prepared docs environment `+src` target which we have discussed before. ```Earthfile @@ -93,7 +93,7 @@ local: ``` To finally build a docker image which is pretty strait forward process, -you should firstly invoke `+PACKAGE` Function target which will prepare an environment for future docs image, +you should firstly invoke `+PACKAGE` UDC target which will prepare an environment for future docs image, next step is to copy builded artifact from the previous step to `/usr/share/nginx/html` folder. And the last step is to save a docker image with the specified name, tag and registry if it is needed. diff --git a/docs/src/guides/languages/go.md b/docs/src/guides/languages/go.md index 1d35e90df..595cdb279 100644 --- a/docs/src/guides/languages/go.md +++ b/docs/src/guides/languages/go.md @@ -56,7 +56,7 @@ deps: # Any build dependencies should also be captured in this target. RUN apk add --no-cache gcc musl-dev - # This Function automatically copies the go.mod and go.sum files and runs + # This UDC automatically copies the go.mod and go.sum files and runs # `go mod download` to install the dependencies. DO ../../earthly/go+DEPS --ginkgo="false" ``` @@ -75,11 +75,11 @@ This target is also going to build responsible for installing external build dep These are dependencies that are not specific to a language and usually get installed system-wide. In our case, since we're building a static binary, we need `gcc` and `musl`. -Finally, the actual logic we will be using is encapsulate in a Function. +Finally, the actual logic we will be using is encapsulate in a UDC. This is a very common pattern, as an `Earthfile` can get repetitive across a repository. -In our case, we use the `go+DEPS` Function that will automatically copy our `go.mod` and `go.sum` files and then execute +In our case, we use the `go+DEPS` UDC that will automatically copy our `go.mod` and `go.sum` files and then execute `go mod download`. -The Function will also establish a cache for the Go tooling. +The UDC will also establish a cache for the Go tooling. This means that, even if our source code changes, we'll see a substantial speed boost when compiling because the cache is preserved across Earthly runs. @@ -96,10 +96,10 @@ check: # This target checks the overall health of the source code. FROM +src - # This Function validates the code is formatted according to Go standards. + # This UDC validates the code is formatted according to Go standards. DO ../../earthly/go+FMT --src="go.mod go.sum cmd" - # This Function runs golangci-lint to check for common errors. + # This UDC runs golangci-lint to check for common errors. DO ../../earthly/go+LINT --src="go.mod go.sum cmd" ``` @@ -111,8 +111,8 @@ Any future targets which need access to the source code will inherit from this t Now that the source code is available, we can begin performing static checks. These checks are intended to verify the code is healthy and conforms to a certain standard. -As we did in the previous section, here we rely on Functions again to perform these checks. -These two Functions will validate the code formatting is correct and also perform a series of lints to validate code quality. +As we did in the previous section, here we rely on UDCs again to perform these checks. +These two UDCs will validate the code formatting is correct and also perform a series of lints to validate code quality. Note that these checks are fast (compared to later steps) and perform quick feedback on code quality. Since this is the first target run in CI, we want to fail the CI as quickly as possible if we can easily find code quality issues. diff --git a/docs/src/guides/languages/postgresql.md b/docs/src/guides/languages/postgresql.md index 51cd0c850..b6d86ac13 100644 --- a/docs/src/guides/languages/postgresql.md +++ b/docs/src/guides/languages/postgresql.md @@ -62,7 +62,7 @@ builder: The first target we are going to consider will be responsible to prepare a PostgreSQL environment (Earthly `+postgres-base` target), migrations, migrations configuration and seed data (`COPY --dir ./migrations ./data ./refinery.toml .`), -doing some final build step (Earthly `+BUILDER` Function target). +doing some final build step (Earthly `+BUILDER` UDC target). In the next steps we are going to inheriting from this `+builder` target which contains all necessary data, dependencies, environment to properly run PostgreSQL database. @@ -92,8 +92,8 @@ These checks are intended to verify the code is healthy and well formatted to a and done with the help of the `sqlfluff` tool which is already configured during the `+postgres-base` target. To apply and fix some formatting issues you can run `+format` target which will picks up directory -where your Earthly file lies in as a source dir for formatting and run `+FORMAT` Function target. -Under the hood `+FORMAT` Function target runs `sqlfluff-image` docker image, +where your Earthly file lies in as a source dir for formatting and run `+FORMAT` UDC target. +Under the hood `+FORMAT` UDC target runs `sqlfluff-image` docker image, which contains the same configuration and setup which is applied during the `+check`. @@ -118,7 +118,7 @@ With the `*.sql` files validation out of the way, we can finally build our Postg Since we need migration and seed data files, we'll inherit from the `builder` target. The actual image build process is pretty straight-forward -and fully defined under the `+BUILD` Function target. +and fully defined under the `+BUILD` UDC target. The only thing it is needed to specify is a few arguments: * `tag` - the tag of the image, default value `latest`. diff --git a/docs/src/guides/languages/python.md b/docs/src/guides/languages/python.md index 34c1d5312..a36d2ee24 100644 --- a/docs/src/guides/languages/python.md +++ b/docs/src/guides/languages/python.md @@ -62,7 +62,7 @@ so it is mandatory to have `pyproject.toml` and `poetry.lock` files in the root The fist step of the `builder` target is prepare a Python environment with poetry via `+python-base` target. Next step is to copy source code of the project and finally finalize the build -with some poetry project setup which is done with `+BUILDER` Function target. +with some poetry project setup which is done with `+BUILDER` UDC target. ### Running checks diff --git a/docs/src/guides/languages/rust.md b/docs/src/guides/languages/rust.md index 1747d6e15..c2f81932f 100644 --- a/docs/src/guides/languages/rust.md +++ b/docs/src/guides/languages/rust.md @@ -69,8 +69,8 @@ The fist step of the `builder` target is to prepare a Rust environment via `+rus Next step is to copy source code of the project. Note that you need to copy only needed files for Rust build process, any other irrelevant stuff should omitted. -And finally finalize the build with `+SETUP` Function target. -The `+SETUP` Function target requires `rust-toolchain.toml` file, +And finally finalize the build with `+SETUP` UDC target. +The `+SETUP` UDC target requires `rust-toolchain.toml` file, with the specified `channel` option in it. This `rust-toolchain.toml` file could be specified via the `toolchain` argument of the `+SETUP` target like this @@ -113,8 +113,8 @@ check: With prepared environment and all data, we're now ready to start operating with the source code and configuration files. The `hosted-check` target which actually performs all checks and validation -with the help of `+CHECK` Function target. -The `+CHECK` Function target performs static checks of the Rust project as +with the help of `+CHECK` UDC target. +The `+CHECK` UDC target performs static checks of the Rust project as `cargo fmt`, `cargo machete`, `cargo deny` which will validate formatting, find unused dependencies and any supply chain issues with dependencies. Here is the list of steps (look at `./earthly/rust/scripts/std_checks.sh`): @@ -181,8 +181,8 @@ Obviously it inherits `builder` target environment and than performs build of th Important to note that in this particular example we are dealing with the executable Rust project, so it produces binary as a final artifact. Another case of the building Rust library we will consider later. -Actual build process is done with `+BUILD` Function target. -The `+BUILD` Function have few arguments `libs` and `bins`, +Actual build process is done with `+BUILD` UDC target. +The `+BUILD` UDC have few arguments `libs` and `bins`, they should be specified to properly generate `cargo-modules` docs (see description below). The `libs` argument takes a list of library crate's names in your Rust project, e.g. `--libs="crate1 crate2"`. @@ -209,11 +209,11 @@ Generated artifacts are `doc/workspace.dot`, `doc/full.dot`, `doc/all.dot` files Generated artifacts are `doc/$crate.$bin.bin.modules.tree`, `doc/$crate.$bin.bin.modules.dot` for the specified `--bins="crate1/bin1"` argument and `target/doc/$crate.lib.modules.tree`, `target/doc/$crate.lib.modules.dot` -for the specified `--libs="crate1"` argument of the `+BUILD` Function. +for the specified `--libs="crate1"` argument of the `+BUILD` UDC. Next steps is mandatory if you are going to produce a binary as an artifact, for Rust libraries the are not mandatory and could be omitted. -The `+SMOKE_TEST` Function target checks that produced binary with the specified name (`--bin` argument) +The `+SMOKE_TEST` UDC target checks that produced binary with the specified name (`--bin` argument) is executable, isn't a busted mess. Final step is to provide desired artifacts: docs and binary. diff --git a/docs/src/guides/markdown.md b/docs/src/guides/markdown.md index d9819a906..148f33b35 100644 --- a/docs/src/guides/markdown.md +++ b/docs/src/guides/markdown.md @@ -4,14 +4,14 @@ icon: simple/markdown # Markdown Check -This Earthly Target and Function enables uniform linting of Markdown files to maintain consistency and quality. +This Earthly Target and UDC enables uniform linting of Markdown files to maintain consistency and quality. -This Function is **NOT** intended to be used inside container builds. +This UDC is **NOT** intended to be used inside container builds. Its sole purpose is to enforce uniform style rules for all markdown files in a repository. It makes no assumptions about which files may or may not end up inside a container or are part of a build. This is *INTENTIONAL*. -IF this Function is used inside a container build, it is **NOT** a bug if it does not do the correct thing. +IF this UDC is used inside a container build, it is **NOT** a bug if it does not do the correct thing. ## Introduction @@ -83,7 +83,7 @@ markdown-check-fix: DO github.com/input-output-hk/catalyst-ci/earthly/mdlint:+MDLINT_LOCALLY --src=$(echo ${PWD}) --fix=--fix ``` -In this use case, the Function is run Locally, so that the markdown in the repo can be directly checked. +In this use case, the UDC is run Locally, so that the markdown in the repo can be directly checked. !!! Note @@ -105,4 +105,4 @@ For more example, please refer to this [doc](https://github.com/DavidAnson/markd mdlint-cli2 is integrated into VSCode and may be integrated into other Editors. The editor integration should pick up both the `.markdownlint.jsonc` and `.markdownlint-cli2.jsonc` configuration files. -It will then behave exactly the same as the Earthly Function. +It will then behave exactly the same as the Earthly UDC. diff --git a/docs/src/guides/spellcheck.md b/docs/src/guides/spellcheck.md index 02e30f501..053356e1a 100644 --- a/docs/src/guides/spellcheck.md +++ b/docs/src/guides/spellcheck.md @@ -142,4 +142,4 @@ For these files/paths, exclude them from the spell check by adding their filenam `cspell` is integrated into VSCode and may be integrated into other Editors. -The editor integration should pick up the `cspell.json` configuration file and behave exactly the same as the Earthly Function. +The editor integration should pick up the `cspell.json` configuration file and behave exactly the same as the Earthly UDC. diff --git a/docs/src/reference/udc.md b/docs/src/reference/udc.md index 893a78c89..8dfc85249 100644 --- a/docs/src/reference/udc.md +++ b/docs/src/reference/udc.md @@ -1,11 +1,11 @@ -# Functions +# UDCs ## Overview -The Catalyst CI repository provides a number of Earthly [User Defined Commands](https://docs.earthly.dev/docs/guides/udc) (Functions). -You can think of a Function as a reusable snippet of Earthly code that serves the same purpose as functions in a common programming +The Catalyst CI repository provides a number of Earthly [User Defined Commands](https://docs.earthly.dev/docs/guides/udc) (UDCs). +You can think of a UDC as a reusable snippet of Earthly code that serves the same purpose as functions in a common programming language. -Functions are helpful for several reasons: +UDCs are helpful for several reasons: 1. They keep Earthfiles DRY 2. They can encapsulate complex logic into a simple contractual interface @@ -16,22 +16,22 @@ similar problems. ## Usage -You are highly encouraged to review the currently available Functions in the +You are highly encouraged to review the currently available UDCs in the [Catalyst CI repository](https://github.com/input-output-hk/catalyst-ci/tree/master/earthly). The folder structure is broken out by language/technology and should be relatively easy to navigate. -You can incorporate these Functions into your Earthfiles by using something like below: +You can incorporate these UDCs into your Earthfiles by using something like below: ```Earthfile -DO github.com/input-output-hk/catalyst-ci/earthly/+ --arg1=value1 +DO github.com/input-output-hk/catalyst-ci/earthly/+ --arg1=value1 ``` -Replacing `folder` and `Function_NAME` respectively. -The passing of an argument is optional, as some Functions do not require any input arguments. +Replacing `folder` and `UDC_NAME` respectively. +The passing of an argument is optional, as some UDCs do not require any input arguments. ## Contributing -Please feel encouraged to contribute Functions to the repository. +Please feel encouraged to contribute UDCs to the repository. If you're seeing the same logic being re-used across multiple Earthfiles in a repository, this is a good candidate for refactoring -into a Function. -Additionally, for SMEs who are aware of language best practices, encoding those into a Function will help increase the overall health of +into a UDC. +Additionally, for SMEs who are aware of language best practices, encoding those into a UDC will help increase the overall health of the CI process. diff --git a/docs/src/style/index.md b/docs/src/style/index.md index 59725b1e0..36edfaa77 100644 --- a/docs/src/style/index.md +++ b/docs/src/style/index.md @@ -12,7 +12,7 @@ In most circumstances, the standards provided by this style guide should *not* b If an exception must me made, the rationale should be included in the respective PR. Any `Earthfile` which does not adhere to this style guide will be rejected if no further justification is made. -### Earthly User Defined Commands (Functions) deprecated starting from Earthly 0.8 +### Earthly User Defined Commands (UDCs) deprecated starting from Earthly 0.8 !!! Warning @@ -165,7 +165,7 @@ Each subproject has an authoritative `build` target that *all* targets use when ### Prefer FUNCTION -The primary purpose of a Function is to reduce boilerplate and promote reusing common workflows. +The primary purpose of a UDC is to reduce boilerplate and promote reusing common workflows. Many build patterns tend to be repetitive. For example, copying a package lockfile and installing dependencies is very common. In these cases, a FUNCTION should be preferred. From d35fe588fafeab9e6b28da0b2737b69e071073db Mon Sep 17 00:00:00 2001 From: alicechai <134899205+alicechaitea@users.noreply.github.com> Date: Tue, 16 Jan 2024 22:21:51 +0700 Subject: [PATCH 094/111] fix: change UDC back to Function --- .../09_architecture_decisions/0005-rust.md | 2 +- docs/src/guides/docs.md | 6 ++--- docs/src/guides/languages/go.md | 16 ++++++------- docs/src/guides/languages/postgresql.md | 8 +++---- docs/src/guides/languages/python.md | 2 +- docs/src/guides/languages/rust.md | 16 ++++++------- docs/src/guides/markdown.md | 10 ++++---- docs/src/guides/spellcheck.md | 2 +- docs/src/reference/udc.md | 24 +++++++++---------- docs/src/style/index.md | 4 ++-- 10 files changed, 45 insertions(+), 45 deletions(-) diff --git a/docs/src/architecture/09_architecture_decisions/0005-rust.md b/docs/src/architecture/09_architecture_decisions/0005-rust.md index 62b89427b..a1a443f6a 100644 --- a/docs/src/architecture/09_architecture_decisions/0005-rust.md +++ b/docs/src/architecture/09_architecture_decisions/0005-rust.md @@ -69,7 +69,7 @@ make it a compelling choice for backend systems programming. It supports various architectures and operating systems, making it versatile for different use cases. 7. Interoperability: Rust can seamlessly interface with other languages, allowing developers to leverage existing code-bases or libraries. - It provides C-compatible FFI (Foreign UDC Interface) and supports integration with languages like C, C++, and Python. + It provides C-compatible FFI (Foreign Function Interface) and supports integration with languages like C, C++, and Python. 8. Community: Rust has a vibrant and supportive community that actively contributes to the language's development and provides valuable resources, documentation, and libraries. The community fosters a culture of knowledge sharing and collaboration. diff --git a/docs/src/guides/docs.md b/docs/src/guides/docs.md index 1c5831f9a..77de69fd7 100644 --- a/docs/src/guides/docs.md +++ b/docs/src/guides/docs.md @@ -52,7 +52,7 @@ src: The first step of building process it preparing a source files. It is mandatory to have a `src` directory with all documentation md files in it and `mkdocs.yml` file. -This directory and file will be picked during the execution of `+SRC` UDC target. +This directory and file will be picked during the execution of `+SRC` Function target. Also it is possible to replace defined `includes`, `macros` and `overrides` dirs to customize some docs appearance and configuration. @@ -78,7 +78,7 @@ docs: DO ../earthly/docs+BUILD ``` -To build a docs artifact which will be used later just invoke `+BUILD` UDC target +To build a docs artifact which will be used later just invoke `+BUILD` Function target on the already prepared docs environment `+src` target which we have discussed before. ```Earthfile @@ -93,7 +93,7 @@ local: ``` To finally build a docker image which is pretty strait forward process, -you should firstly invoke `+PACKAGE` UDC target which will prepare an environment for future docs image, +you should firstly invoke `+PACKAGE` Function target which will prepare an environment for future docs image, next step is to copy builded artifact from the previous step to `/usr/share/nginx/html` folder. And the last step is to save a docker image with the specified name, tag and registry if it is needed. diff --git a/docs/src/guides/languages/go.md b/docs/src/guides/languages/go.md index 595cdb279..1d35e90df 100644 --- a/docs/src/guides/languages/go.md +++ b/docs/src/guides/languages/go.md @@ -56,7 +56,7 @@ deps: # Any build dependencies should also be captured in this target. RUN apk add --no-cache gcc musl-dev - # This UDC automatically copies the go.mod and go.sum files and runs + # This Function automatically copies the go.mod and go.sum files and runs # `go mod download` to install the dependencies. DO ../../earthly/go+DEPS --ginkgo="false" ``` @@ -75,11 +75,11 @@ This target is also going to build responsible for installing external build dep These are dependencies that are not specific to a language and usually get installed system-wide. In our case, since we're building a static binary, we need `gcc` and `musl`. -Finally, the actual logic we will be using is encapsulate in a UDC. +Finally, the actual logic we will be using is encapsulate in a Function. This is a very common pattern, as an `Earthfile` can get repetitive across a repository. -In our case, we use the `go+DEPS` UDC that will automatically copy our `go.mod` and `go.sum` files and then execute +In our case, we use the `go+DEPS` Function that will automatically copy our `go.mod` and `go.sum` files and then execute `go mod download`. -The UDC will also establish a cache for the Go tooling. +The Function will also establish a cache for the Go tooling. This means that, even if our source code changes, we'll see a substantial speed boost when compiling because the cache is preserved across Earthly runs. @@ -96,10 +96,10 @@ check: # This target checks the overall health of the source code. FROM +src - # This UDC validates the code is formatted according to Go standards. + # This Function validates the code is formatted according to Go standards. DO ../../earthly/go+FMT --src="go.mod go.sum cmd" - # This UDC runs golangci-lint to check for common errors. + # This Function runs golangci-lint to check for common errors. DO ../../earthly/go+LINT --src="go.mod go.sum cmd" ``` @@ -111,8 +111,8 @@ Any future targets which need access to the source code will inherit from this t Now that the source code is available, we can begin performing static checks. These checks are intended to verify the code is healthy and conforms to a certain standard. -As we did in the previous section, here we rely on UDCs again to perform these checks. -These two UDCs will validate the code formatting is correct and also perform a series of lints to validate code quality. +As we did in the previous section, here we rely on Functions again to perform these checks. +These two Functions will validate the code formatting is correct and also perform a series of lints to validate code quality. Note that these checks are fast (compared to later steps) and perform quick feedback on code quality. Since this is the first target run in CI, we want to fail the CI as quickly as possible if we can easily find code quality issues. diff --git a/docs/src/guides/languages/postgresql.md b/docs/src/guides/languages/postgresql.md index b6d86ac13..51cd0c850 100644 --- a/docs/src/guides/languages/postgresql.md +++ b/docs/src/guides/languages/postgresql.md @@ -62,7 +62,7 @@ builder: The first target we are going to consider will be responsible to prepare a PostgreSQL environment (Earthly `+postgres-base` target), migrations, migrations configuration and seed data (`COPY --dir ./migrations ./data ./refinery.toml .`), -doing some final build step (Earthly `+BUILDER` UDC target). +doing some final build step (Earthly `+BUILDER` Function target). In the next steps we are going to inheriting from this `+builder` target which contains all necessary data, dependencies, environment to properly run PostgreSQL database. @@ -92,8 +92,8 @@ These checks are intended to verify the code is healthy and well formatted to a and done with the help of the `sqlfluff` tool which is already configured during the `+postgres-base` target. To apply and fix some formatting issues you can run `+format` target which will picks up directory -where your Earthly file lies in as a source dir for formatting and run `+FORMAT` UDC target. -Under the hood `+FORMAT` UDC target runs `sqlfluff-image` docker image, +where your Earthly file lies in as a source dir for formatting and run `+FORMAT` Function target. +Under the hood `+FORMAT` Function target runs `sqlfluff-image` docker image, which contains the same configuration and setup which is applied during the `+check`. @@ -118,7 +118,7 @@ With the `*.sql` files validation out of the way, we can finally build our Postg Since we need migration and seed data files, we'll inherit from the `builder` target. The actual image build process is pretty straight-forward -and fully defined under the `+BUILD` UDC target. +and fully defined under the `+BUILD` Function target. The only thing it is needed to specify is a few arguments: * `tag` - the tag of the image, default value `latest`. diff --git a/docs/src/guides/languages/python.md b/docs/src/guides/languages/python.md index a36d2ee24..34c1d5312 100644 --- a/docs/src/guides/languages/python.md +++ b/docs/src/guides/languages/python.md @@ -62,7 +62,7 @@ so it is mandatory to have `pyproject.toml` and `poetry.lock` files in the root The fist step of the `builder` target is prepare a Python environment with poetry via `+python-base` target. Next step is to copy source code of the project and finally finalize the build -with some poetry project setup which is done with `+BUILDER` UDC target. +with some poetry project setup which is done with `+BUILDER` Function target. ### Running checks diff --git a/docs/src/guides/languages/rust.md b/docs/src/guides/languages/rust.md index c2f81932f..1747d6e15 100644 --- a/docs/src/guides/languages/rust.md +++ b/docs/src/guides/languages/rust.md @@ -69,8 +69,8 @@ The fist step of the `builder` target is to prepare a Rust environment via `+rus Next step is to copy source code of the project. Note that you need to copy only needed files for Rust build process, any other irrelevant stuff should omitted. -And finally finalize the build with `+SETUP` UDC target. -The `+SETUP` UDC target requires `rust-toolchain.toml` file, +And finally finalize the build with `+SETUP` Function target. +The `+SETUP` Function target requires `rust-toolchain.toml` file, with the specified `channel` option in it. This `rust-toolchain.toml` file could be specified via the `toolchain` argument of the `+SETUP` target like this @@ -113,8 +113,8 @@ check: With prepared environment and all data, we're now ready to start operating with the source code and configuration files. The `hosted-check` target which actually performs all checks and validation -with the help of `+CHECK` UDC target. -The `+CHECK` UDC target performs static checks of the Rust project as +with the help of `+CHECK` Function target. +The `+CHECK` Function target performs static checks of the Rust project as `cargo fmt`, `cargo machete`, `cargo deny` which will validate formatting, find unused dependencies and any supply chain issues with dependencies. Here is the list of steps (look at `./earthly/rust/scripts/std_checks.sh`): @@ -181,8 +181,8 @@ Obviously it inherits `builder` target environment and than performs build of th Important to note that in this particular example we are dealing with the executable Rust project, so it produces binary as a final artifact. Another case of the building Rust library we will consider later. -Actual build process is done with `+BUILD` UDC target. -The `+BUILD` UDC have few arguments `libs` and `bins`, +Actual build process is done with `+BUILD` Function target. +The `+BUILD` Function have few arguments `libs` and `bins`, they should be specified to properly generate `cargo-modules` docs (see description below). The `libs` argument takes a list of library crate's names in your Rust project, e.g. `--libs="crate1 crate2"`. @@ -209,11 +209,11 @@ Generated artifacts are `doc/workspace.dot`, `doc/full.dot`, `doc/all.dot` files Generated artifacts are `doc/$crate.$bin.bin.modules.tree`, `doc/$crate.$bin.bin.modules.dot` for the specified `--bins="crate1/bin1"` argument and `target/doc/$crate.lib.modules.tree`, `target/doc/$crate.lib.modules.dot` -for the specified `--libs="crate1"` argument of the `+BUILD` UDC. +for the specified `--libs="crate1"` argument of the `+BUILD` Function. Next steps is mandatory if you are going to produce a binary as an artifact, for Rust libraries the are not mandatory and could be omitted. -The `+SMOKE_TEST` UDC target checks that produced binary with the specified name (`--bin` argument) +The `+SMOKE_TEST` Function target checks that produced binary with the specified name (`--bin` argument) is executable, isn't a busted mess. Final step is to provide desired artifacts: docs and binary. diff --git a/docs/src/guides/markdown.md b/docs/src/guides/markdown.md index 148f33b35..d9819a906 100644 --- a/docs/src/guides/markdown.md +++ b/docs/src/guides/markdown.md @@ -4,14 +4,14 @@ icon: simple/markdown # Markdown Check -This Earthly Target and UDC enables uniform linting of Markdown files to maintain consistency and quality. +This Earthly Target and Function enables uniform linting of Markdown files to maintain consistency and quality. -This UDC is **NOT** intended to be used inside container builds. +This Function is **NOT** intended to be used inside container builds. Its sole purpose is to enforce uniform style rules for all markdown files in a repository. It makes no assumptions about which files may or may not end up inside a container or are part of a build. This is *INTENTIONAL*. -IF this UDC is used inside a container build, it is **NOT** a bug if it does not do the correct thing. +IF this Function is used inside a container build, it is **NOT** a bug if it does not do the correct thing. ## Introduction @@ -83,7 +83,7 @@ markdown-check-fix: DO github.com/input-output-hk/catalyst-ci/earthly/mdlint:+MDLINT_LOCALLY --src=$(echo ${PWD}) --fix=--fix ``` -In this use case, the UDC is run Locally, so that the markdown in the repo can be directly checked. +In this use case, the Function is run Locally, so that the markdown in the repo can be directly checked. !!! Note @@ -105,4 +105,4 @@ For more example, please refer to this [doc](https://github.com/DavidAnson/markd mdlint-cli2 is integrated into VSCode and may be integrated into other Editors. The editor integration should pick up both the `.markdownlint.jsonc` and `.markdownlint-cli2.jsonc` configuration files. -It will then behave exactly the same as the Earthly UDC. +It will then behave exactly the same as the Earthly Function. diff --git a/docs/src/guides/spellcheck.md b/docs/src/guides/spellcheck.md index 053356e1a..02e30f501 100644 --- a/docs/src/guides/spellcheck.md +++ b/docs/src/guides/spellcheck.md @@ -142,4 +142,4 @@ For these files/paths, exclude them from the spell check by adding their filenam `cspell` is integrated into VSCode and may be integrated into other Editors. -The editor integration should pick up the `cspell.json` configuration file and behave exactly the same as the Earthly UDC. +The editor integration should pick up the `cspell.json` configuration file and behave exactly the same as the Earthly Function. diff --git a/docs/src/reference/udc.md b/docs/src/reference/udc.md index 8dfc85249..893a78c89 100644 --- a/docs/src/reference/udc.md +++ b/docs/src/reference/udc.md @@ -1,11 +1,11 @@ -# UDCs +# Functions ## Overview -The Catalyst CI repository provides a number of Earthly [User Defined Commands](https://docs.earthly.dev/docs/guides/udc) (UDCs). -You can think of a UDC as a reusable snippet of Earthly code that serves the same purpose as functions in a common programming +The Catalyst CI repository provides a number of Earthly [User Defined Commands](https://docs.earthly.dev/docs/guides/udc) (Functions). +You can think of a Function as a reusable snippet of Earthly code that serves the same purpose as functions in a common programming language. -UDCs are helpful for several reasons: +Functions are helpful for several reasons: 1. They keep Earthfiles DRY 2. They can encapsulate complex logic into a simple contractual interface @@ -16,22 +16,22 @@ similar problems. ## Usage -You are highly encouraged to review the currently available UDCs in the +You are highly encouraged to review the currently available Functions in the [Catalyst CI repository](https://github.com/input-output-hk/catalyst-ci/tree/master/earthly). The folder structure is broken out by language/technology and should be relatively easy to navigate. -You can incorporate these UDCs into your Earthfiles by using something like below: +You can incorporate these Functions into your Earthfiles by using something like below: ```Earthfile -DO github.com/input-output-hk/catalyst-ci/earthly/+ --arg1=value1 +DO github.com/input-output-hk/catalyst-ci/earthly/+ --arg1=value1 ``` -Replacing `folder` and `UDC_NAME` respectively. -The passing of an argument is optional, as some UDCs do not require any input arguments. +Replacing `folder` and `Function_NAME` respectively. +The passing of an argument is optional, as some Functions do not require any input arguments. ## Contributing -Please feel encouraged to contribute UDCs to the repository. +Please feel encouraged to contribute Functions to the repository. If you're seeing the same logic being re-used across multiple Earthfiles in a repository, this is a good candidate for refactoring -into a UDC. -Additionally, for SMEs who are aware of language best practices, encoding those into a UDC will help increase the overall health of +into a Function. +Additionally, for SMEs who are aware of language best practices, encoding those into a Function will help increase the overall health of the CI process. diff --git a/docs/src/style/index.md b/docs/src/style/index.md index 36edfaa77..59725b1e0 100644 --- a/docs/src/style/index.md +++ b/docs/src/style/index.md @@ -12,7 +12,7 @@ In most circumstances, the standards provided by this style guide should *not* b If an exception must me made, the rationale should be included in the respective PR. Any `Earthfile` which does not adhere to this style guide will be rejected if no further justification is made. -### Earthly User Defined Commands (UDCs) deprecated starting from Earthly 0.8 +### Earthly User Defined Commands (Functions) deprecated starting from Earthly 0.8 !!! Warning @@ -165,7 +165,7 @@ Each subproject has an authoritative `build` target that *all* targets use when ### Prefer FUNCTION -The primary purpose of a UDC is to reduce boilerplate and promote reusing common workflows. +The primary purpose of a Function is to reduce boilerplate and promote reusing common workflows. Many build patterns tend to be repetitive. For example, copying a package lockfile and installing dependencies is very common. In these cases, a FUNCTION should be preferred. From fa059ca45087355105c206aa744388081950ec71 Mon Sep 17 00:00:00 2001 From: alicechai <134899205+alicechaitea@users.noreply.github.com> Date: Tue, 16 Jan 2024 22:29:12 +0700 Subject: [PATCH 095/111] fix: change branch name to fdcDeprecation --- .github/workflows/ci.yml | 2 +- .github/workflows/deploy.yml | 2 +- .github/workflows/pages.yml | 4 ++-- .github/workflows/publish.yml | 12 ++++++------ .github/workflows/release.yml | 8 ++++---- .github/workflows/run.yml | 8 ++++---- actions/configure-runner/README.md | 2 +- actions/discover/README.md | 4 ++-- actions/install/README.md | 2 +- actions/merge/README.md | 2 +- actions/push/README.md | 2 +- actions/run/README.md | 2 +- actions/setup/README.md | 2 +- actions/setup/action.yml | 4 ++-- 14 files changed, 28 insertions(+), 28 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 61d518d4c..10902680f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -196,7 +196,7 @@ jobs: earthly_runner_address: ${{ secrets.earthly_runner_address }} earthly_runner_secret: ${{ secrets.earthly_runner_secret }} deploy: - uses: input-output-hk/catalyst-ci/.github/workflows/deploy.yml@master + uses: input-output-hk/catalyst-ci/.github/workflows/deploy.yml@fdcDeprecation if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch) && inputs.deployment_images != '' needs: [publish] with: diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 414b179aa..28ff20331 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -37,7 +37,7 @@ jobs: repository: ${{ inputs.deployment_repo }} token: ${{ secrets.token }} - name: Merge hashes - uses: input-output-hk/catalyst-ci/actions/merge@master + uses: input-output-hk/catalyst-ci/actions/merge@fdcDeprecation with: hash_file: "src/kube/environments/${{ inputs.environment }}/hashes.json" images: ${{ inputs.images }} diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 7ab3a0df0..112bf6058 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -74,7 +74,7 @@ jobs: echo "DEST_DIR=$DEST_DIR" >> $GITHUB_ENV echo "CLEAN_EXCLUDE=$CLEAN_EXCLUDE" >> $GITHUB_ENV - name: Setup CI - uses: input-output-hk/catalyst-ci/actions/setup@master + uses: input-output-hk/catalyst-ci/actions/setup@fdcDeprecation with: aws_role_arn: ${{ inputs.aws_role_arn }} aws_region: ${{ inputs.aws_region }} @@ -82,7 +82,7 @@ jobs: earthly_version: ${{ inputs.earthly_version }} earthly_runner_secret: ${{ secrets.earthly_runner_secret }} - name: Build docs - uses: input-output-hk/catalyst-ci/actions/run@master + uses: input-output-hk/catalyst-ci/actions/run@fdcDeprecation id: build with: earthfile: ${{ inputs.earthfile }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index a631fe7bf..21d7ce03e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -88,13 +88,13 @@ jobs: steps: - uses: actions/checkout@v3 - name: Setup CI - uses: input-output-hk/catalyst-ci/actions/setup@master + uses: input-output-hk/catalyst-ci/actions/setup@fdcDeprecation with: cli_version: ${{ inputs.ci_cli_version }} configure_registries: "false" earthly_skip_install: "true" - name: Discover Earthly files - uses: input-output-hk/catalyst-ci/actions/discover@master + uses: input-output-hk/catalyst-ci/actions/discover@fdcDeprecation id: discover with: targets: ${{ inputs.target }} @@ -131,7 +131,7 @@ jobs: echo "targets=$targets_with_space" >> $GITHUB_OUTPUT - uses: actions/checkout@v3 - name: Setup CI - uses: input-output-hk/catalyst-ci/actions/setup@master + uses: input-output-hk/catalyst-ci/actions/setup@fdcDeprecation with: aws_ecr_registry: ${{ inputs.aws_ecr_registry }} aws_role_arn: ${{ inputs.aws_role_arn }} @@ -142,7 +142,7 @@ jobs: earthly_version: ${{ inputs.earthly_version }} earthly_runner_secret: ${{ secrets.earthly_runner_secret }} - name: Build image - uses: input-output-hk/catalyst-ci/actions/run@master + uses: input-output-hk/catalyst-ci/actions/run@fdcDeprecation id: build with: earthfile: ${{ matrix.earthfile }} @@ -150,7 +150,7 @@ jobs: platform: ${{ matrix.platform }} runner_address: ${{ secrets.earthly_runner_address }} - name: Push image - uses: input-output-hk/catalyst-ci/actions/push@master + uses: input-output-hk/catalyst-ci/actions/push@fdcDeprecation if: github.ref == format('refs/heads/{0}', inputs.default_branch) && !inputs.skip_publish_on_default with: image: ${{ steps.build.outputs.image }} @@ -164,7 +164,7 @@ jobs: if: startsWith(github.ref, 'refs/tags/') run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT - name: Push release image - uses: input-output-hk/catalyst-ci/actions/push@master + uses: input-output-hk/catalyst-ci/actions/push@fdcDeprecation if: startsWith(github.ref, 'refs/tags/') with: image: ${{ steps.build.outputs.image }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4f9613777..3f8caa37d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -72,13 +72,13 @@ jobs: steps: - uses: actions/checkout@v3 - name: Setup CI - uses: input-output-hk/catalyst-ci/actions/setup@master + uses: input-output-hk/catalyst-ci/actions/setup@fdcDeprecation with: cli_version: ${{ inputs.ci_cli_version }} configure_registries: "false" earthly_skip_install: "true" - name: Discover Earthly files - uses: input-output-hk/catalyst-ci/actions/discover@master + uses: input-output-hk/catalyst-ci/actions/discover@fdcDeprecation id: discover with: targets: ${{ inputs.target }} @@ -115,7 +115,7 @@ jobs: echo "targets=$targets_with_space" >> $GITHUB_OUTPUT - uses: actions/checkout@v3 - name: Setup CI - uses: input-output-hk/catalyst-ci/actions/setup@master + uses: input-output-hk/catalyst-ci/actions/setup@fdcDeprecation with: aws_role_arn: ${{ inputs.aws_role_arn }} aws_region: ${{ inputs.aws_region }} @@ -125,7 +125,7 @@ jobs: earthly_version: ${{ inputs.earthly_version }} earthly_runner_secret: ${{ secrets.earthly_runner_secret }} - name: Build artifact - uses: input-output-hk/catalyst-ci/actions/run@master + uses: input-output-hk/catalyst-ci/actions/run@fdcDeprecation id: build with: earthfile: ${{ matrix.earthfile }} diff --git a/.github/workflows/run.yml b/.github/workflows/run.yml index a42a6779a..899a0c8c8 100644 --- a/.github/workflows/run.yml +++ b/.github/workflows/run.yml @@ -66,13 +66,13 @@ jobs: steps: - uses: actions/checkout@v3 - name: Setup CI - uses: input-output-hk/catalyst-ci/actions/setup@master + uses: input-output-hk/catalyst-ci/actions/setup@fdcDeprecation with: cli_version: ${{ inputs.ci_cli_version }} configure_registries: "false" earthly_skip_install: "true" - name: Discover Earthly files - uses: input-output-hk/catalyst-ci/actions/discover@master + uses: input-output-hk/catalyst-ci/actions/discover@fdcDeprecation id: discover with: targets: ${{ inputs.target }} @@ -107,7 +107,7 @@ jobs: echo "targets=$targets_with_space" >> $GITHUB_OUTPUT - uses: actions/checkout@v3 - name: Setup CI - uses: input-output-hk/catalyst-ci/actions/setup@master + uses: input-output-hk/catalyst-ci/actions/setup@fdcDeprecation with: aws_role_arn: ${{ inputs.aws_role_arn }} aws_region: ${{ inputs.aws_region }} @@ -117,7 +117,7 @@ jobs: earthly_version: ${{ inputs.earthly_version }} earthly_runner_secret: ${{ secrets.earthly_runner_secret }} - name: Run - uses: input-output-hk/catalyst-ci/actions/run@master + uses: input-output-hk/catalyst-ci/actions/run@fdcDeprecation id: build with: privileged: ${{ inputs.privileged }} diff --git a/actions/configure-runner/README.md b/actions/configure-runner/README.md index 2e6da118e..27b09746c 100644 --- a/actions/configure-runner/README.md +++ b/actions/configure-runner/README.md @@ -14,7 +14,7 @@ Earthly to consume them correctly. ```yaml - name: Setup Remote Runner - uses: input-output-hk/catalyst-ci/actions/configure-runner@master + uses: input-output-hk/catalyst-ci/actions/configure-runner@fdcDeprecation with: path: /path/to/store/certs # Optional, defaults to /tmp/certs secret: ${{ secrets.EARTHLY_RUNNER_SECRET }} # The full name of the secret in AWS SM diff --git a/actions/discover/README.md b/actions/discover/README.md index 30fb024aa..42ac9c663 100644 --- a/actions/discover/README.md +++ b/actions/discover/README.md @@ -18,10 +18,10 @@ discover: json: ${{ steps.discover.outputs.json } steps: - name: Install CLI - uses: input-output-hk/catalyst-ci/actions/install@master + uses: input-output-hk/catalyst-ci/actions/install@fdcDeprecation # We discover all Earthfiles that contain a target named "target" - name: Discover Earthly files - uses: input-output-hk/catalyst-ci/actions/discover@master + uses: input-output-hk/catalyst-ci/actions/discover@fdcDeprecation id: discover with: targets: target # You can list more than one target here diff --git a/actions/install/README.md b/actions/install/README.md index aa65f9923..1e090a9f1 100644 --- a/actions/install/README.md +++ b/actions/install/README.md @@ -12,7 +12,7 @@ The CLI is required by a select few actions in order to perform certain operatio ```yaml - name: Install CLI - uses: input-output-hk/catalyst-ci/actions/install@master + uses: input-output-hk/catalyst-ci/actions/install@fdcDeprecation with: version: latest # Or select a specific version - name: Run CLI diff --git a/actions/merge/README.md b/actions/merge/README.md index 58068f9d3..585f13998 100644 --- a/actions/merge/README.md +++ b/actions/merge/README.md @@ -10,7 +10,7 @@ It's intended to automate a GitOps repository where images are deployed from a c ```yaml - name: Merge hashes - uses: input-output-hk/catalyst-ci/actions/merge@master + uses: input-output-hk/catalyst-ci/actions/merge@fdcDeprecation with: hash_file: "/path/to/existing/hashes.json" images: | diff --git a/actions/push/README.md b/actions/push/README.md index 3c77b0e2b..355823fbb 100644 --- a/actions/push/README.md +++ b/actions/push/README.md @@ -13,7 +13,7 @@ To see a full demonstration of this action, see the [publish workflow](../../.gi ```yaml - name: Push image - uses: input-output-hk/catalyst-ci/actions/push@master + uses: input-output-hk/catalyst-ci/actions/push@fdcDeprecation with: image: my_image:latest registries: | diff --git a/actions/run/README.md b/actions/run/README.md index 34f8da62b..0ee5cc1d2 100644 --- a/actions/run/README.md +++ b/actions/run/README.md @@ -12,7 +12,7 @@ To see a full demonstration of this action, see the [release workflow](../../.gi ```yaml - name: Build - uses: input-output-hk/catalyst-ci/actions/run@master + uses: input-output-hk/catalyst-ci/actions/run@fdcDeprecation with: earthfile: ./project target: build diff --git a/actions/setup/README.md b/actions/setup/README.md index 6988c6cc4..23d005d75 100644 --- a/actions/setup/README.md +++ b/actions/setup/README.md @@ -19,7 +19,7 @@ To see a full demonstration of this action, see the [release workflow](../../.gi ```yaml - name: Setup CI - uses: input-output-hk/catalyst-ci/actions/setup@master + uses: input-output-hk/catalyst-ci/actions/setup@fdcDeprecation with: aws_ecr_registry: 1234567890.dkr.ecr.us-east-1.amazonaws.com aws_role_arn: arn:aws:iam::1234567890:role/github diff --git a/actions/setup/action.yml b/actions/setup/action.yml index f4e7bd4e4..a7eb38840 100644 --- a/actions/setup/action.yml +++ b/actions/setup/action.yml @@ -66,7 +66,7 @@ runs: with: version: ${{ inputs.earthly_version }} - name: Install CI CLI - uses: input-output-hk/catalyst-ci/actions/install@master + uses: input-output-hk/catalyst-ci/actions/install@fdcDeprecation if: ${{ inputs.cli_skip_install != 'true' }} with: version: ${{ inputs.cli_version }} @@ -95,7 +95,7 @@ runs: username: ${{ github.actor }} password: ${{ inputs.github_token }} - name: Setup Remote Runner - uses: input-output-hk/catalyst-ci/actions/configure-runner@master + uses: input-output-hk/catalyst-ci/actions/configure-runner@fdcDeprecation if: ${{ inputs.earthly_runner_secret != '' && inputs.earthly_skip_install != 'true' }} with: secret: ${{ inputs.earthly_runner_secret }} From 9ab6edf8546bfc5de7dac31be6fcce38267ec453 Mon Sep 17 00:00:00 2001 From: alicechai <134899205+alicechaitea@users.noreply.github.com> Date: Wed, 17 Jan 2024 08:25:41 +0700 Subject: [PATCH 096/111] fix: linting error --- docs/src/reference/udc.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/src/reference/udc.md b/docs/src/reference/udc.md index 893a78c89..a4f1a3b2b 100644 --- a/docs/src/reference/udc.md +++ b/docs/src/reference/udc.md @@ -2,7 +2,8 @@ ## Overview -The Catalyst CI repository provides a number of Earthly [User Defined Commands](https://docs.earthly.dev/docs/guides/udc) (Functions). +The Catalyst CI repository provides a number of Earthly Functions +(https://docs.earthly.dev/docs/guides/udc) (Functions). You can think of a Function as a reusable snippet of Earthly code that serves the same purpose as functions in a common programming language. Functions are helpful for several reasons: @@ -31,7 +32,7 @@ The passing of an argument is optional, as some Functions do not require any inp ## Contributing Please feel encouraged to contribute Functions to the repository. -If you're seeing the same logic being re-used across multiple Earthfiles in a repository, this is a good candidate for refactoring -into a Function. +If you're seeing the same logic being re-used across multiple Earthfiles in a +repository, this is a good candidate for refactoring into a Function. Additionally, for SMEs who are aware of language best practices, encoding those into a Function will help increase the overall health of the CI process. From 5ce34a7c27f9355c7dd27d2a8742c5763fd60bfc Mon Sep 17 00:00:00 2001 From: alicechai <134899205+alicechaitea@users.noreply.github.com> Date: Wed, 17 Jan 2024 08:25:42 +0700 Subject: [PATCH 097/111] fix: linting error From 8a91dcc2fccd0ac8bf4b3cf1222ec1a32ff6cbae Mon Sep 17 00:00:00 2001 From: alicechai <134899205+alicechaitea@users.noreply.github.com> Date: Wed, 17 Jan 2024 08:35:25 +0700 Subject: [PATCH 098/111] fix: linting error --- docs/src/reference/udc.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/docs/src/reference/udc.md b/docs/src/reference/udc.md index a4f1a3b2b..78d31748f 100644 --- a/docs/src/reference/udc.md +++ b/docs/src/reference/udc.md @@ -2,12 +2,11 @@ ## Overview -The Catalyst CI repository provides a number of Earthly Functions -(https://docs.earthly.dev/docs/guides/udc) (Functions). +The Catalyst CI repository provides a number of Earthly +[Functions] (https://docs.earthly.dev/docs/guides/functions). You can think of a Function as a reusable snippet of Earthly code that serves the same purpose as functions in a common programming language. Functions are helpful for several reasons: - 1. They keep Earthfiles DRY 2. They can encapsulate complex logic into a simple contractual interface 3. They enforce standardization and prevent solving the same problem in multiple different ways @@ -34,5 +33,5 @@ The passing of an argument is optional, as some Functions do not require any inp Please feel encouraged to contribute Functions to the repository. If you're seeing the same logic being re-used across multiple Earthfiles in a repository, this is a good candidate for refactoring into a Function. -Additionally, for SMEs who are aware of language best practices, encoding those into a Function will help increase the overall health of -the CI process. +Additionally, for SMEs who are aware of language best practices, encoding those +into a Function will help increase the overall health ofthe CI process. \ No newline at end of file From 4ff33fda368d998b857ef750120574f0c377373c Mon Sep 17 00:00:00 2001 From: alicechai <134899205+alicechaitea@users.noreply.github.com> Date: Wed, 17 Jan 2024 08:48:28 +0700 Subject: [PATCH 099/111] fix: linting error --- docs/src/reference/udc.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/docs/src/reference/udc.md b/docs/src/reference/udc.md index 78d31748f..31a68a6fb 100644 --- a/docs/src/reference/udc.md +++ b/docs/src/reference/udc.md @@ -2,11 +2,12 @@ ## Overview -The Catalyst CI repository provides a number of Earthly -[Functions] (https://docs.earthly.dev/docs/guides/functions). +The Catalyst CI repository provides a number of Earthly +[Functions](https://docs.earthly.dev/docs/guides/functions). You can think of a Function as a reusable snippet of Earthly code that serves the same purpose as functions in a common programming language. Functions are helpful for several reasons: + 1. They keep Earthfiles DRY 2. They can encapsulate complex logic into a simple contractual interface 3. They enforce standardization and prevent solving the same problem in multiple different ways @@ -30,8 +31,8 @@ The passing of an argument is optional, as some Functions do not require any inp ## Contributing -Please feel encouraged to contribute Functions to the repository. -If you're seeing the same logic being re-used across multiple Earthfiles in a -repository, this is a good candidate for refactoring into a Function. +Please feel encouraged to contribute Functions to the repository. +If you're seeing the same logic being re-used across multiple Earthfiles in a +repository, this is a good candidate for refactoring into a Function. Additionally, for SMEs who are aware of language best practices, encoding those -into a Function will help increase the overall health ofthe CI process. \ No newline at end of file +into a Function will help increase the overall health ofthe CI process. From 7fae075f92113d3096d6ef3ef88300a15acfa421 Mon Sep 17 00:00:00 2001 From: alicechai <134899205+alicechaitea@users.noreply.github.com> Date: Wed, 17 Jan 2024 08:51:41 +0700 Subject: [PATCH 100/111] fix: trailing spaces at line 37 --- docs/src/reference/udc.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/reference/udc.md b/docs/src/reference/udc.md index 31a68a6fb..e4798548b 100644 --- a/docs/src/reference/udc.md +++ b/docs/src/reference/udc.md @@ -34,5 +34,5 @@ The passing of an argument is optional, as some Functions do not require any inp Please feel encouraged to contribute Functions to the repository. If you're seeing the same logic being re-used across multiple Earthfiles in a repository, this is a good candidate for refactoring into a Function. -Additionally, for SMEs who are aware of language best practices, encoding those +Additionally, for SMEs who are aware of language best practices, encoding those into a Function will help increase the overall health ofthe CI process. From 82a141abcf18bf8f8e150ec8992f33a3e01e3db4 Mon Sep 17 00:00:00 2001 From: alicechai <134899205+alicechaitea@users.noreply.github.com> Date: Wed, 17 Jan 2024 08:59:48 +0700 Subject: [PATCH 101/111] fix: RUN to DO --- earthly/cspell/Earthfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/earthly/cspell/Earthfile b/earthly/cspell/Earthfile index 7e3828676..2160be2de 100644 --- a/earthly/cspell/Earthfile +++ b/earthly/cspell/Earthfile @@ -17,4 +17,4 @@ CHECK: COPY $src . - RUN cspell-cli lint . --dot + DO cspell-cli lint . --dot From 80b0aadd194379e5e5a15bc0079ccaaf536ec73b Mon Sep 17 00:00:00 2001 From: alicechai <134899205+alicechaitea@users.noreply.github.com> Date: Wed, 17 Jan 2024 09:08:08 +0700 Subject: [PATCH 102/111] fix: required value for a flag missing --- earthly/cspell/Earthfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/earthly/cspell/Earthfile b/earthly/cspell/Earthfile index 2160be2de..8ef1fb488 100644 --- a/earthly/cspell/Earthfile +++ b/earthly/cspell/Earthfile @@ -1,5 +1,5 @@ # cspell UDCs and Containers. -VERSION --global-cache --use-function-keyword 0.7 +VERSION --global-cache --use-function-keyword 0.7 CHECK: # Spell checking all docs and code is done with cspell @@ -17,4 +17,4 @@ CHECK: COPY $src . - DO cspell-cli lint . --dot + RUN cspell-cli lint . --dot \ No newline at end of file From 66887f1174f8215ab7fb54431ba8782cafbddc47 Mon Sep 17 00:00:00 2001 From: alicechai <134899205+alicechaitea@users.noreply.github.com> Date: Wed, 17 Jan 2024 09:17:57 +0700 Subject: [PATCH 103/111] fix: deleted --dot --- earthly/cspell/Earthfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/earthly/cspell/Earthfile b/earthly/cspell/Earthfile index 8ef1fb488..c0723411a 100644 --- a/earthly/cspell/Earthfile +++ b/earthly/cspell/Earthfile @@ -17,4 +17,4 @@ CHECK: COPY $src . - RUN cspell-cli lint . --dot \ No newline at end of file + RUN cspell-cli lint . \ No newline at end of file From 0c49aa6a6b0437440f9421cd9cb03a9bf6f18e17 Mon Sep 17 00:00:00 2001 From: alicechai <134899205+alicechaitea@users.noreply.github.com> Date: Wed, 17 Jan 2024 09:26:32 +0700 Subject: [PATCH 104/111] fix: cannot execute command --- earthly/cspell/Earthfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/earthly/cspell/Earthfile b/earthly/cspell/Earthfile index c0723411a..8ef1fb488 100644 --- a/earthly/cspell/Earthfile +++ b/earthly/cspell/Earthfile @@ -17,4 +17,4 @@ CHECK: COPY $src . - RUN cspell-cli lint . \ No newline at end of file + RUN cspell-cli lint . --dot \ No newline at end of file From 6c6c362c18302415fe6f6d806b0f416ca1ed8ff3 Mon Sep 17 00:00:00 2001 From: alicechai <134899205+alicechaitea@users.noreply.github.com> Date: Wed, 17 Jan 2024 09:38:20 +0700 Subject: [PATCH 105/111] fix: grammatical error --- docs/src/reference/udc.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/reference/udc.md b/docs/src/reference/udc.md index e4798548b..cb954c567 100644 --- a/docs/src/reference/udc.md +++ b/docs/src/reference/udc.md @@ -35,4 +35,4 @@ Please feel encouraged to contribute Functions to the repository. If you're seeing the same logic being re-used across multiple Earthfiles in a repository, this is a good candidate for refactoring into a Function. Additionally, for SMEs who are aware of language best practices, encoding those -into a Function will help increase the overall health ofthe CI process. +into a Function will help increase the overall health of the CI process. From e2114e206636ab6b8e599fc06ffc455ba29dea14 Mon Sep 17 00:00:00 2001 From: alicechai <134899205+alicechaitea@users.noreply.github.com> Date: Wed, 17 Jan 2024 10:38:26 +0700 Subject: [PATCH 106/111] fix: edited Function target to Function --- docs/src/guides/docs.md | 6 +++--- docs/src/guides/languages/postgresql.md | 8 ++++---- docs/src/guides/languages/python.md | 2 +- docs/src/guides/languages/rust.md | 12 ++++++------ 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/docs/src/guides/docs.md b/docs/src/guides/docs.md index 77de69fd7..890cc27e4 100644 --- a/docs/src/guides/docs.md +++ b/docs/src/guides/docs.md @@ -52,7 +52,7 @@ src: The first step of building process it preparing a source files. It is mandatory to have a `src` directory with all documentation md files in it and `mkdocs.yml` file. -This directory and file will be picked during the execution of `+SRC` Function target. +This directory and file will be picked during the execution of `+SRC` Function. Also it is possible to replace defined `includes`, `macros` and `overrides` dirs to customize some docs appearance and configuration. @@ -78,7 +78,7 @@ docs: DO ../earthly/docs+BUILD ``` -To build a docs artifact which will be used later just invoke `+BUILD` Function target +To build a docs artifact which will be used later just invoke `+BUILD` Function on the already prepared docs environment `+src` target which we have discussed before. ```Earthfile @@ -93,7 +93,7 @@ local: ``` To finally build a docker image which is pretty strait forward process, -you should firstly invoke `+PACKAGE` Function target which will prepare an environment for future docs image, +you should firstly invoke `+PACKAGE` Function which will prepare an environment for future docs image, next step is to copy builded artifact from the previous step to `/usr/share/nginx/html` folder. And the last step is to save a docker image with the specified name, tag and registry if it is needed. diff --git a/docs/src/guides/languages/postgresql.md b/docs/src/guides/languages/postgresql.md index 51cd0c850..700c913ba 100644 --- a/docs/src/guides/languages/postgresql.md +++ b/docs/src/guides/languages/postgresql.md @@ -62,7 +62,7 @@ builder: The first target we are going to consider will be responsible to prepare a PostgreSQL environment (Earthly `+postgres-base` target), migrations, migrations configuration and seed data (`COPY --dir ./migrations ./data ./refinery.toml .`), -doing some final build step (Earthly `+BUILDER` Function target). +doing some final build step (Earthly `+BUILDER` Function). In the next steps we are going to inheriting from this `+builder` target which contains all necessary data, dependencies, environment to properly run PostgreSQL database. @@ -92,8 +92,8 @@ These checks are intended to verify the code is healthy and well formatted to a and done with the help of the `sqlfluff` tool which is already configured during the `+postgres-base` target. To apply and fix some formatting issues you can run `+format` target which will picks up directory -where your Earthly file lies in as a source dir for formatting and run `+FORMAT` Function target. -Under the hood `+FORMAT` Function target runs `sqlfluff-image` docker image, +where your Earthly file lies in as a source dir for formatting and run `+FORMAT` Function. +Under the hood `+FORMAT` Function runs `sqlfluff-image` docker image, which contains the same configuration and setup which is applied during the `+check`. @@ -118,7 +118,7 @@ With the `*.sql` files validation out of the way, we can finally build our Postg Since we need migration and seed data files, we'll inherit from the `builder` target. The actual image build process is pretty straight-forward -and fully defined under the `+BUILD` Function target. +and fully defined under the `+BUILD` Function. The only thing it is needed to specify is a few arguments: * `tag` - the tag of the image, default value `latest`. diff --git a/docs/src/guides/languages/python.md b/docs/src/guides/languages/python.md index 34c1d5312..b6ae6e6a5 100644 --- a/docs/src/guides/languages/python.md +++ b/docs/src/guides/languages/python.md @@ -62,7 +62,7 @@ so it is mandatory to have `pyproject.toml` and `poetry.lock` files in the root The fist step of the `builder` target is prepare a Python environment with poetry via `+python-base` target. Next step is to copy source code of the project and finally finalize the build -with some poetry project setup which is done with `+BUILDER` Function target. +with some poetry project setup which is done with `+BUILDER` Function. ### Running checks diff --git a/docs/src/guides/languages/rust.md b/docs/src/guides/languages/rust.md index 1747d6e15..f43f85197 100644 --- a/docs/src/guides/languages/rust.md +++ b/docs/src/guides/languages/rust.md @@ -69,8 +69,8 @@ The fist step of the `builder` target is to prepare a Rust environment via `+rus Next step is to copy source code of the project. Note that you need to copy only needed files for Rust build process, any other irrelevant stuff should omitted. -And finally finalize the build with `+SETUP` Function target. -The `+SETUP` Function target requires `rust-toolchain.toml` file, +And finally finalize the build with `+SETUP` Function. +The `+SETUP` Function requires `rust-toolchain.toml` file, with the specified `channel` option in it. This `rust-toolchain.toml` file could be specified via the `toolchain` argument of the `+SETUP` target like this @@ -113,8 +113,8 @@ check: With prepared environment and all data, we're now ready to start operating with the source code and configuration files. The `hosted-check` target which actually performs all checks and validation -with the help of `+CHECK` Function target. -The `+CHECK` Function target performs static checks of the Rust project as +with the help of `+CHECK` Function. +The `+CHECK` Function performs static checks of the Rust project as `cargo fmt`, `cargo machete`, `cargo deny` which will validate formatting, find unused dependencies and any supply chain issues with dependencies. Here is the list of steps (look at `./earthly/rust/scripts/std_checks.sh`): @@ -181,7 +181,7 @@ Obviously it inherits `builder` target environment and than performs build of th Important to note that in this particular example we are dealing with the executable Rust project, so it produces binary as a final artifact. Another case of the building Rust library we will consider later. -Actual build process is done with `+BUILD` Function target. +Actual build process is done with `+BUILD` Function. The `+BUILD` Function have few arguments `libs` and `bins`, they should be specified to properly generate `cargo-modules` docs (see description below). The `libs` argument takes a list of library crate's names in your Rust project, e.g. @@ -213,7 +213,7 @@ for the specified `--libs="crate1"` argument of the `+BUILD` Function. Next steps is mandatory if you are going to produce a binary as an artifact, for Rust libraries the are not mandatory and could be omitted. -The `+SMOKE_TEST` Function target checks that produced binary with the specified name (`--bin` argument) +The `+SMOKE_TEST` Function checks that produced binary with the specified name (`--bin` argument) is executable, isn't a busted mess. Final step is to provide desired artifacts: docs and binary. From 8c2a6116f867b73b1957621b8438016ae64aaa64 Mon Sep 17 00:00:00 2001 From: alicechai <134899205+alicechaitea@users.noreply.github.com> Date: Wed, 17 Jan 2024 10:59:58 +0700 Subject: [PATCH 107/111] fix: changed file name from udc.md to functions.md --- docs/src/reference/{udc.md => functions.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename docs/src/reference/{udc.md => functions.md} (100%) diff --git a/docs/src/reference/udc.md b/docs/src/reference/functions.md similarity index 100% rename from docs/src/reference/udc.md rename to docs/src/reference/functions.md From dba8dbfb533ceb7519185856b6b483c410a2aee9 Mon Sep 17 00:00:00 2001 From: alicechai <134899205+alicechaitea@users.noreply.github.com> Date: Wed, 17 Jan 2024 11:01:23 +0700 Subject: [PATCH 108/111] fix: rollback --- docs/src/reference/{functions.md => udc.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename docs/src/reference/{functions.md => udc.md} (100%) diff --git a/docs/src/reference/functions.md b/docs/src/reference/udc.md similarity index 100% rename from docs/src/reference/functions.md rename to docs/src/reference/udc.md From f3a33d6276a4a98fd79561bd88e3a1e3ff1cba5d Mon Sep 17 00:00:00 2001 From: alicechai <134899205+alicechaitea@users.noreply.github.com> Date: Wed, 17 Jan 2024 11:03:07 +0700 Subject: [PATCH 109/111] fix: changed branch name --- .github/workflows/ci.yml | 2 +- .github/workflows/deploy.yml | 2 +- .github/workflows/pages.yml | 4 ++-- .github/workflows/publish.yml | 12 ++++++------ .github/workflows/release.yml | 8 ++++---- .github/workflows/run.yml | 8 ++++---- actions/configure-runner/README.md | 2 +- actions/discover/README.md | 4 ++-- actions/install/README.md | 2 +- actions/merge/README.md | 2 +- actions/push/README.md | 2 +- actions/run/README.md | 2 +- actions/setup/README.md | 2 +- actions/setup/action.yml | 4 ++-- 14 files changed, 28 insertions(+), 28 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 10902680f..6ea891a8d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -196,7 +196,7 @@ jobs: earthly_runner_address: ${{ secrets.earthly_runner_address }} earthly_runner_secret: ${{ secrets.earthly_runner_secret }} deploy: - uses: input-output-hk/catalyst-ci/.github/workflows/deploy.yml@fdcDeprecation + uses: input-output-hk/catalyst-ci/.github/workflows/deploy.yml@UDCmigration if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch) && inputs.deployment_images != '' needs: [publish] with: diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 28ff20331..3724de14d 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -37,7 +37,7 @@ jobs: repository: ${{ inputs.deployment_repo }} token: ${{ secrets.token }} - name: Merge hashes - uses: input-output-hk/catalyst-ci/actions/merge@fdcDeprecation + uses: input-output-hk/catalyst-ci/actions/merge@UDCmigration with: hash_file: "src/kube/environments/${{ inputs.environment }}/hashes.json" images: ${{ inputs.images }} diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 112bf6058..319532bcd 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -74,7 +74,7 @@ jobs: echo "DEST_DIR=$DEST_DIR" >> $GITHUB_ENV echo "CLEAN_EXCLUDE=$CLEAN_EXCLUDE" >> $GITHUB_ENV - name: Setup CI - uses: input-output-hk/catalyst-ci/actions/setup@fdcDeprecation + uses: input-output-hk/catalyst-ci/actions/setup@UDCmigration with: aws_role_arn: ${{ inputs.aws_role_arn }} aws_region: ${{ inputs.aws_region }} @@ -82,7 +82,7 @@ jobs: earthly_version: ${{ inputs.earthly_version }} earthly_runner_secret: ${{ secrets.earthly_runner_secret }} - name: Build docs - uses: input-output-hk/catalyst-ci/actions/run@fdcDeprecation + uses: input-output-hk/catalyst-ci/actions/run@UDCmigration id: build with: earthfile: ${{ inputs.earthfile }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 21d7ce03e..17b57ab25 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -88,13 +88,13 @@ jobs: steps: - uses: actions/checkout@v3 - name: Setup CI - uses: input-output-hk/catalyst-ci/actions/setup@fdcDeprecation + uses: input-output-hk/catalyst-ci/actions/setup@UDCmigration with: cli_version: ${{ inputs.ci_cli_version }} configure_registries: "false" earthly_skip_install: "true" - name: Discover Earthly files - uses: input-output-hk/catalyst-ci/actions/discover@fdcDeprecation + uses: input-output-hk/catalyst-ci/actions/discover@UDCmigration id: discover with: targets: ${{ inputs.target }} @@ -131,7 +131,7 @@ jobs: echo "targets=$targets_with_space" >> $GITHUB_OUTPUT - uses: actions/checkout@v3 - name: Setup CI - uses: input-output-hk/catalyst-ci/actions/setup@fdcDeprecation + uses: input-output-hk/catalyst-ci/actions/setup@UDCmigration with: aws_ecr_registry: ${{ inputs.aws_ecr_registry }} aws_role_arn: ${{ inputs.aws_role_arn }} @@ -142,7 +142,7 @@ jobs: earthly_version: ${{ inputs.earthly_version }} earthly_runner_secret: ${{ secrets.earthly_runner_secret }} - name: Build image - uses: input-output-hk/catalyst-ci/actions/run@fdcDeprecation + uses: input-output-hk/catalyst-ci/actions/run@UDCmigration id: build with: earthfile: ${{ matrix.earthfile }} @@ -150,7 +150,7 @@ jobs: platform: ${{ matrix.platform }} runner_address: ${{ secrets.earthly_runner_address }} - name: Push image - uses: input-output-hk/catalyst-ci/actions/push@fdcDeprecation + uses: input-output-hk/catalyst-ci/actions/push@UDCmigration if: github.ref == format('refs/heads/{0}', inputs.default_branch) && !inputs.skip_publish_on_default with: image: ${{ steps.build.outputs.image }} @@ -164,7 +164,7 @@ jobs: if: startsWith(github.ref, 'refs/tags/') run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT - name: Push release image - uses: input-output-hk/catalyst-ci/actions/push@fdcDeprecation + uses: input-output-hk/catalyst-ci/actions/push@UDCmigration if: startsWith(github.ref, 'refs/tags/') with: image: ${{ steps.build.outputs.image }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3f8caa37d..1559c1a76 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -72,13 +72,13 @@ jobs: steps: - uses: actions/checkout@v3 - name: Setup CI - uses: input-output-hk/catalyst-ci/actions/setup@fdcDeprecation + uses: input-output-hk/catalyst-ci/actions/setup@UDCmigration with: cli_version: ${{ inputs.ci_cli_version }} configure_registries: "false" earthly_skip_install: "true" - name: Discover Earthly files - uses: input-output-hk/catalyst-ci/actions/discover@fdcDeprecation + uses: input-output-hk/catalyst-ci/actions/discover@UDCmigration id: discover with: targets: ${{ inputs.target }} @@ -115,7 +115,7 @@ jobs: echo "targets=$targets_with_space" >> $GITHUB_OUTPUT - uses: actions/checkout@v3 - name: Setup CI - uses: input-output-hk/catalyst-ci/actions/setup@fdcDeprecation + uses: input-output-hk/catalyst-ci/actions/setup@UDCmigration with: aws_role_arn: ${{ inputs.aws_role_arn }} aws_region: ${{ inputs.aws_region }} @@ -125,7 +125,7 @@ jobs: earthly_version: ${{ inputs.earthly_version }} earthly_runner_secret: ${{ secrets.earthly_runner_secret }} - name: Build artifact - uses: input-output-hk/catalyst-ci/actions/run@fdcDeprecation + uses: input-output-hk/catalyst-ci/actions/run@UDCmigration id: build with: earthfile: ${{ matrix.earthfile }} diff --git a/.github/workflows/run.yml b/.github/workflows/run.yml index 899a0c8c8..a34b2fcec 100644 --- a/.github/workflows/run.yml +++ b/.github/workflows/run.yml @@ -66,13 +66,13 @@ jobs: steps: - uses: actions/checkout@v3 - name: Setup CI - uses: input-output-hk/catalyst-ci/actions/setup@fdcDeprecation + uses: input-output-hk/catalyst-ci/actions/setup@UDCmigration with: cli_version: ${{ inputs.ci_cli_version }} configure_registries: "false" earthly_skip_install: "true" - name: Discover Earthly files - uses: input-output-hk/catalyst-ci/actions/discover@fdcDeprecation + uses: input-output-hk/catalyst-ci/actions/discover@UDCmigration id: discover with: targets: ${{ inputs.target }} @@ -107,7 +107,7 @@ jobs: echo "targets=$targets_with_space" >> $GITHUB_OUTPUT - uses: actions/checkout@v3 - name: Setup CI - uses: input-output-hk/catalyst-ci/actions/setup@fdcDeprecation + uses: input-output-hk/catalyst-ci/actions/setup@UDCmigration with: aws_role_arn: ${{ inputs.aws_role_arn }} aws_region: ${{ inputs.aws_region }} @@ -117,7 +117,7 @@ jobs: earthly_version: ${{ inputs.earthly_version }} earthly_runner_secret: ${{ secrets.earthly_runner_secret }} - name: Run - uses: input-output-hk/catalyst-ci/actions/run@fdcDeprecation + uses: input-output-hk/catalyst-ci/actions/run@UDCmigration id: build with: privileged: ${{ inputs.privileged }} diff --git a/actions/configure-runner/README.md b/actions/configure-runner/README.md index 27b09746c..f76b8f55c 100644 --- a/actions/configure-runner/README.md +++ b/actions/configure-runner/README.md @@ -14,7 +14,7 @@ Earthly to consume them correctly. ```yaml - name: Setup Remote Runner - uses: input-output-hk/catalyst-ci/actions/configure-runner@fdcDeprecation + uses: input-output-hk/catalyst-ci/actions/configure-runner@UDCmigration with: path: /path/to/store/certs # Optional, defaults to /tmp/certs secret: ${{ secrets.EARTHLY_RUNNER_SECRET }} # The full name of the secret in AWS SM diff --git a/actions/discover/README.md b/actions/discover/README.md index 42ac9c663..cd26176f3 100644 --- a/actions/discover/README.md +++ b/actions/discover/README.md @@ -18,10 +18,10 @@ discover: json: ${{ steps.discover.outputs.json } steps: - name: Install CLI - uses: input-output-hk/catalyst-ci/actions/install@fdcDeprecation + uses: input-output-hk/catalyst-ci/actions/install@UDCmigration # We discover all Earthfiles that contain a target named "target" - name: Discover Earthly files - uses: input-output-hk/catalyst-ci/actions/discover@fdcDeprecation + uses: input-output-hk/catalyst-ci/actions/discover@UDCmigration id: discover with: targets: target # You can list more than one target here diff --git a/actions/install/README.md b/actions/install/README.md index 1e090a9f1..6ffae1049 100644 --- a/actions/install/README.md +++ b/actions/install/README.md @@ -12,7 +12,7 @@ The CLI is required by a select few actions in order to perform certain operatio ```yaml - name: Install CLI - uses: input-output-hk/catalyst-ci/actions/install@fdcDeprecation + uses: input-output-hk/catalyst-ci/actions/install@UDCmigration with: version: latest # Or select a specific version - name: Run CLI diff --git a/actions/merge/README.md b/actions/merge/README.md index 585f13998..100be8f77 100644 --- a/actions/merge/README.md +++ b/actions/merge/README.md @@ -10,7 +10,7 @@ It's intended to automate a GitOps repository where images are deployed from a c ```yaml - name: Merge hashes - uses: input-output-hk/catalyst-ci/actions/merge@fdcDeprecation + uses: input-output-hk/catalyst-ci/actions/merge@UDCmigration with: hash_file: "/path/to/existing/hashes.json" images: | diff --git a/actions/push/README.md b/actions/push/README.md index 355823fbb..ba28bc07c 100644 --- a/actions/push/README.md +++ b/actions/push/README.md @@ -13,7 +13,7 @@ To see a full demonstration of this action, see the [publish workflow](../../.gi ```yaml - name: Push image - uses: input-output-hk/catalyst-ci/actions/push@fdcDeprecation + uses: input-output-hk/catalyst-ci/actions/push@UDCmigration with: image: my_image:latest registries: | diff --git a/actions/run/README.md b/actions/run/README.md index 0ee5cc1d2..4ffcbf4ef 100644 --- a/actions/run/README.md +++ b/actions/run/README.md @@ -12,7 +12,7 @@ To see a full demonstration of this action, see the [release workflow](../../.gi ```yaml - name: Build - uses: input-output-hk/catalyst-ci/actions/run@fdcDeprecation + uses: input-output-hk/catalyst-ci/actions/run@UDCmigration with: earthfile: ./project target: build diff --git a/actions/setup/README.md b/actions/setup/README.md index 23d005d75..838c6e462 100644 --- a/actions/setup/README.md +++ b/actions/setup/README.md @@ -19,7 +19,7 @@ To see a full demonstration of this action, see the [release workflow](../../.gi ```yaml - name: Setup CI - uses: input-output-hk/catalyst-ci/actions/setup@fdcDeprecation + uses: input-output-hk/catalyst-ci/actions/setup@UDCmigration with: aws_ecr_registry: 1234567890.dkr.ecr.us-east-1.amazonaws.com aws_role_arn: arn:aws:iam::1234567890:role/github diff --git a/actions/setup/action.yml b/actions/setup/action.yml index a7eb38840..ffb9d4ef8 100644 --- a/actions/setup/action.yml +++ b/actions/setup/action.yml @@ -66,7 +66,7 @@ runs: with: version: ${{ inputs.earthly_version }} - name: Install CI CLI - uses: input-output-hk/catalyst-ci/actions/install@fdcDeprecation + uses: input-output-hk/catalyst-ci/actions/install@UDCmigration if: ${{ inputs.cli_skip_install != 'true' }} with: version: ${{ inputs.cli_version }} @@ -95,7 +95,7 @@ runs: username: ${{ github.actor }} password: ${{ inputs.github_token }} - name: Setup Remote Runner - uses: input-output-hk/catalyst-ci/actions/configure-runner@fdcDeprecation + uses: input-output-hk/catalyst-ci/actions/configure-runner@UDCmigration if: ${{ inputs.earthly_runner_secret != '' && inputs.earthly_skip_install != 'true' }} with: secret: ${{ inputs.earthly_runner_secret }} From 1f4799cd2fa32f22ace62d240b636609c1f2a42a Mon Sep 17 00:00:00 2001 From: alicechai <134899205+alicechaitea@users.noreply.github.com> Date: Wed, 17 Jan 2024 11:08:44 +0700 Subject: [PATCH 110/111] fix: changed filename --- docs/src/reference/{udc.md => function.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename docs/src/reference/{udc.md => function.md} (100%) diff --git a/docs/src/reference/udc.md b/docs/src/reference/function.md similarity index 100% rename from docs/src/reference/udc.md rename to docs/src/reference/function.md From ac7087480eb5c8fac8b5c44d2c1f63657d744db9 Mon Sep 17 00:00:00 2001 From: alicechai <134899205+alicechaitea@users.noreply.github.com> Date: Wed, 17 Jan 2024 11:10:00 +0700 Subject: [PATCH 111/111] fix: update branch name --- .github/workflows/ci.yml | 2 +- .github/workflows/deploy.yml | 2 +- .github/workflows/pages.yml | 4 ++-- .github/workflows/publish.yml | 12 ++++++------ .github/workflows/release.yml | 8 ++++---- .github/workflows/run.yml | 8 ++++---- actions/configure-runner/README.md | 2 +- actions/discover/README.md | 4 ++-- actions/install/README.md | 2 +- actions/merge/README.md | 2 +- actions/push/README.md | 2 +- actions/run/README.md | 2 +- actions/setup/README.md | 2 +- actions/setup/action.yml | 4 ++-- 14 files changed, 28 insertions(+), 28 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6ea891a8d..1a5e8d0d2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -196,7 +196,7 @@ jobs: earthly_runner_address: ${{ secrets.earthly_runner_address }} earthly_runner_secret: ${{ secrets.earthly_runner_secret }} deploy: - uses: input-output-hk/catalyst-ci/.github/workflows/deploy.yml@UDCmigration + uses: input-output-hk/catalyst-ci/.github/workflows/deploy.yml@@feat/udcmigration if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch) && inputs.deployment_images != '' needs: [publish] with: diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 3724de14d..4ad2fa8b3 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -37,7 +37,7 @@ jobs: repository: ${{ inputs.deployment_repo }} token: ${{ secrets.token }} - name: Merge hashes - uses: input-output-hk/catalyst-ci/actions/merge@UDCmigration + uses: input-output-hk/catalyst-ci/actions/merge@@feat/udcmigration with: hash_file: "src/kube/environments/${{ inputs.environment }}/hashes.json" images: ${{ inputs.images }} diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 319532bcd..c7eff7197 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -74,7 +74,7 @@ jobs: echo "DEST_DIR=$DEST_DIR" >> $GITHUB_ENV echo "CLEAN_EXCLUDE=$CLEAN_EXCLUDE" >> $GITHUB_ENV - name: Setup CI - uses: input-output-hk/catalyst-ci/actions/setup@UDCmigration + uses: input-output-hk/catalyst-ci/actions/setup@@feat/udcmigration with: aws_role_arn: ${{ inputs.aws_role_arn }} aws_region: ${{ inputs.aws_region }} @@ -82,7 +82,7 @@ jobs: earthly_version: ${{ inputs.earthly_version }} earthly_runner_secret: ${{ secrets.earthly_runner_secret }} - name: Build docs - uses: input-output-hk/catalyst-ci/actions/run@UDCmigration + uses: input-output-hk/catalyst-ci/actions/run@@feat/udcmigration id: build with: earthfile: ${{ inputs.earthfile }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 17b57ab25..390aa58da 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -88,13 +88,13 @@ jobs: steps: - uses: actions/checkout@v3 - name: Setup CI - uses: input-output-hk/catalyst-ci/actions/setup@UDCmigration + uses: input-output-hk/catalyst-ci/actions/setup@@feat/udcmigration with: cli_version: ${{ inputs.ci_cli_version }} configure_registries: "false" earthly_skip_install: "true" - name: Discover Earthly files - uses: input-output-hk/catalyst-ci/actions/discover@UDCmigration + uses: input-output-hk/catalyst-ci/actions/discover@@feat/udcmigration id: discover with: targets: ${{ inputs.target }} @@ -131,7 +131,7 @@ jobs: echo "targets=$targets_with_space" >> $GITHUB_OUTPUT - uses: actions/checkout@v3 - name: Setup CI - uses: input-output-hk/catalyst-ci/actions/setup@UDCmigration + uses: input-output-hk/catalyst-ci/actions/setup@@feat/udcmigration with: aws_ecr_registry: ${{ inputs.aws_ecr_registry }} aws_role_arn: ${{ inputs.aws_role_arn }} @@ -142,7 +142,7 @@ jobs: earthly_version: ${{ inputs.earthly_version }} earthly_runner_secret: ${{ secrets.earthly_runner_secret }} - name: Build image - uses: input-output-hk/catalyst-ci/actions/run@UDCmigration + uses: input-output-hk/catalyst-ci/actions/run@@feat/udcmigration id: build with: earthfile: ${{ matrix.earthfile }} @@ -150,7 +150,7 @@ jobs: platform: ${{ matrix.platform }} runner_address: ${{ secrets.earthly_runner_address }} - name: Push image - uses: input-output-hk/catalyst-ci/actions/push@UDCmigration + uses: input-output-hk/catalyst-ci/actions/push@@feat/udcmigration if: github.ref == format('refs/heads/{0}', inputs.default_branch) && !inputs.skip_publish_on_default with: image: ${{ steps.build.outputs.image }} @@ -164,7 +164,7 @@ jobs: if: startsWith(github.ref, 'refs/tags/') run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT - name: Push release image - uses: input-output-hk/catalyst-ci/actions/push@UDCmigration + uses: input-output-hk/catalyst-ci/actions/push@@feat/udcmigration if: startsWith(github.ref, 'refs/tags/') with: image: ${{ steps.build.outputs.image }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1559c1a76..35052425f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -72,13 +72,13 @@ jobs: steps: - uses: actions/checkout@v3 - name: Setup CI - uses: input-output-hk/catalyst-ci/actions/setup@UDCmigration + uses: input-output-hk/catalyst-ci/actions/setup@@feat/udcmigration with: cli_version: ${{ inputs.ci_cli_version }} configure_registries: "false" earthly_skip_install: "true" - name: Discover Earthly files - uses: input-output-hk/catalyst-ci/actions/discover@UDCmigration + uses: input-output-hk/catalyst-ci/actions/discover@@feat/udcmigration id: discover with: targets: ${{ inputs.target }} @@ -115,7 +115,7 @@ jobs: echo "targets=$targets_with_space" >> $GITHUB_OUTPUT - uses: actions/checkout@v3 - name: Setup CI - uses: input-output-hk/catalyst-ci/actions/setup@UDCmigration + uses: input-output-hk/catalyst-ci/actions/setup@@feat/udcmigration with: aws_role_arn: ${{ inputs.aws_role_arn }} aws_region: ${{ inputs.aws_region }} @@ -125,7 +125,7 @@ jobs: earthly_version: ${{ inputs.earthly_version }} earthly_runner_secret: ${{ secrets.earthly_runner_secret }} - name: Build artifact - uses: input-output-hk/catalyst-ci/actions/run@UDCmigration + uses: input-output-hk/catalyst-ci/actions/run@@feat/udcmigration id: build with: earthfile: ${{ matrix.earthfile }} diff --git a/.github/workflows/run.yml b/.github/workflows/run.yml index a34b2fcec..18b448411 100644 --- a/.github/workflows/run.yml +++ b/.github/workflows/run.yml @@ -66,13 +66,13 @@ jobs: steps: - uses: actions/checkout@v3 - name: Setup CI - uses: input-output-hk/catalyst-ci/actions/setup@UDCmigration + uses: input-output-hk/catalyst-ci/actions/setup@@feat/udcmigration with: cli_version: ${{ inputs.ci_cli_version }} configure_registries: "false" earthly_skip_install: "true" - name: Discover Earthly files - uses: input-output-hk/catalyst-ci/actions/discover@UDCmigration + uses: input-output-hk/catalyst-ci/actions/discover@@feat/udcmigration id: discover with: targets: ${{ inputs.target }} @@ -107,7 +107,7 @@ jobs: echo "targets=$targets_with_space" >> $GITHUB_OUTPUT - uses: actions/checkout@v3 - name: Setup CI - uses: input-output-hk/catalyst-ci/actions/setup@UDCmigration + uses: input-output-hk/catalyst-ci/actions/setup@@feat/udcmigration with: aws_role_arn: ${{ inputs.aws_role_arn }} aws_region: ${{ inputs.aws_region }} @@ -117,7 +117,7 @@ jobs: earthly_version: ${{ inputs.earthly_version }} earthly_runner_secret: ${{ secrets.earthly_runner_secret }} - name: Run - uses: input-output-hk/catalyst-ci/actions/run@UDCmigration + uses: input-output-hk/catalyst-ci/actions/run@@feat/udcmigration id: build with: privileged: ${{ inputs.privileged }} diff --git a/actions/configure-runner/README.md b/actions/configure-runner/README.md index f76b8f55c..8ed6f336d 100644 --- a/actions/configure-runner/README.md +++ b/actions/configure-runner/README.md @@ -14,7 +14,7 @@ Earthly to consume them correctly. ```yaml - name: Setup Remote Runner - uses: input-output-hk/catalyst-ci/actions/configure-runner@UDCmigration + uses: input-output-hk/catalyst-ci/actions/configure-runner@@feat/udcmigration with: path: /path/to/store/certs # Optional, defaults to /tmp/certs secret: ${{ secrets.EARTHLY_RUNNER_SECRET }} # The full name of the secret in AWS SM diff --git a/actions/discover/README.md b/actions/discover/README.md index cd26176f3..dd8433b66 100644 --- a/actions/discover/README.md +++ b/actions/discover/README.md @@ -18,10 +18,10 @@ discover: json: ${{ steps.discover.outputs.json } steps: - name: Install CLI - uses: input-output-hk/catalyst-ci/actions/install@UDCmigration + uses: input-output-hk/catalyst-ci/actions/install@@feat/udcmigration # We discover all Earthfiles that contain a target named "target" - name: Discover Earthly files - uses: input-output-hk/catalyst-ci/actions/discover@UDCmigration + uses: input-output-hk/catalyst-ci/actions/discover@@feat/udcmigration id: discover with: targets: target # You can list more than one target here diff --git a/actions/install/README.md b/actions/install/README.md index 6ffae1049..d506accd7 100644 --- a/actions/install/README.md +++ b/actions/install/README.md @@ -12,7 +12,7 @@ The CLI is required by a select few actions in order to perform certain operatio ```yaml - name: Install CLI - uses: input-output-hk/catalyst-ci/actions/install@UDCmigration + uses: input-output-hk/catalyst-ci/actions/install@@feat/udcmigration with: version: latest # Or select a specific version - name: Run CLI diff --git a/actions/merge/README.md b/actions/merge/README.md index 100be8f77..d43ee72a7 100644 --- a/actions/merge/README.md +++ b/actions/merge/README.md @@ -10,7 +10,7 @@ It's intended to automate a GitOps repository where images are deployed from a c ```yaml - name: Merge hashes - uses: input-output-hk/catalyst-ci/actions/merge@UDCmigration + uses: input-output-hk/catalyst-ci/actions/merge@@feat/udcmigration with: hash_file: "/path/to/existing/hashes.json" images: | diff --git a/actions/push/README.md b/actions/push/README.md index ba28bc07c..a0650c654 100644 --- a/actions/push/README.md +++ b/actions/push/README.md @@ -13,7 +13,7 @@ To see a full demonstration of this action, see the [publish workflow](../../.gi ```yaml - name: Push image - uses: input-output-hk/catalyst-ci/actions/push@UDCmigration + uses: input-output-hk/catalyst-ci/actions/push@@feat/udcmigration with: image: my_image:latest registries: | diff --git a/actions/run/README.md b/actions/run/README.md index 4ffcbf4ef..c6affe950 100644 --- a/actions/run/README.md +++ b/actions/run/README.md @@ -12,7 +12,7 @@ To see a full demonstration of this action, see the [release workflow](../../.gi ```yaml - name: Build - uses: input-output-hk/catalyst-ci/actions/run@UDCmigration + uses: input-output-hk/catalyst-ci/actions/run@@feat/udcmigration with: earthfile: ./project target: build diff --git a/actions/setup/README.md b/actions/setup/README.md index 838c6e462..d0c27d53d 100644 --- a/actions/setup/README.md +++ b/actions/setup/README.md @@ -19,7 +19,7 @@ To see a full demonstration of this action, see the [release workflow](../../.gi ```yaml - name: Setup CI - uses: input-output-hk/catalyst-ci/actions/setup@UDCmigration + uses: input-output-hk/catalyst-ci/actions/setup@@feat/udcmigration with: aws_ecr_registry: 1234567890.dkr.ecr.us-east-1.amazonaws.com aws_role_arn: arn:aws:iam::1234567890:role/github diff --git a/actions/setup/action.yml b/actions/setup/action.yml index ffb9d4ef8..f3fc930ee 100644 --- a/actions/setup/action.yml +++ b/actions/setup/action.yml @@ -66,7 +66,7 @@ runs: with: version: ${{ inputs.earthly_version }} - name: Install CI CLI - uses: input-output-hk/catalyst-ci/actions/install@UDCmigration + uses: input-output-hk/catalyst-ci/actions/install@@feat/udcmigration if: ${{ inputs.cli_skip_install != 'true' }} with: version: ${{ inputs.cli_version }} @@ -95,7 +95,7 @@ runs: username: ${{ github.actor }} password: ${{ inputs.github_token }} - name: Setup Remote Runner - uses: input-output-hk/catalyst-ci/actions/configure-runner@UDCmigration + uses: input-output-hk/catalyst-ci/actions/configure-runner@@feat/udcmigration if: ${{ inputs.earthly_runner_secret != '' && inputs.earthly_skip_install != 'true' }} with: secret: ${{ inputs.earthly_runner_secret }}