diff --git a/Dockerfile b/Dockerfile index c88587a..d01b0e8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -35,17 +35,8 @@ RUN apk add --no-cache bash WORKDIR /app COPY --from=build /src/dist/build_linux_amd64/policy /app/ -COPY ./scripts/login.sh /app/login.sh -RUN chmod +x /app/login.sh - -COPY ./scripts/logout.sh /app/logout.sh -RUN chmod +x /app/logout.sh - -COPY ./scripts/build.sh /app/build.sh -RUN chmod +x /app/build.sh - -COPY ./scripts/push.sh /app/push.sh -RUN chmod +x /app/push.sh +COPY --from=build /src/scripts /app/ +RUN chmod +x /app/*.sh ENV POLICY_FILE_STORE_ROOT=/github/workspace/_policy diff --git a/go.mod b/go.mod index 8e27f0a..c40eba5 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,6 @@ go 1.16 // replace github.com/aserto-dev/aserto-runtime => ../aserto-runtime require ( - github.com/Microsoft/go-winio v0.5.0 // indirect github.com/Microsoft/hcsshim v0.8.20 // indirect github.com/alecthomas/kong v0.2.17 github.com/aserto-dev/aserto-runtime v0.0.24-0.20210902103415-12e69833e705 @@ -21,7 +20,6 @@ require ( github.com/docker/libtrust v0.0.0-20160708172513-aabc10ec26b7 // indirect github.com/dustin/go-humanize v1.0.0 github.com/golang/snappy v0.0.4-0.20210608040537-544b4180ac70 // indirect - github.com/google/go-cmp v0.5.6 // indirect github.com/google/go-containerregistry v0.6.0 github.com/google/uuid v1.3.0 github.com/google/wire v0.5.0 diff --git a/go.sum b/go.sum index 5510f7e..dff9209 100644 --- a/go.sum +++ b/go.sum @@ -108,8 +108,6 @@ github.com/aserto-dev/aserto-runtime v0.0.24-0.20210902103415-12e69833e705 h1:kx github.com/aserto-dev/aserto-runtime v0.0.24-0.20210902103415-12e69833e705/go.mod h1:7Y8y0Mq8fwnf3anJnINxqK+ffh5KMzwzt+/qO5EM4D0= github.com/aserto-dev/clui v0.0.1/go.mod h1:rk87XJefw6Pp8ef3nTirzMVTDE0g2BWojwAZy3cC/TY= github.com/aserto-dev/clui v0.1.1/go.mod h1:rk87XJefw6Pp8ef3nTirzMVTDE0g2BWojwAZy3cC/TY= -github.com/aserto-dev/clui v0.1.3 h1:vnc4DJgMWyon8vDspg1aRwERlXpEKEJBdKaZ5/Uj53k= -github.com/aserto-dev/clui v0.1.3/go.mod h1:mXYK1s48N0bAfpThOZvGfXk0bwehNHAzE5UxeJ/8q6c= github.com/aserto-dev/clui v0.1.4 h1:1hD2SKQkHNYC6KPJPo4D/0h/GgTyODqlpbgoMrIBXm8= github.com/aserto-dev/clui v0.1.4/go.mod h1:mXYK1s48N0bAfpThOZvGfXk0bwehNHAzE5UxeJ/8q6c= github.com/aserto-dev/go-utils v0.0.8 h1:mwfjMEHNFImFDvVTUK0oubEj4oyB6g6bfujCh6sy6+U= @@ -226,6 +224,7 @@ github.com/containerd/imgcrypt v1.1.1/go.mod h1:xpLnwiQmEUJPvQoAapeb2SNCxz7Xr6PJ github.com/containerd/nri v0.0.0-20201007170849-eb1350a75164/go.mod h1:+2wGSDGFYfE5+So4M5syatU0N0f0LbWpuqyMi4/BE8c= github.com/containerd/nri v0.0.0-20210316161719-dbaa18c31c14/go.mod h1:lmxnXF6oMkbqs39FiCt1s0R2HSMhcLel9vNL3m4AaeY= github.com/containerd/nri v0.1.0/go.mod h1:lmxnXF6oMkbqs39FiCt1s0R2HSMhcLel9vNL3m4AaeY= +github.com/containerd/stargz-snapshotter/estargz v0.7.0 h1:1d/rydzTywc76lnjJb6qbPCiTiCwts49AzKps/Ecblw= github.com/containerd/stargz-snapshotter/estargz v0.7.0/go.mod h1:83VWDqHnurTKliEB0YvWMiCfLDwv4Cjj1X9Vk98GJZw= github.com/containerd/ttrpc v0.0.0-20190828154514-0e0f228740de/go.mod h1:PvCDdDGpgqzQIzDW1TphrGLssLDZp2GuS+X5DkEJB8o= github.com/containerd/ttrpc v0.0.0-20190828172938-92c8520ef9f8/go.mod h1:PvCDdDGpgqzQIzDW1TphrGLssLDZp2GuS+X5DkEJB8o= @@ -455,7 +454,6 @@ github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/subcommands v1.0.1 h1:/eqq+otEXm5vhfBrbREPCSVQbvofip6kIz+mX5TUH7k= github.com/google/subcommands v1.0.1/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -953,7 +951,6 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.1-0.20200828183125-ce943fd02449/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= 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.4.2 h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= 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= @@ -1212,7 +1209,6 @@ golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.5 h1:ouewzE6p+/VEB31YYnTbEJdi8pFqKp4P4n85vwo3DHA= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/scripts/build.sh b/scripts/build.sh index fc9cce6..5227fa1 100644 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -58,7 +58,7 @@ CMD="/app/policy build ${SRC_PATH} --tag ${INPUT_TAG} --verbosity=${VERBOSITY}" eval "$CMD" || e_code=1 printf "\n" -if [ "${VERBOSITY}" -ge "2" ]; then +if [ "${VERBOSITY}" -ge "1" ]; then /app/policy images printf "\n" fi diff --git a/scripts/pull.sh b/scripts/pull.sh index 2f5a738..a107e4e 100644 --- a/scripts/pull.sh +++ b/scripts/pull.sh @@ -43,7 +43,7 @@ CMD="/app/policy pull ${INPUT_TAG} --verbosity=${VERBOSITY}" eval "$CMD" || e_code=1 printf "\n" -if [ "${VERBOSITY}" -ge "2" ]; then +if [ "${VERBOSITY}" -ge "1" ]; then /app/policy images printf "\n" fi diff --git a/scripts/push.sh b/scripts/push.sh index 0b45ffc..97b7756 100644 --- a/scripts/push.sh +++ b/scripts/push.sh @@ -43,7 +43,7 @@ CMD="/app/policy push ${INPUT_TAG} --verbosity=${VERBOSITY}" eval "$CMD" || e_code=1 printf "\n" -if [ "${VERBOSITY}" -ge "2" ]; then +if [ "${VERBOSITY}" -ge "1" ]; then /app/policy images --remote printf "\n" fi diff --git a/scripts/rm.sh b/scripts/rm.sh index fb641c8..90f78df 100644 --- a/scripts/rm.sh +++ b/scripts/rm.sh @@ -43,7 +43,7 @@ CMD="/app/policy rm ${INPUT_TAG} --verbosity=${VERBOSITY}" eval "$CMD" || e_code=1 printf "\n" -if [ "${VERBOSITY}" -ge "2" ]; then +if [ "${VERBOSITY}" -ge "1" ]; then /app/policy images printf "\n" fi diff --git a/scripts/test.sh b/scripts/test.sh deleted file mode 100755 index c468734..0000000 --- a/scripts/test.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/env bash - -[ -z "$1" ] && echo "provide container version, for example: latest" && exit 1 - -CONTAINER=ghcr.io/opcr-io/policy:$1 - -# reset -sudo rm -rf /tmp/policytest - -# init -mkdir -p /tmp/policytest -gh repo clone aserto-dev/policy-peoplefinder /tmp/policytest/peoplefinder - -docker run -ti \ --e INPUT_USERNAME=gertd \ --e INPUT_PASSWORD=${GIT_TOKEN} \ --e INPUT_SERVER= \ --e INPUT_VERBOSITY= \ --e GITHUB_WORKSPACE=/github/workspace \ --v "/tmp/policytest":"/github/workspace" \ ---entrypoint=/app/login.sh \ -${CONTAINER} - -docker run -ti \ --e INPUT_SRC=peoplefinder/src \ --e INPUT_TAG=datadude/peoplefinder:$(sver -n patch) \ --e INPUT_REVISION=$(sver) \ --e INPUT_SERVER= \ --e INPUT_VERBOSITY= \ --e GITHUB_WORKSPACE=/github/workspace \ --v "/tmp/policytest":"/github/workspace" \ ---entrypoint=/app/build.sh \ -${CONTAINER} - -docker run -ti \ --e INPUT_TAG=datadude/peoplefinder:$(sver -n patch) \ --e INPUT_SERVER= \ --e INPUT_VERBOSITY= \ --e GITHUB_WORKSPACE=/github/workspace \ --v "/tmp/policytest":"/github/workspace" \ ---entrypoint=/app/push.sh \ -${CONTAINER} - -docker run -ti \ --e INPUT_SERVER= \ --e INPUT_VERBOSITY= \ --e GITHUB_WORKSPACE=/github/workspace \ --v "/tmp/policytest":"/github/workspace" \ ---entrypoint=/app/logout.sh \ -${CONTAINER}