alrra / travis-scripts Goto Github PK
View Code? Open in Web Editor NEW🙅 DEPRECATED
🙅 DEPRECATED
This is feature suggestion.
I want to deploy from org/name
repository to org/org.github.io
repository at times.
$(npm bin)/update-branch --commands "npm run build" \
--commit-message "Hey GitHub, this content is for you! [skip ci]" \
--directory "dist" \
--distribution-branch "gh-pages" \
--source-branch "master" \
--distribution-repository "[email protected]:org/org.github.io.git" # <= like this
UseCase:
I've developed almin/almin that is monorepo.
This mono repository includes website/
directory.
I want to deploy from almin/almin/website to almin/almin.github.io, but update-branch
does not support distribution repository option.
Currently, I just use push-to-github-io.sh that is copied from alrra/travis-scripts.
Did you have any chance to support this feature?
After running gem install travis
, you need to run another step if you use travis-ci.com
instead of travis-ci.org
(which is being deprecated). The step is:
travis endpoint --pro --set-default
Background (no need to mention this in the docs): this updates the local config at ~/.travis/config.yml
and ensures the travis
CLI is uploading the environment secrets to the .com
domain.
GitHub repositories support Deploy Keys, to allow for a SSH key for a specific repository only. Using Deploy Keys is more secure than GitHub tokens as they can only be used for one repository. Therefore, allowing SSH URLs like [email protected]
should be allowed.
Due to this line, the master
branch cannot be deployed to, as master
is the default branch and cannot be created again. Perhaps a check could be added for the master
branch?
This throws me errors, what was going on?
node update_site_branch.sh
Might be a bug in master so a patch release HIGHLY welcomed.
Please keep in mind that this is a really minor “issue”.
The current API looks like this:
$(npm bin)/set-up-ssh -k "$encrypted_ca2180397773_key" \
-iv "$encrypted_ca2180397773_iv" \
--path-encrypted-key ".travis/github_deploy_key.enc"
-iv
and not --iv
? Generally, single-char options use -
and multi-char options use --
in CLIs.--
alternative for -k
?Every repo using travis-scripts using deploy keys (as recommended) will include some boilerplate code like this:
# Decrypt the file containing the private key.
openssl aes-256-cbc \
-K $encrypted_fa862907f31d_key \
-iv $encrypted_fa862907f31d_iv \
-in "$(dirname "${BASH_SOURCE}")/${PRIVATE_KEY_FILE_NAME}.enc" \
-out ~/.ssh/${PRIVATE_KEY_FILE_NAME} -d;
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Enable SSH authentication.
chmod 600 ~/.ssh/${PRIVATE_KEY_FILE_NAME};
echo 'Host github.com' >> ~/.ssh/config;
echo " IdentityFile ~/.ssh/${PRIVATE_KEY_FILE_NAME}" >> ~/.ssh/config;
Could travis-scripts include a helper utility that performs these tasks? The only variables are the encrypted key file name, and the key and IV variables. That would allow replacing the above with something like:
set-up-ssh --encrypted-key-file "github_deploy_key" \
--key "$encrypted_fa862907f31d_key" \
--iv "$encrypted_fa862907f31d_iv"
This would greatly simplify this section in the docs (ref. #20): https://github.com/alrra/travis-scripts/blob/master/doc/github-deploy-keys.md#26-setup-the-ssh-key-for-travis-ci
We use this to update the gh-pages branch, but every time, it uses git init
and starts a fresh branch. Is there any way it could keep the history? That way, I could use a build command that builds - for example - each SHA separately, and keep all of them intact for historical perusal.
Not all projects might use npm, so using it would add a dependency.
For build tasks that take more than 10 minutes to run, travis-scripts has to be wrapped in travis_wait
otherwise.
Adding an option to avoid suppressing the output would prevent this situation altogether, at least in my case.
Make the --commands
argument to update-branch
relative to the repository’s root directory rather than to the update-branch
path (which may change between versions).
Example where I had expected this behavior and it caused the build to fail: https://travis-ci.org/tibiamaps/tibia-map-data/builds/116006101#L1387 Matching .travis.yml
config: https://github.com/tibiamaps/tibia-map-data/blob/f70d9a2b92aae2d9e430941a4aef73534242ac36/.travis.yml#L12-L13, i.e.:
after_success:
- "./scripts/travis/auto-deploy.sh"
Which includes https://github.com/tibiamaps/tibia-map-data/blob/f70d9a2b92aae2d9e430941a4aef73534242ac36/scripts/travis/auto-deploy.sh#L27:
$(npm bin)/update-branch --commands './travis/scripts/build.sh' […]
This could be as simple as running cd "${TRAVIS_BUILD_DIR}";
before evaluating the --commands
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.