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

Try to install on many OS using Travis and docker. #61

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 3 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
43 changes: 40 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,42 @@
dist: trusty
sudo: required

matrix:
include:
- os: linux
- env: OS_TYPE=fedora
- env: INSTALL_REQUIREMENTS="dnf repolist; dnf install -y perl shellcheck devscripts sudo wget"

- os: linux
- env: OS_TYPE=opensuse
- env: INSTALL_REQUIREMENTS="zypper refresh; zypper in -y perl shellcheck devscripts sugo wget"

- os: linux
- env: OS_TYPE=dauchida/freebsd
- env: INSTALL_REQUIREMENTS="pkg install -y perl shellcheck devscripts sudo wget"

- os: linux
- env: OS_TYPE=debian:11
- env: INSTALL_REQUIREMENTS="sudo apt-get update -qq; sudo apt-get upgrade -y; sudo apt-get install -y -qq perl shellcheck devscripts sudo wget"

- os: linux
- env: OS_TYPE=ubuntu:22.04
- env: INSTALL_REQUIREMENTS="sudo apt-get update -qq; sudo apt-get upgrade -y; sudo apt-get install -y -qq perl shellcheck devscripts sudo wget"

- os: osx
- env: OS_TYPE=osx
- env: INSTALL_REQUIREMENTS="brew update; brew install perl shellcheck devscripts sudo wget"

before_install:
- sudo apt-get update -qq
- sudo apt-get install -qq perl shellcheck devscripts
script: prove
- [[ $TRAVIS_OS_NAME == "linux" ]] && docker pull ${OS_TYPE}

install:
- [[ $TRAVIS_OS_NAME == "osx" ]] && docker run -d $OS /bin/sh -c "$INSTALL_REQUIREMENTS"

Choose a reason for hiding this comment

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

Which value will be set for $OS variable?
If it is a linux distribution name (such as ubuntu:22.04), we don't need to run onosx env, which cost more credits than usual.

Copy link
Collaborator

Choose a reason for hiding this comment

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

And, there is absolutely 100% no way I'm ever going to support MacOS. I spent weeks messing about with it several years ago, and it's not worth it (and the days of MacOS on a server are over, if they ever existed...they didn't really, but Apple did used to make servers). Besides that, the best "package manager" on MacOS is allegedly Homebrew, which is a disaster, especially for servers.

- [[ $TRAVIS_OS_NAME == "linux" ]] && docker run -d $OS /bin/sh -c "$INSTALL_REQUIREMENTS"
- docker run -d $OS /bin/sh -c "sudo wget https://github.com/EspaceNetworks/virtualmin-install/raw/master/virtualmin-install.sh"

Choose a reason for hiding this comment

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

Should not hard code to your repository.
Are we able to use checked out file in source directory?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point. Have to look up the runtime variable in travis for "the URL to a file in the current checked out source we're running this test on" so that it'd work right from everywhere.

- docker run -d $OS /bin/sh -c "sudo chmod +x virtualmin-install.sh"

script:
# Test for osx and run different build or prep commands:
- [[ $TRAVIS_OS_NAME == "osx" ]] && docker run -d $OS /bin/sh -c "prove" && docker run -d $OS /bin/sh -c "./virtualmin-install.sh"
- [[ $TRAVIS_OS_NAME == "linux" ]] && docker run -d $OS /bin/sh -c "prove"&& docker run -d $OS /bin/sh -c "./virtualmin-install.sh"