Skip to content

Commit 48773e8

Browse files
ATGardneroleksandr-codefresh
authored andcommitted
codefresh changes
1 parent 38985bd commit 48773e8

277 files changed

Lines changed: 24414 additions & 2091 deletions

File tree

Some content is hidden

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

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ manifests/
1717
hack/
1818
docs/
1919
examples/
20+
.dockerignore
21+
.git/
2022
.github/
2123
!test/container
2224
!test/e2e/testdata

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ contact_links:
55
url: https://argo-cd.readthedocs.io/
66
about: Much help can be found in the docs
77
- name: Ask a question
8-
url: https://github.com/argoproj/argo-cd/discussions/new
8+
url: https://github.com/codefresh-io/argo-cd/discussions/new
99
about: Ask a question or start a discussion about Argo CD
1010
- name: Chat on Slack
1111
url: https://argoproj.github.io/community/join-slack

.github/workflows/cf-release.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Init CF ArgoCD Release
2+
on:
3+
workflow_dispatch:
4+
5+
permissions:
6+
contents: write
7+
actions: write
8+
9+
jobs:
10+
prepare-release:
11+
permissions:
12+
contents: write
13+
actions: write # for peter-evans/create-pull-request to create branch
14+
name: Automatically generate version and manifests on ${{ inputs.TARGET_BRANCH }}
15+
runs-on: ubuntu-22.04
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@8410ad0602e1e429cee44a835ae9f77f654a6694 # v4.0.0
19+
with:
20+
fetch-depth: 0
21+
# use personal token due to https://stackoverflow.com/questions/72110432/github-workflow-is-not-triggered-after-pushing-tags
22+
token: ${{ secrets.RELEASE_GITHUB_TOKEN }}
23+
ref: ${{ inputs.TARGET_BRANCH }}
24+
25+
- name: Check if TARGET_VERSION is well formed.
26+
run: |
27+
set -xue
28+
# Target version must not contain 'v' prefix
29+
if echo "${{ inputs.TARGET_VERSION }}" | grep -e '^v'; then
30+
echo "::error::Target version '${{ inputs.TARGET_VERSION }}' should not begin with a 'v' prefix, refusing to continue." >&2
31+
exit 1
32+
fi
33+
34+
- name: Create release
35+
run: |
36+
git config --global user.name "CI-Codefresh"
37+
git config --global user.email "integration@codefresh.io"
38+
make cf-release
39+
40+

.github/workflows/ci-build.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ name: Integration tests
22
on:
33
push:
44
branches:
5-
- 'master'
5+
# - 'master'
66
- 'release-*'
77
- '!release-1.4'
88
- '!release-1.5'
99
pull_request:
1010
branches:
11-
- 'master'
12-
- 'release-*'
11+
# - 'master'
12+
- 'release-*' # Codefresh change instead of `master`
1313

1414
env:
1515
# Golang version to use across CI steps
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: PR check
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- "release-*"
7+
8+
jobs:
9+
test-default-branch:
10+
name: base branch is a default branch
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: fail if base branch is not default branch
14+
if: ${{ github.event.pull_request.base.ref != github.event.repository.default_branch }}
15+
uses: actions/github-script@ffc2c79a5b2490bd33e0a41c1de74b877714d736 # v3.2.0
16+
with:
17+
script: |
18+
core.setFailed("Base branch of the PR - ${{ github.event.pull_request.base.ref }} is not a default branch. Please reopen your PR to ${{ github.event.repository.default_branch }}")

.github/workflows/image.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ name: Image
33
on:
44
push:
55
branches:
6-
- master
7-
pull_request:
8-
branches:
9-
- master
10-
types: [ labeled, unlabeled, opened, synchronize, reopened ]
6+
# - master
7+
- "release-*" # Codefresh change instead of `master`
8+
# pull_request:
9+
# branches:
10+
# - master
11+
# types: [ labeled, unlabeled, opened, synchronize, reopened ]
1112

