Skip to content

Commit

Permalink
Merge pull request #55 from codefresh-io/CR-10626-sync-v1.2.0
Browse files Browse the repository at this point in the history
CR-10626-sync-v1.2.0
  • Loading branch information
elad-codefresh authored May 12, 2022
2 parents 21e8831 + 54192d0 commit b0ed42c
Show file tree
Hide file tree
Showing 260 changed files with 25,889 additions and 6,307 deletions.
3 changes: 3 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ updates:
directory: "/"
schedule:
interval: "daily"
ignore:
- dependency-name: k8s.io/*

- package-ecosystem: "github-actions"
directory: "/"
schedule:
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ jobs:
name: Run end-to-end tests
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
- uses: actions/checkout@v2
- name: Setup k3s
run: |
Expand All @@ -29,6 +33,7 @@ jobs:
sudo cp /etc/rancher/k3s/k3s.yaml ~/.kube/config
sudo chmod 755 ~/.kube/config
kubectl version
kubectl create ns argo-rollouts
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gh-pages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16
go-version: 1.17
- name: build
run: |
pip install mkdocs mkdocs_material
Expand Down
57 changes: 16 additions & 41 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@ jobs:
name: Lint Go code
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.17
- name: Checkout code
uses: actions/checkout@v2
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v2
uses: golangci/golangci-lint-action@v3
with:
version: v1.30
args: --timeout 5m
Expand All @@ -27,7 +31,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16
go-version: 1.17
id: go

- name: Check out code into the Go module directory
Expand Down Expand Up @@ -56,7 +60,7 @@ jobs:
path: coverage.out

- name: Upload code coverage information to codecov.io
uses: codecov/codecov-action@v2.0.3
uses: codecov/codecov-action@v2.1.0
with:
file: coverage.out

Expand All @@ -65,14 +69,19 @@ jobs:
runs-on: ubuntu-latest
env:
GOPATH: /home/runner/go
PROTOC_ZIP: protoc-3.12.3-linux-x86_64.zip
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Golang
uses: actions/setup-go@v1
with:
go-version: 1.16.2
go-version: 1.17.6
# k8s codegen generates files into GOPATH location instead of the GitHub git checkout location
# This symlink is necessary to ensure that `git diff` detects changes
- name: Create symlink in GOPATH
run: |
mkdir -p ~/go/src/github.com/argoproj
ln -s $(pwd) ~/go/src/github.com/argoproj/argo-rollouts
- uses: actions/cache@v2
with:
path: /home/runner/.cache/go-build
Expand All @@ -85,53 +94,19 @@ jobs:
with:
path: /home/runner/go/bin
key: go-bin-v1-${{ hashFiles('**/go.mod') }}
- uses: actions/cache@v2
with:
path: protoc-3.12.3-linux-x86_64.zip
key: protoc-3.12.3-linux-x86_64.zip
- name: Install protoc
run: |
set -eux -o pipefail
curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v3.12.3/$PROTOC_ZIP
sudo unzip -o $PROTOC_ZIP -d /usr/local bin/protoc
sudo unzip -o $PROTOC_ZIP -d /usr/local 'include/*'
sudo chmod +x /usr/local/bin/protoc
sudo find /usr/local/include -type f | xargs sudo chmod a+r
sudo find /usr/local/include -type d | xargs sudo chmod a+rx
ls /usr/local/include/google/protobuf/
make install-toolchain
- name: Add ~/go/bin to PATH
run: |
echo "/home/runner/go/bin" >> $GITHUB_PATH
- name: Add /usr/local/bin to PATH
run: |
echo "/usr/local/bin" >> $GITHUB_PATH
- name: Create links
run: |
mkdir -p ~/go/src/github.com/argoproj
cp -a ../argo-rollouts ~/go/src/github.com/argoproj
- name: Vendor and Download
run: |
go mod vendor -v
go mod download
- name: Install UI code generator
run: |
wget https://repo1.maven.org/maven2/io/swagger/codegen/v3/swagger-codegen-cli/3.0.25/swagger-codegen-cli-3.0.25.jar -O swagger-codegen-cli.jar
echo "#!/usr/bin/java -jar" > swagger-codegen
cat swagger-codegen-cli.jar >> swagger-codegen
chmod +x swagger-codegen
sudo mv swagger-codegen /usr/local/bin/swagger-codegen
rm swagger-codegen-cli.jar
- uses: actions/setup-java@v1
with:
java-version: "9.0.4"

- name: Run codegen
run: |
make go-mod-vendor
make codegen
make manifests
make docs
Expand Down
41 changes: 40 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ on:
tag:
description: Git tag to build release from
required: true

jobs:
release-images:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -109,30 +108,70 @@ jobs:
release-artifacts:
runs-on: ubuntu-latest
needs: release-images

steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ github.event.inputs.tag }}

- name: Setup Golang
uses: actions/setup-go@v2
with:
go-version: 1.17.6

- name: Generate release artifacts
run: |
make release-plugins
make manifests IMAGE_TAG=${{ github.event.inputs.tag }}
- name: Generate SBOM (spdx)
id: spdx-builder
env:
# defines the spdx/spdx-sbom-generator version to use.
SPDX_GEN_VERSION: v0.0.13
# defines the sigs.k8s.io/bom version to use.
SIGS_BOM_VERSION: v0.2.1
# comma delimited list of project relative folders to inspect for package
# managers (gomod, yarn, npm).
PROJECT_FOLDERS: ".,./ui"
# full qualified name of the docker image to be inspected
DOCKER_IMAGE: quay.io/argoproj/argo-rollouts:${{ github.event.inputs.tag }}

run: |
yarn install --cwd ./ui
go install github.com/spdx/spdx-sbom-generator/cmd/generator@$SPDX_GEN_VERSION
go install sigs.k8s.io/bom/cmd/bom@$SIGS_BOM_VERSION
# Generate SPDX for project dependencies analyzing package managers
for folder in $(echo $PROJECT_FOLDERS | sed "s/,/ /g")
do
generator -p $folder -o /tmp
done
# Generate SPDX for binaries analyzing the docker image
if [[ ! -z $DOCKER_IMAGE ]]; then
bom generate -o /tmp/bom-docker-image.spdx -i $DOCKER_IMAGE
fi
cd /tmp && tar -zcf sbom.tar.gz *.spdx
- name: Draft release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.event.inputs.tag }}
draft: true
files: |
dist/kubectl-argo-rollouts-linux-amd64
dist/kubectl-argo-rollouts-linux-arm64
dist/kubectl-argo-rollouts-darwin-amd64
dist/kubectl-argo-rollouts-windows-amd64
manifests/dashboard-install.yaml
manifests/install.yaml
manifests/namespace-install.yaml
manifests/notifications-install.yaml
docs/features/kustomize/rollout_cr_schema.json
/tmp/sbom.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7 changes: 7 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
formats: all
mkdocs:
fail_on_warning: false
python:
install:
- requirements: docs/requirements.txt
12 changes: 5 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Initial stage which pulls prepares build dependencies and CLI tooling we need for our final image
# Also used as the image in CI jobs so needs all dependencies
####################################################################################################
FROM golang:1.16.3 as builder
FROM golang:1.17.6 as builder

RUN apt-get update && apt-get install -y \
wget \
Expand All @@ -12,9 +12,7 @@ RUN apt-get update && apt-get install -y \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# Install golangci-lint
RUN wget https://install.goreleaser.com/github.com/golangci/golangci-lint.sh && \
chmod +x ./golangci-lint.sh && \
./golangci-lint.sh -b $GOPATH/bin && \
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.44.0 && \
golangci-lint linters

COPY .golangci.yml ${GOPATH}/src/dummy/.golangci.yml
Expand Down Expand Up @@ -42,7 +40,7 @@ RUN NODE_ENV='production' yarn build
####################################################################################################
# Rollout Controller Build stage which performs the actual build of argo-rollouts binaries
####################################################################################################
FROM golang:1.16.3 as argo-rollouts-build
FROM golang:1.17.6 as argo-rollouts-build

WORKDIR /go/src/github.com/argoproj/argo-rollouts

Expand All @@ -63,15 +61,15 @@ RUN touch ui/dist/node_modules.marker && \
touch ui/dist/app/index.html && \
find ui/dist

ARG MAKE_TARGET="controller plugin-linux plugin-darwin plugin-windows"
ARG MAKE_TARGET="controller plugin plugin-linux plugin-darwin plugin-windows"
RUN make ${MAKE_TARGET}

####################################################################################################
# Kubectl plugin image
####################################################################################################
FROM docker.io/library/ubuntu:20.10 as kubectl-argo-rollouts

COPY --from=argo-rollouts-build /go/src/github.com/argoproj/argo-rollouts/dist/kubectl-argo-rollouts-linux-amd64 /bin/kubectl-argo-rollouts
COPY --from=argo-rollouts-build /go/src/github.com/argoproj/argo-rollouts/dist/kubectl-argo-rollouts /bin/kubectl-argo-rollouts

USER 999

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
####################################################################################################
# argo-rollouts-dev
####################################################################################################
FROM golang:1.16.3 as builder
FROM golang:1.17.6 as builder

RUN apt-get update && apt-get install -y \
ca-certificates && \
Expand Down
Loading

0 comments on commit b0ed42c

Please sign in to comment.