From 294e824c9db9f4a2341d24b1e04ed11399dea1a8 Mon Sep 17 00:00:00 2001 From: Shubham Chaudhary Date: Tue, 15 Oct 2024 23:33:54 +0530 Subject: [PATCH] (chore): Fix the build, push, and release pipelines (#716) * (chore): Fix the build, push, and release pipelines Signed-off-by: Shubham Chaudhary * (chore): Fix the dockerfile Signed-off-by: Shubham Chaudhary --------- Signed-off-by: Shubham Chaudhary --- .github/workflows/build.yml | 11 ++--------- .github/workflows/push.yml | 11 ++--------- .github/workflows/release.yml | 6 ------ build/Dockerfile | 20 ++++++++++---------- 4 files changed, 14 insertions(+), 34 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ba410e6e1..db0b66c9f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,13 +18,6 @@ jobs: with: ref: ${{ github.event.pull_request.head.sha }} - #TODO: Add Dockerfile linting - # Running go-lint - - name: Checking Go-Lint - run : | - sudo apt-get update && sudo apt-get install golint - make gotasks - - name: gofmt check run: | if [ "$(gofmt -s -l . | wc -l)" -ne 0 ] @@ -33,7 +26,7 @@ jobs: gofmt -s -l . exit 1 fi - + - name: golangci-lint uses: reviewdog/action-golangci-lint@v1 @@ -93,7 +86,7 @@ jobs: - name: Build an image from Dockerfile run: | docker build -f build/Dockerfile -t docker.io/litmuschaos/go-runner:${{ github.sha }} . --build-arg TARGETARCH=amd64 --build-arg LITMUS_VERSION=3.10.0 - + - name: Run Trivy vulnerability scanner uses: aquasecurity/trivy-action@master with: diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 6401fd5de..68fbcdafc 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -16,13 +16,6 @@ jobs: go-version: '1.20' - uses: actions/checkout@v2 - #TODO: Add Dockerfile linting - # Running go-lint - - name: Checking Go-Lint - run : | - sudo apt-get update && sudo apt-get install golint - make gotasks - - name: gofmt check run: | if [ "$(gofmt -s -l . | wc -l)" -ne 0 ] @@ -31,9 +24,9 @@ jobs: gofmt -s -l . exit 1 fi - + - name: golangci-lint - uses: reviewdog/action-golangci-lint@v1 + uses: reviewdog/action-golangci-lint@v1 push: needs: pre-checks diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5710c8feb..8a633e7a6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,12 +15,6 @@ jobs: go-version: '1.20' - uses: actions/checkout@v2 - #TODO: Add Dockerfile linting - # Running go-lint - - name: Checking Go-Lint - run : | - sudo apt-get update && sudo apt-get install golint - make gotasks push: needs: pre-checks runs-on: ubuntu-latest diff --git a/build/Dockerfile b/build/Dockerfile index fb0a1e38d..fa79eb08b 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -27,17 +27,17 @@ RUN yum install -y \ sudo \ sshpass \ procps - + # tc binary -RUN yum install -y https://dl.rockylinux.org/pub/rocky/9/devel/$(uname -m)/os/Packages/i/iproute-6.2.0-6.el9_4.$(uname -m).rpm -RUN yum install -y https://dl.rockylinux.org/pub/rocky/9/devel/$(uname -m)/os/Packages/i/iproute-tc-6.2.0-6.el9_4.$(uname -m).rpm - +RUN yum install -y https://dl.rockylinux.org/vault/rocky/9.3/devel/$(uname -m)/os/Packages/i/iproute-6.2.0-5.el9.$(uname -m).rpm +RUN yum install -y https://dl.rockylinux.org/vault/rocky/9.3/devel/$(uname -m)/os/Packages/i/iproute-tc-6.2.0-5.el9.$(uname -m).rpm + # iptables -RUN yum install -y https://dl.rockylinux.org/pub/rocky/9/devel/$(uname -m)/os/Packages/i/iptables-libs-1.8.10-2.el9.$(uname -m).rpm -RUN yum install -y https://dl.fedoraproject.org/pub/epel/9/Everything/$(uname -m)/Packages/i/iptables-legacy-libs-1.8.10-2.2.el9.$(uname -m).rpm -RUN yum install -y https://dl.fedoraproject.org/pub/epel/9/Everything/$(uname -m)/Packages/i/iptables-legacy-1.8.10-2.2.el9.$(uname -m).rpm +RUN yum install -y https://dl.rockylinux.org/vault/rocky/9.3/devel/$(uname -m)/os/Packages/i/iptables-libs-1.8.8-6.el9_1.$(uname -m).rpm +RUN yum install -y https://dl.fedoraproject.org/pub/archive/epel/9.3/Everything/$(uname -m)/Packages/i/iptables-legacy-libs-1.8.8-6.el9.2.$(uname -m).rpm +RUN yum install -y https://dl.fedoraproject.org/pub/archive/epel/9.3/Everything/$(uname -m)/Packages/i/iptables-legacy-1.8.8-6.el9.2.$(uname -m).rpm -# stress-ng +# stress-ng RUN yum install -y https://yum.oracle.com/repo/OracleLinux/OL9/appstream/$(uname -m)/getPackage/Judy-1.0.5-28.el9.$(uname -m).rpm RUN yum install -y https://yum.oracle.com/repo/OracleLinux/OL9/appstream/$(uname -m)/getPackage/stress-ng-0.14.00-2.el9.$(uname -m).rpm @@ -72,7 +72,7 @@ RUN curl -L https://litmus-http-proxy.s3.amazonaws.com/cli/cli/toxiproxy-cli-lin chmod 755 /sbin/toxiproxy-cli RUN curl -L https://litmus-http-proxy.s3.amazonaws.com/server/server/toxiproxy-server-linux-${TARGETARCH}.tar.gz --output toxiproxy-server-linux-${TARGETARCH}.tar.gz && \ tar zxvf toxiproxy-server-linux-${TARGETARCH}.tar.gz -C /sbin/ && \ - chmod 755 /sbin/toxiproxy-server + chmod 755 /sbin/toxiproxy-server ENV APP_USER=litmus ENV APP_DIR="/$APP_USER" @@ -93,7 +93,7 @@ WORKDIR $APP_DIR COPY --from=builder /output/ . COPY --from=docker:27.0.3 /usr/local/bin/docker /sbin/docker -RUN chmod 755 /sbin/docker +RUN chmod 755 /sbin/docker # Set permissions and ownership for the copied binaries RUN chmod 755 ./experiments ./helpers && \