1213
concurrency:
1314
group: ${{ github.workflow }}-${{ github.ref }}
@@ -19,7 +20,7 @@ jobs:
1920
set-vars:
2021
permissions:
2122
contents: read
22-
if: github.repository == 'argoproj/argo-cd'
23+
if: github.repository == 'codefresh-io/argo-cd'
2324
runs-on: ubuntu-22.04
2425
outputs:
2526
image-tag: ${{ steps.image.outputs.tag}}
@@ -116,4 +117,3 @@ jobs:
116117
git config --global user.name 'CI'
117118
git diff --exit-code && echo 'Already deployed' || (git commit -am 'Upgrade argocd to ${{ needs.set-vars.outputs.image-tag }}' && git push)
118119
working-directory: argoproj-deployments/argocd
119-

.github/workflows/release.yaml

Lines changed: 58 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
name: Publish ArgoCD Release
1+
name: Create ArgoCD release
22
on:
33
push:
44
tags:
5-
- 'v*'
6-
- '!v2.4*'
7-
- '!v2.5*'
8-
- '!v2.6*'
9-
10-
permissions: {}
5+
- "release-v**"
6+
- "!release-v1.5*"
7+
- "!release-v1.4*"
8+
- "!release-v1.3*"
9+
- "!release-v1.2*"
10+
- "!release-v1.1*"
11+
- "!release-v1.0*"
12+
- "!release-v0*"
1113

1214
env:
1315
# renovate: datasource=golang-version packageName=golang
@@ -40,7 +42,7 @@ jobs:
4042
packages: write # for uploading attestations. (https://github.com/slsa-framework/slsa-github-generator/blob/main/internal/builders/container/README.md#known-issues)
4143
# Must be refernced by a tag. https://github.com/slsa-framework/slsa-github-generator/blob/main/internal/builders/container/README.md#referencing-the-slsa-generator
4244
if: github.repository == 'argoproj/argo-cd'
43-
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_container_slsa3.yml@v2.0.0
45+
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_container_slsa3.yml@v1.9.0
4446
with:
4547
image: quay.io/argoproj/argocd
4648
digest: ${{ needs.argocd-image.outputs.image-digest }}
@@ -56,8 +58,14 @@ jobs:
5658
contents: write # used for uploading assets
5759
if: github.repository == 'argoproj/argo-cd'
5860
runs-on: ubuntu-22.04
61+
env:
62+
ARTIFACT_NAME: release-notes
5963
outputs:
60-
hashes: ${{ steps.hash.outputs.hashes }}
64+
TARGET_VERSION: ${{ steps.setup-vars.outputs.TARGET_VERSION }}
65+
TARGET_BRANCH: ${{ steps.setup-vars.outputs.TARGET_BRANCH }}
66+
PRE_RELEASE: ${{ steps.setup-vars.outputs.PRE_RELEASE }}
67+
RELEASE_TAG: ${{ steps.setup-vars.outputs.RELEASE_TAG }}
68+
RELEASE_NOTES: ${{ steps.release-notes.outputs.RELEASE_NOTES }}
6169

