-
Notifications
You must be signed in to change notification settings - Fork 6
update argocd updater/test to use new flags #103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,31 @@ | ||
| RELEASE_TAG ?= 0.1.0 | ||
| .PHONY: updater/test check-prereq-variables | ||
| RELEASE_TAG ?= 1.0.0 | ||
| dirs ?= rendered/ | ||
| env ?= | ||
| app ?= "" | ||
|
|
||
| dev_dir = rendered/environments/aws.dev | ||
| qa_dir = rendered/environments/aws.qa | ||
| logs_dir = rendered/environments/aws.logs | ||
| prod_dir = rendered/environments/aws.prod | ||
|
|
||
| .PHONY: updater/test check-prereq-variables get-dirs | ||
|
|
||
| ## Test argocd-image-updater annotations | ||
| updater/test: check-prereq-variables | ||
| updater/test: check-prereq-variables get-dirs | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this module should sit under I also think So you would end up with |
||
| @echo $(dirs) | ||
| @mkdir -p bin | ||
| @wget -O bin/argocd-image-updater-tester --header "PRIVATE-TOKEN: $(word 2,$(subst :, ,$(GITLAB_SECRET)))" https://gitlab.com/api/v4/projects/37621397/packages/generic/argocd-image-updater-tester/${RELEASE_TAG}/argocd-image-updater-tester | ||
| @chmod +x bin/argocd-image-updater-tester | ||
| @bin/argocd-image-updater-tester | ||
| @bin/argocd-image-updater-tester --dirs=${dir} --apps=${app} | ||
| @rm bin/argocd-image-updater-tester | ||
| @rm bin/argocd-image-updater | ||
| @rm -d bin | ||
|
|
||
| check-prereq-variables: | ||
| @[ "${GITLAB_SECRET}" ] || ( echo -e "ERROR: GITLAB_SECRET environment variable is not defined. Set the variable before running.\nexport GITLAB_SECRET=\"<gitlab_username>:<gitlab_token>\"\nhttps://argocd-image-updater.readthedocs.io/en/stable/basics/authentication/#using-an-environment-variable"; exit 1 ) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a little painful (creating/exporting this var). Would it not be better to bundle this as a docker image instead - that would typically mean we don't have to re-auth each time since. |
||
|
|
||
| get-dirs: | ||
| ifdef env | ||
| $(eval dirs := $()) | ||
| $(foreach e,$(env),$(eval dirs+=$($(e)_dir))) | ||
| endif | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be good to filter on
appandenvthe same waymake k8s/tanka/generatedoes it (usingtk env list --names). In fact, we could probably pull that out into a "list with filters" common script.Using that, you wouldn't need to filter by app in
argocd-image-updater-tester; you could just pass in a list of directories: