A CLI to create and manage projects that work with our infra.
hackgproject 0.2.7
Michael Eden <themichaeleden@gmail.com>
USAGE:
hackgproject [SUBCOMMAND]
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
SUBCOMMANDS:
help Prints this message or the help of the given subcommand(s)
init Update/Create HackGT boilerplate
test Test the travis-ci build and build your docker image.
This package comes as a single binary with no dependencies for osx/linux here.
Throw this binary in /usr/bin/
or similar so you can run it from anywhere.
Let's say we want to make a badging system for HackGT, we'll call our
app badger
so we can have a cute mascot in the future. Just run:
$ hackgproject init badger
"badger" does not exist, creating it.
Initialized empty Git repository in ~/hackgt/hackgproject/badger/.git/
Writing '.travis.d/build.sh'.
Writing '.travis.yml'.
Writing '.gitignore'.
Writing 'LICENSE'.
Writing 'README.md'.
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ You're almost up and running! Just a few more steps: ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
1. Create this repo on GitHub: https://github.com/HackGT/
2. Hit 'Restart Build' to get your project set up with all of
HackGT's infra: https://travis-ci.org/HackGT/travis-secrets-setter
This sets up all the stuff you'll need for a local HackGT repo.
The last step is hitting Restart Build
here.
This is a travis job that integrates your new repo into our infra,
you'll get automated testing and deployment under badger.dev.hack.gt
!
Have fun and happy hacking!
You can build static websites too!
$ hackgproject init --static badger
"badger" does not exist, creating it.
Initialized empty Git repository in /home/michaeleden/cde/hackgt/hackgproject/badger/.git/
Creating a static HTML project!
Writing '.travis.d/build.sh'.
Writing '.travis.yml'.
Writing '.gitignore'.
Writing 'LICENSE'.
Writing 'README.md'.
Writing 'CNAME'.
Writing 'index.html'.
Switched to a new branch 'gh-pages'
Just push and go to https://badger.static.hack.gt !
hackgproject
only focuses on testing and building your project in a standard
way to be used by other people, it will:
-
Build and run
Dockerfile.build
if it exists- The repository will be mounted under
/src
. - Changes to
/src
will be visible in future steps. - Use this step if you need a lot of extra tools to build, but fewer to run.
- The repository will be mounted under
-
Build and run
Dockerfile.test
if it exists.- Use this to run any kind of testing or checks for your app.
- This step comes after
Dockerfile.build
.
-
For a
deployment
project, the main image (Dockerfile
) will get built.-
If the build succeeds and this is not a PR, it will publish the built twice, once with tag being the SHA1 hash of the commit, and the other with the tag
latest
orlatest-${branch name}
if not onmaster
. -
After the image has been published a build of biodomes will be triggered. Biodomes will take care of deployment, see the docs other there for more info.
-
-
For a
static
project, the source tree will be committed togh-pages
and the DNS record will be set on cloudflare according to theCNAME
file.
DO NOT EDIT the .travis.yml or the build script by hand! File a bug instead.
If you want to test how your project will be tested and built when uploaded, run:
hackgproject test
If this passes, so should your cloud build. Easy! Run your project after with:
docker run -it badger # or the name of your repo