6270
steps:
6371
- name: Checkout code
@@ -85,14 +93,6 @@ jobs:
8593
echo "KUBECTL_VERSION=$(go list -m k8s.io/client-go | head -n 1 | rev | cut -d' ' -f1 | rev)" >> $GITHUB_ENV
8694
echo "GIT_TREE_STATE=$(if [ -z "`git status --porcelain`" ]; then echo "clean" ; else echo "dirty"; fi)" >> $GITHUB_ENV
8795
88-
- name: Free Disk Space (Ubuntu)
89-
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be
90-
with:
91-
large-packages: false
92-
docker-images: false
93-
swap-storage: false
94-
tool-cache: false
95-
9696
- name: Run GoReleaser
9797
uses: goreleaser/goreleaser-action@9ed2f89a662bf1735a48bc8557fd212fa902bebf # v6.1.0
9898
id: run-goreleaser
@@ -126,7 +126,7 @@ jobs:
126126
contents: write # Needed for release uploads
127127
if: github.repository == 'argoproj/argo-cd'
128128
# Must be refernced by a tag. https://github.com/slsa-framework/slsa-github-generator/blob/main/internal/builders/container/README.md#referencing-the-slsa-generator
129-
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v2.0.0
129+
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v1.9.0
130130
with:
131131
base64-subjects: "${{ needs.goreleaser.outputs.hashes }}"
132132
provenance-name: "argocd-cli.intoto.jsonl"
@@ -135,21 +135,43 @@ jobs:
135135
generate-sbom:
136136
name: Create SBOM and generate hash
137137
needs:
138-
- argocd-image
139-
- goreleaser
140-
permissions:
141-
contents: write # Needed for release uploads
142-
outputs:
143-
hashes: ${{ steps.sbom-hash.outputs.hashes}}
144-
if: github.repository == 'argoproj/argo-cd'
145-
runs-on: ubuntu-22.04
138+
- prepare-release
139+
- binaries
140+
- container-image
146141
steps:
147142
- name: Checkout code
148143
uses: actions/checkout@8410ad0602e1e429cee44a835ae9f77f654a6694 # v4.0.0
149144
with:
150145
fetch-depth: 0
151146
token: ${{ secrets.GITHUB_TOKEN }}
152147

148+
- name: Setup Git author information
149+
run: |
150+
set -ue
151+
git config --global user.email "${GIT_EMAIL}"
152+
git config --global user.name "${GIT_USERNAME}"
153+
- name: Checkout corresponding release branch
154+
run: |
155+
set -ue
156+
echo "Switching to release branch '${TARGET_BRANCH}'"
157+
if ! git checkout ${TARGET_BRANCH}; then
158+
echo "::error::Checking out release branch '${TARGET_BRANCH}' for target version '${TARGET_VERSION}' (tagged '${RELEASE_TAG}') failed. Does it exist in repo?"
159+
exit 1
160+
fi
161+
162+
- name: Create the release tag
163+
run: |
164+
set -ue
165+
echo "Creating release ${RELEASE_TAG}"
166+
git tag ${RELEASE_TAG}
167+
168+
- name: Push changes to release branch
169+
run: |
170+
set -ue
171+
# Codefresh change
172+
# git push origin ${TARGET_BRANCH}
173+
git push origin ${RELEASE_TAG}
174+
153175
- name: Setup Golang
154176
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
155177
with:
@@ -166,7 +188,7 @@ jobs:
166188
# managers (gomod, yarn, npm).
167189
PROJECT_FOLDERS: ".,./ui"
168190
# full qualified name of the docker image to be inspected
169-
DOCKER_IMAGE: quay.io/argoproj/argocd:${{ github.ref_name }}
191+
DOCKER_IMAGE: ${{env.IMAGE_NAMESPACE}}/argocd:v${{env.TARGET_VERSION}}
170192
run: |
171193
yarn install --cwd ./ui
172194
go install github.com/spdx/spdx-sbom-generator/cmd/generator@$SPDX_GEN_VERSION
@@ -199,7 +221,10 @@ jobs:
199221
env:
200222
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
201223
with:
224+
token: ${{ secrets.GITHUB_TOKEN }}
225+
name: ${{ env.RELEASE_TAG }}
202226
files: |
227+
argocd-*
203228
/tmp/sbom.tar.gz
204229
205230
sbom-provenance:
@@ -228,12 +253,13 @@ jobs:
228253
runs-on: ubuntu-22.04
229254
steps:
230255
- name: Checkout code
231-
uses: actions/checkout@8410ad0602e1e429cee44a835ae9f77f654a6694 # v4.0.0
256+
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
232257
with:
233-
fetch-depth: 0
234-
token: ${{ secrets.GITHUB_TOKEN }}
258+
token: ${{env.HOMEBREW_TOKEN}}
259+
formula: argocd
260+
if: ${{ env.HOMEBREW_TOKEN != '' && env.UPDATE_HOMEBREW == 'true' && env.PRE_RELEASE != 'true' }}
235261

