Script for Travis and Git Pushes
I'm looking to create a script for Travis that, when a push is made to a branch in my github repo, it checks the name of the branch that the push is made to, and if it is the master branch the updates get deployed to /var/www/html on my webserver. If the name of the branch is not master the updates get pushed to /var/www/test, again on my webserver.
The reason I'm looking to do this is that the /test virtual host is password protected so updates can be viewed by only the web developers, the updates can then be tested before the branch is merged with the master branch and the update is live.
I've set Travis up correctly and it makes build like it should I just need help with creating a script that does the above job and updating the .travis.yml file to reflect this.
See also questions close to this topic
Git: release 2 remote feature branches
We are working towards a release: 2 remote feature branches: F2 and F3
How do we deal with F3 to create the release? What is the best approach.
- Proposal 1: Simply merge F3 into development.
- Proposal 2: First merge development into F3 (including the F2 changes), then merge into development.
Blue = Master = Release Branch Red = Development branch Green = Feature branches
Git: merge or rebase 2 feature branches?
We are working on a release:
- 2 feature branches: F2 and F3
- F2 is finished.
How do we deal with F3? What is the best approach.
- Proposal 1: Rebase F3, then merge.
- Proposal 2: Simply merge F3 into development.
What is the best approach? Pro's and con's please?
- Blue = Master = Release Branch
- Red = Development branch
- Green = Feature branches
How to test GIT LFS?
What will be the best approach to test GIT LFS? Is there any official way how to do it without need to involve repository and remote repository directly? Looking for some special test command especially.
Build docker image from github - submodules not cloning
I have an application that consists of several services living in different Github repositories. To pinpoint a global version, there is an additional repository that includes the former as Git submodules.
It would be nice if I can build Docker containers using this repo, eg.
docker build github.com/org/repo#1.0:admin(to build the
admincontainer). Without submodules this works, however if
adminis a submodule, it is not fetched (I think
docker buildis not using
git clone --recursive), and thus
docker buildwill give this error:
unable to prepare context: unable to evaluate symlinks in Dockerfile path: lstat /tmp/docker-build-git205355788/admin/Dockerfile: no such file or directory
Indeed the directory
adminis empty. https://docs.docker.com/engine/reference/commandline/build/#git-repositories says it should copy recursively but it seems it doesn't. Am I doing something wrong or is this a bug?
> docker --version
Docker version 17.12.0-ce, build c97c6d6
How do I include files in Git but not in Github with PyCharm?
I have created a Django project in PyCharm Professional, which I imported into version control Git. I have imported the project as a whole.
Now I want to create a Github repository but there are files and folders that I want to be on Git locally but not on the Github repository.
I can share my project on Github through the VCS menu, but it will include everything.
Is there a way to have files and folders in Git but not in Github ? Maybe add them later ?
OS X Illegal Instruction: 4 in Travis-CI
I have a Mac Mini (running OS X Version 10.11.6 on it), and I have been trying to compile a binary that I want to run on the Travis-CI OS X servers.
I have succeeded at doing this before (with the same device). But this time around, I'm getting the
Illegal Instruction 4error you can see on this line. This error does not occur on my Mac Mini. The program runs fine. It only occurs on Travis-CI.
A quick stack overflow search of this error gives me this question, which shows that the error can be fixed by compiling the binaries with the
-mmacosx-version-min=10.xflag. Well, I have tried that to no avail. To be more specific, I compiled by binary with the
-mmacosx-version-min=10.9flag, which I think should be fine considering that the Travis-CI OS X version is 10.11 (which makes me wonder why I was getting that error in the first place since I built the binary on OS X 10.11).
The binary I am trying to run can be found here, and if I run
otool -lon it, I see this section:
Load command 9 cmd LC_VERSION_MIN_MACOSX cmdsize 16 version 10.9 sdk 10.11
which looks fine. I compiled it and linked it in compatibility mode for OS X 10.9, and I compiled it on an OS X 10.11 machine. The dynamic dependencies appear to be alright as well:
Mac-mini:~ patrick$ otool -L ./osx64-genXrdPattern ./osx64-genXrdPattern: /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.1.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
And here is the g++ version that I built the binary with:
Mac-mini:~ patrick$ g++ --version Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 8.0.0 (clang-800.0.42.1) Target: x86_64-apple-darwin15.6.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin
So I've just been spending a lot of time trying to figure out: why will my binary not run on Travis-CI? And why do I keep getting an
Illegal Instruction: 4? The binary seems to run fine on my Mac Mini. If anyone knows what the problem is or has any advice on fixing the problem, it would be greatly appreciated. Thank you!
R package development fails with R CMD Check in terminal but nowhere else
I'm in the process of updating a package on
CRANfor which I am a maintainer and I'm running into an interesting error.
I'm using this repo and branch as my working copy. In a
C:>prompt on my Windows 7 machine, I can run
R CMD INSTALLand
R CMD buildwithout error. In RStudio, I can use
devtools::check(document = FALSE)and I get
Status: OK R CMD check results 0 errors | 0 warnings | 0 notes R CMD check succeeded
On github, I used this page to add a travis "builder" to my repo/branch, and everything builds successfully there, too.
However, when I run
R CMD checkat my
C:>, I get an
ERRORwhen running examples. I'm not sure why this is the case. When I test functions, everything works normally, and when I build and install, everything seems to be just fine. It's only when I run the
R CMD checklocally that everything falls apart.
For the life of me, I can't figure out why
R CMD checkfails for me on my machine, but not anywhere else.
> version _ platform x86_64-w64-mingw32 arch x86_64 os mingw32 system x86_64, mingw32 .. version.string R version 3.3.3 (2017-03-06)
what does a single colon mean in sbt (between two commands)
In a .travis.yml file using sbt, I see this
script: - sbt ++$TRAVIS_SCALA_VERSION test:fastOptJS test:fullOptJS
In sbt, I can run
test, and I can run
fastOptJS. What does the single colon between them do?
In travis, can one run a sequence of commands? ie. what does it mean for
test:fastOptJSto be followed by