__ ______ ________ __
/ |/ / | / ____/ / / /
/ /|_/ / /| |/ / / /_/ /
/ / / / ___ / /___/ __ /
/_/ /_/_/ |_\____/_/ /_/
=============================
A bash wrapper for fly to allow faster access to standard fly commands. Got sick of using long commands and trying to remember the right tags for things all the time while doing development work with fly and concourse.
It is used in the directory that contains your pipeline.
It is not designed as a replacement for all fly commands, just ones that are more commonly used in development phases.
Fly must be installed in your PATH somewhere too. Download fly from Concourse Downloads
Put mach
in your PATH somewhere, ~/bin
is a good spot if it is in your PATH.
List of commands that are supported:
sp
set pipeline, will automatically create a pipeline based on the current working directory name, override with-p <pipeline>
or specify in.mach
fileup
unpause pipelinedp
destroy pipelinepp
pause pipelinespup
set pipeline and unpause it
tj
trigger job, will present a list of jobs based on the pipeline configuration file and allow user to select, and automatically uses the pipeline based on the current working directory name, override with-p <pipeline> -j <jobname>
w
watch jobtjw
trigger job then watch itpj
pause jobuj
unpause job
cr
check resource, will perform a check on a resource from a list based on the pipeline config, uses pipeline based on the current working directory, override with-p <pipeline> -r <resourcename>
pr
pause resourceur
unpause resource
Run using mach <option>
Change into a directory that contains a pipeline you want to set up, then run mach sp
. MACH will check that the directory contains a pipeline and vars file, then it will pass off to fly using something like fly -t ${FLYTARGET} sp -c ${PIPEFILE} -l ${VARSFILE} -p $(basename ${PWD})
Create a .mach
file in the directory with your pipeline and vars
Use variables to define your MACH environment
Uses the .mach
file to allow access to fly easily with shortcuts using preconfigured settings.
Populate your .mach
file with your fly target by entering FLYTARGET=targetname
Defaults to looking for ci/pipeline.yml
and ci/vars.yml
unless overrides using exports are in place
FLYTARGET=example
sets your fly targetPIPEFILE=ci/pipeline.yml
sets the pipeline file to useVARSFILE=ci/vars.yml
sets the vars file if you have onePIPELINE=pipeline
sets the name of your pipeline if it differs from the base directory name
MACH will source this file when executed from within the directory it is contained, and use the options defined inside.