This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## Spin up a JFrog Artifactory server as a Docker container. | |
## By Stephen D. Rogers <inbox.c7r@steve-rogers.com>, 2017-04. | |
## | |
## Usage: | |
## | |
## artifactory.spin-up [--interactive|-i] [--restart policy] [--tty|-t] [listening_port] | |
## | |
## The Artifactory listening port (on the container host) defaults to 8001. | |
## |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
## Install the latest stable Docker and associated tools. | |
## By Stephen D. Rogers <inbox@c7r@steve-rogers.com>, 2017-04. | |
## | |
set -e | |
cmd_apt_get="${cmd_apt_get:-xx sudo apt-get --quiet}" | |
my_user_name="${my_user_name:-$(id -un)}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## Spin up a Git server as a Docker container. | |
## By Stephen D. Rogers <inbox.c7r@steve-rogers.com>, 2017-06. | |
## | |
## Usage: | |
## | |
## git-server.spin-up [--interactive|-i] [--restart policy] [--tty|-t] [listening_port] | |
## | |
## The git-server listening port (on the container host) defaults to 2203. | |
## |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## Spin up a Jenkins server as a Docker container. | |
## By Stephen D. Rogers <inbox.c7r@steve-rogers.com>, 2017-04. | |
## | |
## Usage: | |
## | |
## jenkins.spin-up [--interactive|-i] [--restart policy] [--tty|-t] [listening_port [cli_listening_port]] | |
## | |
## The Jenkins listening port (on the container host) defaults to 8002. | |
## The Jenkins CLI listening port (on the container host) defaults to 2202. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pipeline { | |
agent { docker 'maven' } | |
stages { | |
stage('build') { | |
steps { | |
sh 'echo "Hello World"' | |
sh 'mvn --version || :' | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## Spin up a Nginx server as a Docker container. | |
## By Stephen D. Rogers <inbox.c7r@steve-rogers.com>, 2017-06. | |
## | |
## Usage: | |
## | |
## nginx.spin-up [--interactive|-i] [--restart policy] [--tty|-t] [listening_port] | |
## | |
## The Nginx listening port (on the container host) defaults to 80. | |
## |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## Spin up a Tomcat server as a Docker container. | |
## By Stephen D. Rogers <inbox.c7r@steve-rogers.com>, 2017-07. | |
## | |
## Usage: | |
## | |
## tomcat.spin-up [--interactive|-i] [--restart policy] [--tty|-t] [listening_port] | |
## | |
## The Tomcat listening port (on the container host) defaults to 8080. | |
## |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##/bin/bash | |
## | |
vagrant_deb_url='https://releases.hashicorp.com/vagrant/1.8.6/vagrant_1.8.6_x86_64.deb' | |
vagrant_deb_fpn="${HOME}/Downloads/${vagrant_deb_url##*/}" | |
if ! [ -e "${vagrant_deb_fpn:?}" ] ; then | |
xx wget -q -O "${vagrant_deb_fpn:?}" "${vagrant_deb_url:?}" | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
delayed_exit_p= | |
function post_delayed_exit() { # exit_code explanation ... | |
local exit_code="${1:?missing argument: exit_code}" ; shift | |
: "${1:?missing argument: explanation}" | |
if [ -z "${delayed_exit_p}" ] ; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function check_user_is_root_or_devops() { | |
if ! user_is_root_or_devops ; then | |
post_delayed_exit 2 "You must be root or devops to execute this command; aborting." | |
fi | |
} | |
function user_is_root_or_devops() { |
OlderNewer