Skip to content
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

Update coredns image tags automatically #21

Merged
merged 4 commits into from
Dec 9, 2024
Merged

Conversation

addyess
Copy link
Contributor

@addyess addyess commented Dec 2, 2024

Overview

The nightly tests looking for coredns tags upstream should create new rockcraft files based on a template in this repo

Details

  • it used to be we kept a branch for every upstream tag in the coredns/coredns repo to create its rock. For some reason we've flattened this out to instead build all the rockcraft images anytime a new version is available?
  • update the automatic PR to find new tags, and create new rockcraft files for each

@addyess addyess requested a review from a team as a code owner December 2, 2024 20:26
@addyess addyess force-pushed the KU-2129/auto-update-coredns branch 4 times, most recently from 22dd765 to 3f8ad8c Compare December 2, 2024 20:35
@addyess addyess force-pushed the KU-2129/auto-update-coredns branch from 3f8ad8c to a2cc206 Compare December 2, 2024 20:39
@addyess
Copy link
Contributor Author

addyess commented Dec 2, 2024

See that this PR created #24

@addyess
Copy link
Contributor Author

addyess commented Dec 2, 2024

We won't need #18 anymore

@addyess addyess changed the title Update coredns images automatically Update coredns image tags automatically Dec 2, 2024
@addyess addyess force-pushed the KU-2129/auto-update-coredns branch from 6fb5e0b to d4151a3 Compare December 2, 2024 20:55
@addyess addyess force-pushed the KU-2129/auto-update-coredns branch from 9b5156b to fe35ca7 Compare December 2, 2024 22:56
@addyess addyess force-pushed the KU-2129/auto-update-coredns branch from fe35ca7 to 4b9709e Compare December 2, 2024 23:02
Copy link

@HomayoonAlimohammadi HomayoonAlimohammadi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work, thanks a lot @addyess! Left some minor comments and suggestions. Feel free to ignore them if they seem irrelevant.

build/craft_release.sh Outdated Show resolved Hide resolved
build/craft_release.sh Show resolved Hide resolved
build/craft_release.sh Show resolved Hide resolved
@addyess addyess merged commit eda0312 into main Dec 9, 2024
10 checks passed
@addyess addyess deleted the KU-2129/auto-update-coredns branch December 9, 2024 16:36
# Target to remove the temporary directory
clean:
@rm -rf $(COREDNS_GIT_DIR)
@echo "Temporary directory removed: $(COREDNS_GIT_DIR)"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

newline at eof

function usage() {
if [[ -z ${COREDNS_GIT_DIR+x} ]]; then
echo "COREDNS_GIT_DIR is not set" > /dev/stderr
echo " Clone with 'git clone --bare --filter=blob:none --no-checkout https://github.com/coredns/coredns.git /tmp/coredns.git'" > /dev/stderr
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
echo " Clone with 'git clone --bare --filter=blob:none --no-checkout https://github.com/coredns/coredns.git /tmp/coredns.git'" > /dev/stderr
echo " Clone with 'git clone --bare --filter=blob:none --no-checkout https://github.com/coredns/coredns.git /tmp/coredns.git'" >&2

RO_REPO_DIR=$(dirname ${RO_SCRIPT_DIR})
RO_VERSIONS=${RO_SCRIPT_DIR}/../versions.txt

function usage() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really "usage", more of a environment check

function check_dependencies(){
for cmd in yq jq git envsubst; do
if ! command -v $cmd &> /dev/null; then
echo "$cmd could not be found" > /dev/stderr
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
echo "$cmd could not be found" > /dev/stderr
echo "$cmd could not be found" >&2

create_rockcrafts
}

main
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EOF


rm -rf ${RO_VERSIONS}
for rockcraft in $(find ${RO_REPO_DIR} -name 'rockcraft.yaml'); do
echo $(yq '.version' $rockcraft) >> ${RO_VERSIONS}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

echo not needed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so? it seems this is required. Without it

yq '.version' $rockcraft >> ${RO_VERSIONS}

i get an error:

Error: write /dev/stdout: bad file descriptor

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think it's due to snap confinement when yq is installed via snap

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants