A list of python data transformations
- String to Datetime and then compare
#!/usr/bin/python
import datetime
node { | |
// Setup the Docker Registry (Docker Hub) + Credentials | |
env.REGISTRY_URL = "https://index.docker.io/v1/" // Docker Hub | |
env.DOCKER_CREDS_ID = "jayjohnson-DockerHub" // name of the Jenkins Credentials ID | |
env.BUILD_TAG = "testing" // default tag to push for to the registry | |
stage 'Checking out GitHub Repo' | |
git url: 'https://github.com/jay-johnson/docker-django-nginx-slack-sphinx.git' | |
#!/bin/bash | |
repo="<DEBIAN REPO FQDN>" | |
outputDir="<DIRECTORY TO STORE DEBIAN FILES>" | |
arch="<ARCH like binary-i386 or binary-amd64>" | |
echo "Download All Debs from Repository($repo) to dir($outputDir)" | |
pushd $outputDir >> /dev/null | |
packagenames=`wget -q -O - http://$repo/pool/main/h | grep deb | grep href | sed -e 's/\/"/ /g' | sed -e 's/"/ /g' | awk '{print $3}'` |
version: '2' | |
services: | |
db: | |
image: jayjohnson/schemaprototyping | |
container_name: "schemaprototyping" | |
hostname: "mysql1" | |
networks: | |
- dbprototyping | |
environment: |
[root@mysql1 db-loaders]# cat /tmp/dbreload.log
Creating Database(stocks) on Env(Local)
Dropping Targeted Database(stocks) Address(127.0.0.1) User(dbadmin) Pass(dbadmin123) Schema(/opt/db-loaders/schema/db_schema.py) Init(/opt/db-loaders/schema/initialize_db.py)
/opt/db-loaders/schema/drop_database.sh stocks dbadmin 127.0.0.1 dbadmin123 3306
Creating Targeted Database(stocks) Address(127.0.0.1) User(dbadmin) Pass(dbadmin123) Schema(/opt/db-loaders/schema/db_schema.py) Init(/opt/db-loaders/schema/initialize_db.py)
/opt/db-loaders/schema/create_database.sh stocks dbadmin 127.0.0.1 dbadmin123 3306
Adding Records with Initializer(/opt/db-loaders/schema/initialize_db.py)
$ cat docker-compose.yml | grep "=" | sort
- DATADIR=/var/lib/mysql
- DBADDRESS=127.0.0.1
- DBHOST=127.0.0.1
- DBINITIALIZER=/opt/db-loaders/schema/initialize_db.py
- DBNAME=stocks
- DBPASS=dbadmin123
- DBPORT=3306
- DBSCHEMA=/opt/db-loaders/schema/db_schema.py
$ ./ssh.sh
SSH-ing into Docker image(schemaprototyping)
[root@mysql1 db-loaders]# /opt/db-loaders/bin/verify_mysql_user.sh
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 25
Server version: 5.6.29 MySQL Community Server (GPL)
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
$ ./verify_mysql_user.sh
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.6.29 MySQL Community Server (GPL)
Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its