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

Remove TRAVIS env vars entirely #241

Merged
merged 1 commit into from
Dec 20, 2021
Merged

Conversation

Fryguy
Copy link
Member

@Fryguy Fryguy commented Dec 20, 2021

No description provided.

@@ -3,7 +3,11 @@
REGISTRY=${REGISTRY:-"docker.io"}
ORGANIZATION=${ORGANIZATION:-"manageiq"}
DEFAULT_TAG="latest"
[[ $TRAVIS_BRANCH != "master" ]] && DEFAULT_TAG="$DEFAULT_TAG-$TRAVIS_BRANCH"
if [[ "$GITHUB_EVENT_NAME" == "pull_request" ]]; then
DEFAULT_TAG="$DEFAULT_TAG-pr"
Copy link
Member Author

@Fryguy Fryguy Dec 20, 2021

Choose a reason for hiding this comment

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

@bdunne Thoughts here? SInce the actual name doesn't matter, do we even care about this? I was thinking we could just leave it as "latest". That would meant this whole section can just be:

[[ "$GITHUB_EVENT_NAME" != "pull_request" -a $GITHUB_REF != "refs/heads/master" ]] && DEFAULT_TAG="$DEFAULT_TAG-$GITHUB_REF_NAME"

Copy link
Member Author

@Fryguy Fryguy Dec 20, 2021

Choose a reason for hiding this comment

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

I noticed previously, that if run locally, this would generate latest- as the name, because TRAVIS_BRANCH was blank (actually it would probably blow up if run locally)...thinking I might fix that local use case as well

Copy link
Member Author

Choose a reason for hiding this comment

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

I updated with this and fixed the latest- thing. Also fixed it so that branches with / will work (even though that doesn't effect master, it could affect pushes to forks, where the fork has the push event.

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

I'm hesitant to add GITHUB_EVENT_NAME, maybe we can get the ref from git itself?

Copy link
Member Author

@Fryguy Fryguy Dec 20, 2021

Choose a reason for hiding this comment

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

I can try, but we need to know if it's a PR or a push build...not sure how you get that out of git. Basically, we need push builds that are not master (i.e. morphy, lasker, etc.)

@@ -12,7 +16,7 @@ set -e

docker build . -t $IMAGE_NAME

[[ $TRAVIS_PULL_REQUEST != "false" ]] && exit 0
[[ -z "$REGISTRY_USERNAME" ]] && exit 0
Copy link
Member Author

Choose a reason for hiding this comment

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

I thought it simpler to just check for the presence of the REGISTRY_USERNAME, as opposed to checking for anything CI specific

@Fryguy Fryguy force-pushed the remove_travis branch 2 times, most recently from 0a63798 to 6cf4297 Compare December 20, 2021 20:29
@@ -3,7 +3,8 @@
REGISTRY=${REGISTRY:-"docker.io"}
ORGANIZATION=${ORGANIZATION:-"manageiq"}
DEFAULT_TAG="latest"
[[ $TRAVIS_BRANCH != "master" ]] && DEFAULT_TAG="$DEFAULT_TAG-$TRAVIS_BRANCH"
[ "$GITHUB_EVENT_NAME" == "push" -a "$GITHUB_REF" != "refs/heads/master" ] && \
DEFAULT_TAG="$DEFAULT_TAG-${GITHUB_REF_NAME/\//-}"
Copy link
Member Author

@Fryguy Fryguy Dec 20, 2021

Choose a reason for hiding this comment

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

$ GITHUB_EVENT_NAME=push GITHUB_REF_NAME="master" bin/build_container_image
docker.io/manageiq/rpm_build:latest

$ GITHUB_EVENT_NAME=push GITHUB_REF_NAME="foobar" bin/build_container_image
docker.io/manageiq/rpm_build:latest-foobar

$ GITHUB_EVENT_NAME=push GITHUB_REF_NAME="feature/foobar" bin/build_container_image
docker.io/manageiq/rpm_build:latest-feature-foobar

$ bin/build_container_image
docker.io/manageiq/rpm_build:latest

Copy link
Member

Choose a reason for hiding this comment

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

What do you think of switching to latest-masterso that we can get rid of this conditional logic?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's super common to have latest be the latest, so I'm hesitant to not use latest now that we've already started.

@Fryguy
Copy link
Member Author

Fryguy commented Dec 20, 2021

@bdunne This is ready to go.

@miq-bot
Copy link
Member

miq-bot commented Dec 20, 2021

Checked commit Fryguy@b6760fb with ruby 2.6.3, rubocop 1.13.0, haml-lint 0.35.0, and yamllint
1 file checked, 1 offense detected

**

  • 💣 💥 🔥 🚒 - Linter/Yaml - missing config files

@bdunne bdunne merged commit 59b85ac into ManageIQ:master Dec 20, 2021
@Fryguy Fryguy deleted the remove_travis branch December 21, 2021 14:12
@Fryguy
Copy link
Member Author

Fryguy commented Jan 25, 2022

Backported to morphy in commit 26125d5.

commit 26125d5d7fbab867f1154afc282e85d07c995c7c
Author: Brandon Dunne <brandondunne@hotmail.com>
Date:   Mon Dec 20 18:17:54 2021 -0500

    Merge pull request #241 from Fryguy/remove_travis
    
    Remove TRAVIS env vars entirely
    
    (cherry picked from commit 59b85ac839bc134e5ba32cff9984b7c22d93db5b)

Fryguy pushed a commit that referenced this pull request Jan 25, 2022
Remove TRAVIS env vars entirely

(cherry picked from commit 59b85ac)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants