This file contains hidden or 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
| ALLOW_UNKNOWN = True | |
| DOMAIN = {'col01': {'schema': {}}} | |
| IF_MATCH = False | |
| ITEM_METHODS = ['GET', 'PATCH', 'PUT', 'DELETE'] | |
| MONGO_DBNAME = 'db01' | |
| RESOURCE_METHODS = ['GET', 'POST', 'DELETE'] | |
| URL_PREFIX = 'api' |
This file contains hidden or 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
| import org.yaml.snakeyaml.Yaml | |
| new Yaml().load(new FileReader('path/to/your/yaml/file')) | |
| // and do whatenver your want with the returned map |
This file contains hidden or 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
| <!-- See http://ant.apache.org/manual/index.html for the complete list of options supported by <apply> task --> | |
| <project name="cycle-test" default="stat-cycle"> | |
| <target name="stat-cycle"> | |
| <!-- set parall="true" in order to run the command only once against all files from the set --> | |
| <apply executable="stat"> | |
| <fileset dir="/etc"> | |
| <patternset> | |
| <include name="*.conf" /> | |
| </patternset> | |
| </fileset> |
This file contains hidden or 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
| ansible-playbook -i localhost, --syntax-check my-playbook.yml |
This file contains hidden or 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 | |
| # tested on CentOS 6.8 | |
| tar xvzf etcd-v3.1.0-linux-amd64.tar.gz --strip-components 1 --exclude Documentation --exclude '*.md' | |
| myip=$(hostname -I | awk '{print $1}') | |
| nohup ./etcd --data-dir etcd_data --listen-client-urls http://${myip}:2379 --advertise-client-urls http://${myip}:2379 2>&1 > etcd.log & | |
| echo $! > etcd.pid |
This file contains hidden or 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
| --- | |
| - name: Recursive copy | |
| hosts: all | |
| vars: | |
| my_src: /path/to/src/dir | |
| my_dst: /path/to/dst/dir | |
| tasks: | |
| - name: find dirs | |
| find: | |
| paths: "{{ my_src }}" |
This file contains hidden or 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
| // from top-level of the job block: | |
| delegate.name | |
| // from a nested block (such as parameters, steps, etc.): | |
| delegate.item.name |
This file contains hidden or 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
| // should be run as Groovy System Script | |
| import hudson.EnvVars | |
| import hudson.model.Environment | |
| def build = Thread.currentThread().executable | |
| def vars = [ENV_VAR1: 'value1', ENV_VAR2: 'value2'] | |
| build.environments.add(0, Environment.create(new EnvVars(vars))) |
This file contains hidden or 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
| def cmdLine = args.join(' ') | |
| def ps = cmdLine.execute() | |
| ps.in.eachLine { | |
| println it | |
| } | |
| def status = ps.exitValue() | |
| if (status) { | |
| println ps.err.text | |
| throw new IOException("$cmdLine returns $status") |
This file contains hidden or 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
| def ant = new AntBuilder() | |
| ant.get(src: 'http://central.maven.org/maven2/jsch/jsch/0.1.29/jsch-0.1.29.jar', | |
| dest: 'jsch.jar') |