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

🐙 octavia-cli: create octavia env file during install #11005

Merged
merged 1 commit into from
Mar 10, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion octavia-cli/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# It creates an octavia alias in your profile bound to a docker run command

VERSION=dev
OCTAVIA_ENV_FILE=${HOME}/.octavia
Copy link
Member

Choose a reason for hiding this comment

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

This makes more complex to complex to work using Github Actions (maybe?)

Copy link
Contributor Author

@alafanechere alafanechere Mar 10, 2022

Choose a reason for hiding this comment

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

IMO GitHub actions users should not use the docker run command directly and not use the alias.


detect_profile() {
if [ "${SHELL#*bash}" != "$SHELL" ]; then
Expand Down Expand Up @@ -42,8 +43,19 @@ pull_image() {
docker pull airbyte/octavia-cli:${VERSION} > /dev/null 2>&1
}

add_octavia_comment_to_profile() {
printf "\n# OCTAVIA CLI\n" >> ${DETECTED_PROFILE}
}

create_octavia_env_file() {
echo "OCTAVIA_ENV_FILE=${OCTAVIA_ENV_FILE}" >> ${DETECTED_PROFILE}
touch ${OCTAVIA_ENV_FILE}
echo "🐙 - 💾 The octavia env file was created at ${OCTAVIA_ENV_FILE}"
}


add_alias() {
echo 'alias octavia="pwd | xargs -I {} docker run --rm -v {}:/home/octavia-project --network host -e AIRBYTE_URL="\${AIRBYTE_URL}" -e AIRBYTE_WORKSPACE_ID="\${AIRBYTE_WORKSPACE_ID}" airbyte/octavia-cli:'${VERSION}'"' >> ~/.zshrc
echo 'alias octavia="pwd | xargs -I {} docker run --rm -v {}:/home/octavia-project --network host --env-file \${OCTAVIA_ENV_FILE} airbyte/octavia-cli:'${VERSION}'"' >> ${DETECTED_PROFILE}
echo "🐙 - 🎉 octavia alias was added to ${DETECTED_PROFILE} , please open a new terminal window or run source ${DETECTED_PROFILE}"
}

Expand All @@ -62,6 +74,8 @@ update_or_install() {
install
fi
else
add_octavia_comment_to_profile
create_octavia_env_file
install
fi
}
Expand Down