236-
- name: Setup Git author information
262+
- name: Delete original request tag from repository
237263
run: |
238264
set -ue
239265
git config --global user.email 'ci@argoproj.com'
@@ -289,7 +315,7 @@ jobs:
289315
# Replace the 'project-release: vX.X.X-rcX' line in SECURITY-INSIGHTS.yml
290316
sed -i "s/project-release: v.*$/project-release: v${{ env.NEW_VERSION }}/" SECURITY-INSIGHTS.yml
291317
# Update the 'commit-hash: XXXXXXX' line in SECURITY-INSIGHTS.yml
292-
sed -i "s/commit-hash: .*/commit-hash: ${{ env.COMMIT_HASH }}/" SECURITY-INSIGHTS.yml
318+
sed -i "s/commit-hash: .*/commit-hash: ${{ env.NEW_VERSION }}/" SECURITY-INSIGHTS.yml
293319
if: ${{ env.UPDATE_VERSION == 'true' }}
294320

295321
- name: Create PR to update VERSION on master branch

.github/workflows/update-snyk.yaml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
name: Snyk report update
22
on:
3-
workflow_dispatch: {}
43
schedule:
54
- cron: '0 0 * * 0' # midnight every Sunday
65

@@ -10,8 +9,7 @@ permissions:
109
jobs:
1110
snyk-report:
1211
permissions:
13-
contents: write
14-
pull-requests: write
12+
contents: write # To push snyk reports
1513
if: github.repository == 'argoproj/argo-cd'
1614
name: Update Snyk report in the docs directory
1715
runs-on: ubuntu-22.04
@@ -22,12 +20,9 @@ jobs:
2220
token: ${{ secrets.GITHUB_TOKEN }}
2321
- name: Build reports
2422
env:
25-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2623
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
2724
run: |
2825
make snyk-report
29-
pr_branch="snyk-update-$(echo $RANDOM | md5sum | head -c 20)"
30-
git checkout -b "$pr_branch"
3126
git config --global user.email 'ci@argoproj.com'
3227
git config --global user.name 'CI'
3328
git add docs/snyk

.mockery.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ mockname: "{{.InterfaceName}}"
66
with-expecter: false
77
# individual interface config
88
packages:
9+
github.com/argoproj/argo-cd/v2/acr_controller/application:
10+
interfaces:
11+
ApplicationClient:
912
github.com/argoproj/argo-cd/v2/applicationset/generators:
1013
interfaces:
1114
Generator:
@@ -36,6 +39,9 @@ packages:
3639
github.com/argoproj/argo-cd/v2/controller/cache:
3740
interfaces:
3841
LiveStateCache:
42+
github.com/argoproj/argo-cd/v2/event_reporter/application:
43+
interfaces:
44+
ApplicationClient:
3945
github.com/argoproj/argo-cd/v2/reposerver/apiclient:
4046
interfaces:
4147
RepoServerServiceClient:

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@ COPY --from=argocd-build /go/src/github.com/argoproj/argo-cd/dist/argocd* /usr/l
135135
USER root
136136
RUN ln -s /usr/local/bin/argocd /usr/local/bin/argocd-server && \
137137
ln -s /usr/local/bin/argocd /usr/local/bin/argocd-repo-server && \
138+
ln -s /usr/local/bin/argocd /usr/local/bin/event-reporter-server && \
139+
ln -s /usr/local/bin/argocd /usr/local/bin/argocd-application-change-revision-controller && \
138140
ln -s /usr/local/bin/argocd /usr/local/bin/argocd-cmp-server && \
139141
ln -s /usr/local/bin/argocd /usr/local/bin/argocd-application-controller && \
140142
ln -s /usr/local/bin/argocd /usr/local/bin/argocd-dex && \

0 commit comments

Comments
 (0)