Put in pom.xml a variable version:
<version>${my.artifact.version}</version>
And set this variable in mvn command line:
mvn -Dmy.artifact.version=1.0-$(date +%Y%m%d%H%M%S) deploy
| import json | |
| data = json.load(open('terraform.tfstate')) | |
| all_res = [mod['resources'].values() for mod in data['modules']] | |
| res_list = reduce(lambda x, y: x + y, all_res) | |
| disk_attrs = [r['primary']['attributes'] for r in res_list if r['type'] == 'google_compute_disk'] | |
| print [a['users.0'].split('/')[-1] for a in disk_attrs if 'users.0' in a] |
| apply plugin: 'java' | |
| defaultTasks 'download' | |
| dependencies { | |
| runtime 'org.yaml:snakeyaml:1.18', 'org.mongodb:mongo-java-driver:3.4.2' | |
| } | |
| repositories { | |
| mavenCentral() | |
| } |
| yum install -y gcc python-devel openssl-devel epel-release | |
| yum install -y python-pip | |
| pip install ansible |
Put in pom.xml a variable version:
<version>${my.artifact.version}</version>
And set this variable in mvn command line:
mvn -Dmy.artifact.version=1.0-$(date +%Y%m%d%H%M%S) deploy
10.0.0.1.nip.io maps to 10.0.0.1
app.10.0.0.1.nip.io maps to 10.0.0.1
customer1.app.10.0.0.1.nip.io maps to 10.0.0.1
customer2.app.10.0.0.1.nip.io maps to 10.0.0.1
otherapp.10.0.0.1.nip.io maps to 10.0.0.1
| mvn dependency:copy -Dartifact=org.yaml:snakeyaml:1.18 -DoutputDirectory=. -Dmdep.stripVersion=true |
| import hudson.model.* | |
| // in order to pass environment variables into build, EnvInjectPlugin should be installed | |
| import org.jenkinsci.plugins.envinject.EnvInjectPluginAction | |
| println Hudson.instance.getItem('down_stream_job_name').scheduleBuild2( | |
| 5, // quiet period | |
| new ParametersAction( // build parameters | |
| new StringParameterValue('STR_PARAM', 'Its value'), // string parameter | |
| new BooleanParameterValue('BOOL_PARAM', true) // boolean parameter | |
| ), |
| - connection: local | |
| hosts: localhost | |
| tasks: | |
| - debug: | |
| msg: "{{ ('secretword' | password_hash('sha256', 'salt_string')).split('$')[-1][:16] }}" | |
| var ADMIN_USER = 'root'; | |
| var ADMIN_PASS = 'ass4' + ADMIN_USER | |
| var NEW_USER = 'dummy'; | |
| var TARGET_DB = 'mydb'; | |
| var conn = new Mongo(); | |
| var admDb = conn.getDB('admin'); | |
| try { | |
| admDb.createUser({user: ADMIN_USER, | |
| pwd: ADMIN_PASS, |
| #!/usr/bin/env python | |
| # to connect it using curl: | |
| # curl -H 'Authorization: Token 9d003d9a-2288-46b8-bfeb-7cec1eb53074' http://my.host.name/api/my_collection/ | |
| import eve | |
| class MyTokenAuth(eve.auth.TokenAuth): | |
| def check_auth(self, token, allowed_roles, resource, method): | |
| return token == '9d003d9a-2288-46b8-bfeb-7cec1eb53074' |