forked from argoproj/argo-cd
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
231fc56
commit ebac94e
Showing
53 changed files
with
6,676 additions
and
1,240 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: PR check | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- "release-*" | ||
|
||
jobs: | ||
test-default-branch: | ||
name: base branch is a default branch | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: fail if base branch is not default branch | ||
if: ${{ github.event.pull_request.base.ref != github.event.repository.default_branch }} | ||
uses: actions/github-script@v3 | ||
with: | ||
script: | | ||
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 }}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,18 +3,13 @@ name: Image | |
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
types: [ labeled, unlabeled, opened, synchronize, reopened ] | ||
- "release-*" # Codefresh change instead of `master` | ||
|
||
env: | ||
GOLANG_VERSION: '1.17' | ||
GOLANG_VERSION: "1.17" | ||
|
||
jobs: | ||
publish: | ||
if: github.repository == 'argoproj/argo-cd' | ||
runs-on: ubuntu-latest | ||
env: | ||
GOPATH: /home/runner/work/argo-cd/argo-cd | ||
|
@@ -31,42 +26,40 @@ jobs: | |
working-directory: ./src/github.com/argoproj/argo-cd | ||
id: image | ||
|
||
# login | ||
# build | ||
- run: | | ||
docker images -a --format "{{.ID}}" | xargs -I {} docker rmi {} | ||
make image DEV_IMAGE=true DOCKER_PUSH=false IMAGE_NAMESPACE=ghcr.io/codefresh-io IMAGE_TAG=${{ steps.image.outputs.tag }} | ||
working-directory: ./src/github.com/argoproj/argo-cd | ||
# publish | ||
- run: | | ||
docker login ghcr.io --username $USERNAME --password $PASSWORD | ||
docker login quay.io --username "${DOCKER_USERNAME}" --password "${DOCKER_TOKEN}" | ||
if: github.event_name == 'push' | ||
docker push ghcr.io/codefresh-io/argocd:${{ steps.image.outputs.tag }} | ||
env: | ||
USERNAME: ${{ secrets.USERNAME }} | ||
USERNAME: ${{ github.repository_owner }} | ||
PASSWORD: ${{ secrets.TOKEN }} | ||
DOCKER_USERNAME: ${{ secrets.RELEASE_QUAY_USERNAME }} | ||
DOCKER_TOKEN: ${{ secrets.RELEASE_QUAY_TOKEN }} | ||
# build | ||
- uses: docker/setup-qemu-action@v1 | ||
- uses: docker/setup-buildx-action@v1 | ||
- run: | | ||
IMAGE_PLATFORMS=linux/amd64 | ||
if [[ "${{ github.event_name }}" == "push" || "${{ contains(github.event.pull_request.labels.*.name, 'test-arm-image') }}" == "true" ]] | ||
then | ||
IMAGE_PLATFORMS=linux/amd64,linux/arm64 | ||
fi | ||
echo "Building image for platforms: $IMAGE_PLATFORMS" | ||
docker buildx build --platform $IMAGE_PLATFORMS --push="${{ github.event_name == 'push' }}" \ | ||
-t ghcr.io/argoproj/argocd:${{ steps.image.outputs.tag }} \ | ||
-t quay.io/argoproj/argocd:latest . | ||
working-directory: ./src/github.com/argoproj/argo-cd | ||
# Codefresh step | ||
- name: Push docker image to quay repository | ||
env: | ||
QUAY_USERNAME: ${{ secrets.RELEASE_QUAY_USERNAME }} | ||
QUAY_TOKEN: ${{ secrets.RELEASE_QUAY_TOKEN }} | ||
IMAGE_NAMESPACE: quay.io/codefresh | ||
run: | | ||
set -ue | ||
docker login quay.io --username "${QUAY_USERNAME}" --password "${QUAY_TOKEN}" | ||
docker tag ghcr.io/codefresh-io/argocd:${{ steps.image.outputs.tag }} ${IMAGE_NAMESPACE}/argocd:latest | ||
docker push ${IMAGE_NAMESPACE}/argocd:latest | ||
# deploy | ||
- run: git clone "https://[email protected]/argoproj/argoproj-deployments" | ||
if: github.event_name == 'push' | ||
- run: git clone "https://[email protected]/codefresh-io/argoproj-deployments" | ||
env: | ||
TOKEN: ${{ secrets.TOKEN }} | ||
- run: | | ||
docker run -u $(id -u):$(id -g) -v $(pwd):/src -w /src --rm -t ghcr.io/argoproj/argocd:${{ steps.image.outputs.tag }} kustomize edit set image quay.io/argoproj/argocd=ghcr.io/argoproj/argocd:${{ steps.image.outputs.tag }} | ||
git config --global user.email '[email protected]' | ||
git config --global user.name 'CI' | ||
docker run -v $(pwd):/src -w /src --rm -t lyft/kustomizer:v3.3.0 kustomize edit set image quay.io/argoproj/argocd=ghcr.io/codefresh-io/argocd:${{ steps.image.outputs.tag }} | ||
git config --global user.email '[email protected]' | ||
git config --global user.name 'CI-Codefresh' | ||
git diff --exit-code && echo 'Already deployed' || (git commit -am 'Upgrade argocd to ${{ steps.image.outputs.tag }}' && git push) | ||
if: github.event_name == 'push' | ||
working-directory: argoproj-deployments/argocd | ||
|
Oops, something went wrong.