<commit_before># Looker Deployer

![badge](https://github.com/looker-open-source/looker_deployer/workflows/python_application/badge.svg)

## Intro

Looker Deployer (aka 'ldeploy') is a command line tool to help move Looker objects across instances. This includes Content
(Looks, Dashboards, entire Spaces, etc.), Boards and Connections.

## Status and Support

As of November 2021, Looker Deployer is supported, but not warrantied by Bytecode IO, Inc.  Issues and feature requests can be reported via https://github.com/llooker/looker_deployer/issues, which will be regularly monitored and prioritized by Bytecode IO, Inc., a preferred Looker consulting partner.

## Requirements

In order for these commands to correctly work a few assumptions/requirements are needed for your environment:

> - **Python** Looker Deployer requires Python 3.6-3.8
> - **Gazer** The content deployment command makes use of [gzr](https://github.com/looker-open-source/gzr) to automate content deployment, so you will need to have that
>   installed and configured properly. Gazer requires an up-to-date version of ruby.


### Authentication and Configuration

Looker Deployer makes use of the [Looker SDK](https://github.com/looker-open-source/sdk-codegen/tree/master/python) to
communicate with your Looker instances. A `looker.ini` file is required to provide authentication. By default the tool
looks for this file in your working directory but if it is named differently or in a different location you can make use
of the `--ini` argument to specify its location. Here's an example ini file:

```
[dev]
base_url=https://looker-dev.company.com:19999
client_id=abc
client_secret=xyz
verify_ssl=True

[prod]
base_url=https://looker-prod.company.com:19999
client_id=abc
client_secret=xyz
verify_ssl=True
```

## Installation

Looker Deployer is on PyPi! - You can install it with `pip install looker-deployer`.

### Dockerfile

This repo includes a Dockerfile that can be used to containerize Deployer. It includes all dependencies, such as Gazer.
To build, clone this repo, cd into it, and execute a `docker build` command. For example:

```
docker build -t looker_deployer .
```

There are also pre-built images available on [Dockerhub](https://hub.docker.com/r/jcpistell/looker_deployer)

As noted above, a `looker.ini` file is required for API authentication. You will have to either volume-map the ini file
when you run the container, or (recommended) build an image from this one that "burns" a relevant ini file into the
container. You could create a directory containing a Dockerfile and a looker.ini file. The Dockerfile would contain:

```
FROM jcpistell/looker_deployer:latest
COPY looker.ini /
```

Build the image and your config will be available from within the container:

```
docker build -t ldeploy .
```

###  Local Installation
<commit_msg>Updated Readme with Dockerfile instructions and an Example Dockerfile.<commit_after># Looker Deployer

![badge](https://github.com/looker-open-source/looker_deployer/workflows/python_application/badge.svg)

## Intro

Looker Deployer (aka 'ldeploy') is a command line tool to help move Looker objects across instances. This includes Content
(Looks, Dashboards, entire Spaces, etc.), Boards and Connections.

## Status and Support

As of November 2021, Looker Deployer is supported, but not warrantied by Bytecode IO, Inc.  Issues and feature requests can be reported via https://github.com/llooker/looker_deployer/issues, which will be regularly monitored and prioritized by Bytecode IO, Inc., a preferred Looker consulting partner.

## Requirements

In order for these commands to correctly work a few assumptions/requirements are needed for your environment:

> - **Python** Looker Deployer requires Python 3.6-3.8
> - **Gazer** The content deployment command makes use of [gzr](https://github.com/looker-open-source/gzr) to automate content deployment, so you will need to have that
>   installed and configured properly. Gazer requires an up-to-date version of ruby.


### Authentication and Configuration

Looker Deployer makes use of the [Looker SDK](https://github.com/looker-open-source/sdk-codegen/tree/master/python) to
communicate with your Looker instances. A `looker.ini` file is required to provide authentication. By default the tool
looks for this file in your working directory but if it is named differently or in a different location you can make use
of the `--ini` argument to specify its location. Here's an example ini file:

```
[dev]
base_url=https://looker-dev.company.com:19999
client_id=abc
client_secret=xyz
verify_ssl=True

[prod]
base_url=https://looker-prod.company.com:19999
client_id=abc
client_secret=xyz
verify_ssl=True
```

## Installation

Looker Deployer is on PyPi! - You can install it with `pip install looker-deployer`.

### Dockerfile

A `looker.ini` file is required for API authentication. You will have to either volume-map the ini file
when you run the container, or (recommended) build an image from this one that "burns" a relevant ini file into the
container. 

To do this, create a directory with an `looker.ini` file and a `Dockerfile` with the following content: 

```
FROM python:3.8-slim

RUN apt update
RUN apt -y install ruby ruby-dev
RUN gem install gazer

RUN apt -y install git 
RUN git clone https://github.com/looker-open-source/looker_deployer.git

WORKDIR /looker_deployer

COPY looker.ini . 
RUN pip install .

ENTRYPOINT ["ldeploy"]
```

Then simply: 

```
docker build -t looker_deployer .
```

You can get use: ```docker run looker_deployer <command> <parameters> ...```

###  Local Installation

{'fraction_non_alphanumeric': 0.08422555317630265, 'fraction_numerical': 0.006780870806566738, 'mean_word_length': 4.690355329949239, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 14, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '433924', 'n_tokens_mistral': 1713, 'n_tokens_neox': 1606, 'n_words': 680}