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

Run build in local container #1

Open
abitrolly opened this issue May 7, 2020 · 1 comment
Open

Run build in local container #1

abitrolly opened this issue May 7, 2020 · 1 comment

Comments

@abitrolly
Copy link
Member

When Travis fails without logs it is impossible to tell what's going on without setting up all the environment locally. Which is tedious. Need a script to automate the task.

https://stackoverflow.com/questions/21053657/how-to-run-travis-ci-locally contains some info, which might be outdated.

It should be automated. Take a look at https://github.com/nektos/act for an inspiration.

@abitrolly
Copy link
Member Author

abitrolly commented May 7, 2020

  #!/bin/bash
  
  # [ ] get https://travis-ci.org/github/fedora-infra/fmn/jobs/684072799
  # [ ] parse instance line
  #       instance: travis-job-e83417dd-07c1-44a4-b6d0-29b945442c5f travis-ci-ubuntu-1804-1582576938-a9b1ae58 (via amqp)
  # [ ] convert "travis-ci-ubuntu-1804-1582576938-a9b1ae58" -> "travisci/ci-ubuntu-1804:packer-1582574251-a9b1ae58"
  # [ ] 
  
  INSTANCE="travisci/ci-ubuntu-1804:packer-1582574251-a9b1ae58"
  
  # name of current dir
--NAME=$(basename "$PWD")
  
  podman run -it -v "$(pwd):/app":Z "$INSTANCE" /bin/bash
  # -t   -- allocate TTY
  # -i   -- keep STDIN open
  
  # su - travis
  # cp -r /app workdir
  # cd workdir
  
  # ^^^ copy, because of permissions (`travis` user can not write to volume)

This kind of works.

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

No branches or pull requests

1 participant