Skip to content

Commit b0ed42c

Browse files
Merge pull request #55 from codefresh-io/CR-10626-sync-v1.2.0
CR-10626-sync-v1.2.0
2 parents 21e8831 + 54192d0 commit b0ed42c

File tree

260 files changed

+25889
-6307
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

260 files changed

+25889
-6307
lines changed

.github/dependabot.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ updates:
44
directory: "/"
55
schedule:
66
interval: "daily"
7+
ignore:
8+
- dependency-name: k8s.io/*
9+
710
- package-ecosystem: "github-actions"
811
directory: "/"
912
schedule:

.github/workflows/e2e.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ jobs:
2121
name: Run end-to-end tests
2222
runs-on: ubuntu-latest
2323
steps:
24+
- name: Set up Go
25+
uses: actions/setup-go@v2
26+
with:
27+
go-version: 1.17
2428
- uses: actions/checkout@v2
2529
- name: Setup k3s
2630
run: |
@@ -29,6 +33,7 @@ jobs:
2933
sudo cp /etc/rancher/k3s/k3s.yaml ~/.kube/config
3034
sudo chmod 755 ~/.kube/config
3135
kubectl version
36+
kubectl create ns argo-rollouts
3237
- uses: actions/cache@v2
3338
with:
3439
path: ~/go/pkg/mod

.github/workflows/gh-pages.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Set up Go
1717
uses: actions/setup-go@v2
1818
with:
19-
go-version: 1.16
19+
go-version: 1.17
2020
- name: build
2121
run: |
2222
pip install mkdocs mkdocs_material

.github/workflows/go.yml

Lines changed: 16 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,14 @@ jobs:
1313
name: Lint Go code
1414
runs-on: ubuntu-latest
1515
steps:
16+
- name: Set up Go
17+
uses: actions/setup-go@v3
18+
with:
19+
go-version: 1.17
1620
- name: Checkout code
1721
uses: actions/checkout@v2
1822
- name: Run golangci-lint
19-
uses: golangci/golangci-lint-action@v2
23+
uses: golangci/golangci-lint-action@v3
2024
with:
2125
version: v1.30
2226
args: --timeout 5m
@@ -27,7 +31,7 @@ jobs:
2731
- name: Set up Go
2832
uses: actions/setup-go@v2
2933
with:
30-
go-version: 1.16
34+
go-version: 1.17
3135
id: go
3236

3337
- name: Check out code into the Go module directory
@@ -56,7 +60,7 @@ jobs:
5660
path: coverage.out
5761

5862
- name: Upload code coverage information to codecov.io
59-
uses: codecov/codecov-action@v2.0.3
63+
uses: codecov/codecov-action@v2.1.0
6064
with:
6165
file: coverage.out
6266

@@ -65,14 +69,19 @@ jobs:
6569
runs-on: ubuntu-latest
6670
env:
6771
GOPATH: /home/runner/go
68-
PROTOC_ZIP: protoc-3.12.3-linux-x86_64.zip
6972
steps:
7073
- name: Checkout code
7174
uses: actions/checkout@v2
7275
- name: Setup Golang
7376
uses: actions/setup-go@v1
7477
with:
75-
go-version: 1.16.2
78+
go-version: 1.17.6
79+
# k8s codegen generates files into GOPATH location instead of the GitHub git checkout location
80+
# This symlink is necessary to ensure that `git diff` detects changes
81+
- name: Create symlink in GOPATH
82+
run: |
83+
mkdir -p ~/go/src/github.com/argoproj
84+
ln -s $(pwd) ~/go/src/github.com/argoproj/argo-rollouts
7685
- uses: actions/cache@v2
7786
with:
7887
path: /home/runner/.cache/go-build
@@ -85,53 +94,19 @@ jobs:
8594
with:
8695
path: /home/runner/go/bin
8796
key: go-bin-v1-${{ hashFiles('**/go.mod') }}
88-
- uses: actions/cache@v2
89-
with:
90-
path: protoc-3.12.3-linux-x86_64.zip
91-
key: protoc-3.12.3-linux-x86_64.zip
9297
- name: Install protoc
9398
run: |
94-
set -eux -o pipefail
95-
curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v3.12.3/$PROTOC_ZIP
96-
sudo unzip -o $PROTOC_ZIP -d /usr/local bin/protoc
97-
sudo unzip -o $PROTOC_ZIP -d /usr/local 'include/*'
98-
sudo chmod +x /usr/local/bin/protoc
99-
sudo find /usr/local/include -type f | xargs sudo chmod a+r
100-
sudo find /usr/local/include -type d | xargs sudo chmod a+rx
101-
ls /usr/local/include/google/protobuf/
102-
99+
make install-toolchain
103100
- name: Add ~/go/bin to PATH
104101
run: |
105102
echo "/home/runner/go/bin" >> $GITHUB_PATH
106103
- name: Add /usr/local/bin to PATH
107104
run: |
108105
echo "/usr/local/bin" >> $GITHUB_PATH
109106
110-
- name: Create links
111-
run: |
112-
mkdir -p ~/go/src/github.com/argoproj
113-
cp -a ../argo-rollouts ~/go/src/github.com/argoproj
114-
115-
- name: Vendor and Download
116-
run: |
117-
go mod vendor -v
118-
go mod download
119-
120-
- name: Install UI code generator
121-
run: |
122-
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
123-
echo "#!/usr/bin/java -jar" > swagger-codegen
124-
cat swagger-codegen-cli.jar >> swagger-codegen
125-
chmod +x swagger-codegen
126-
sudo mv swagger-codegen /usr/local/bin/swagger-codegen
127-
rm swagger-codegen-cli.jar
128-
129-
- uses: actions/setup-java@v1
130-
with:
131-
java-version: "9.0.4"
132-
133107
- name: Run codegen
134108
run: |
109+
make go-mod-vendor
135110
make codegen
136111
make manifests
137112
make docs

.github/workflows/release.yaml

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ on:
66
tag:
77
description: Git tag to build release from
88
required: true
9-
109
jobs:
1110
release-images:
1211
runs-on: ubuntu-latest
@@ -109,30 +108,70 @@ jobs:
109108
110109
release-artifacts:
111110
runs-on: ubuntu-latest
111+
needs: release-images
112112

113113
steps:
114114
- name: Checkout
115115
uses: actions/checkout@v2
116116
with:
117117
ref: ${{ github.event.inputs.tag }}
118118

119+
- name: Setup Golang
120+
uses: actions/setup-go@v2
121+
with:
122+
go-version: 1.17.6
123+
119124
- name: Generate release artifacts
120125
run: |
121126
make release-plugins
122127
make manifests IMAGE_TAG=${{ github.event.inputs.tag }}
123128
129+
- name: Generate SBOM (spdx)
130+
id: spdx-builder
131+
env:
132+
# defines the spdx/spdx-sbom-generator version to use.
133+
SPDX_GEN_VERSION: v0.0.13
134+
# defines the sigs.k8s.io/bom version to use.
135+
SIGS_BOM_VERSION: v0.2.1
136+
# comma delimited list of project relative folders to inspect for package
137+
# managers (gomod, yarn, npm).
138+
PROJECT_FOLDERS: ".,./ui"
139+
# full qualified name of the docker image to be inspected
140+
DOCKER_IMAGE: quay.io/argoproj/argo-rollouts:${{ github.event.inputs.tag }}
141+
142+
run: |
143+
yarn install --cwd ./ui
144+
go install github.com/spdx/spdx-sbom-generator/cmd/generator@$SPDX_GEN_VERSION
145+
go install sigs.k8s.io/bom/cmd/bom@$SIGS_BOM_VERSION
146+
147+
# Generate SPDX for project dependencies analyzing package managers
148+
for folder in $(echo $PROJECT_FOLDERS | sed "s/,/ /g")
149+
do
150+
generator -p $folder -o /tmp
151+
done
152+
153+
# Generate SPDX for binaries analyzing the docker image
154+
if [[ ! -z $DOCKER_IMAGE ]]; then
155+
bom generate -o /tmp/bom-docker-image.spdx -i $DOCKER_IMAGE
156+
fi
157+
158+
cd /tmp && tar -zcf sbom.tar.gz *.spdx
159+
124160
- name: Draft release
125161
uses: softprops/action-gh-release@v1
126162
with:
127163
tag_name: ${{ github.event.inputs.tag }}
128164
draft: true
129165
files: |
130166
dist/kubectl-argo-rollouts-linux-amd64
167+
dist/kubectl-argo-rollouts-linux-arm64
131168
dist/kubectl-argo-rollouts-darwin-amd64
132169
dist/kubectl-argo-rollouts-windows-amd64
170+
manifests/dashboard-install.yaml
133171
manifests/install.yaml
134172
manifests/namespace-install.yaml
135173
manifests/notifications-install.yaml
136174
docs/features/kustomize/rollout_cr_schema.json
175+
/tmp/sbom.tar.gz
137176
env:
138177
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.readthedocs.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: 2
2+
formats: all
3+
mkdocs:
4+
fail_on_warning: false
5+
python:
6+
install:
7+
- requirements: docs/requirements.txt

Dockerfile

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Initial stage which pulls prepares build dependencies and CLI tooling we need for our final image
44
# Also used as the image in CI jobs so needs all dependencies
55
####################################################################################################
6-
FROM golang:1.16.3 as builder
6+
FROM golang:1.17.6 as builder
77

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

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

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

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

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

66-
ARG MAKE_TARGET="controller plugin-linux plugin-darwin plugin-windows"
64+
ARG MAKE_TARGET="controller plugin plugin-linux plugin-darwin plugin-windows"
6765
RUN make ${MAKE_TARGET}
6866

6967
####################################################################################################
7068
# Kubectl plugin image
7169
####################################################################################################
7270
FROM docker.io/library/ubuntu:20.10 as kubectl-argo-rollouts
7371

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

7674
USER 999
7775

Dockerfile.dev

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
####################################################################################################
22
# argo-rollouts-dev
33
####################################################################################################
4-
FROM golang:1.16.3 as builder
4+
FROM golang:1.17.6 as builder
55

66
RUN apt-get update && apt-get install -y \
77
ca-certificates && \

0 commit comments

Comments
 (0)