Skip to content

Commit

Permalink
Merge pull request #139 from artefactory/dev
Browse files Browse the repository at this point in the history
ACK v2.0
  • Loading branch information
gabrielleberanger authored Apr 2, 2021
2 parents de780a1 + 29fb5b2 commit 7d4163c
Show file tree
Hide file tree
Showing 269 changed files with 10,429 additions and 6,138 deletions.
4 changes: 2 additions & 2 deletions .env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PROJECT_ID=artefact-docker-containers
DOCKER_IMAGE=nautilus-connectors-kit-dev
DOCKER_TAG=v1.1
DOCKER_IMAGE=artefactory-connectors-kit-dev
DOCKER_TAG=v2.0
DOCKER_REGISTRY=eu.gcr.io
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ ignore =
E203, # Conflicts with black, see https://github.com/psf/black/issues/544
W605, # Invalid excape sequences like "\(" in string regexes

per-file-ignores = nck/readers/adobe_reader.py:E731
per-file-ignores = ack/readers/adobe_reader.py:E731
60 changes: 60 additions & 0 deletions .github/workflows/deploy_doc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# GNU Lesser General Public License v3.0 only
# Copyright (C) 2020 Artefact
# [email protected]
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 3 of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

name: Build and deploy documentation to Github pages

on:
push:
branches:
- dev

jobs:

build-and-deploy:

runs-on: ubuntu-latest

steps:

- name: Checkout
uses: actions/checkout@v2
with:
persist-credentials: false

- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.8

- name: Install Python dependencies
run: |
pip3 install setuptools
pip3 install sphinx sphinx-rtd-theme
- name: Build Sphinx doc
run: |
cd docs/
make html
- name: Deploy Github Pages
uses: JamesIves/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: docs/build/html/
CLEAN: true
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,24 @@
# You should have received a copy of the GNU Lesser General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# This workflow will build a docker container and publish it to Google Container Registry.

# TO CONFIGURE THIS WORKFLOW
# 1. Set up secrets in your workspace:
# - GCP_PROJECT with the name of the project
# - GCP_EMAIL with the service account email
# - GCP_KEY with the service account key
# 2. Deployment infos are by now in the .env module:
# don't forget to change the version when updating the master branch.


# To configure this workflow:
#
# 1. Set up secrets in your workspace: GCP_PROJECT with the name of the project, GCP_EMAIL with the service account
# email, GCP_KEY with the service account key.
#
# 2. The deployments info are by now in the .env, dont forget to change the version when updating the master.

name: Build and Deploy image to GCP
name: Build and publish Docker image to GCP Container Registry

on:
pull_request:
types: [closed]

# Environment variables available to all jobs and steps in this workflow
# Environment variables available to all jobs and steps in this workflow:
env:

GCP_EMAIL: ${{ secrets.GCP_EMAIL }}
PROJECT_ID: ${{ secrets.PROJECT_ID }}
DOCKER_TAG: ${{ github.run_id }}
Expand All @@ -42,31 +41,28 @@ env:
CLOUDSDK_PYTHON_SITEPACKAGES: 1

jobs:
setup-build-publish:
if: github.event.pull_request.merged == true
name: Setup, Build, Publish
runs-on: ubuntu-latest
steps:

- name: Checkout
uses: actions/checkout@v1

# Setup gcloud CLI
- uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
with:
version: '290.0.1'
service_account_email: ${{ secrets.GCP_EMAIL }}
service_account_key: ${{ secrets.GCP_KEY }}
build-and-deploy:

- name: Clean ENV
run: |
> .env
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true

steps:

# Build the Docker image
- name: Build And Publish
run: |
make publish_base_image
- name: Checkout
uses: actions/checkout@v1

- name: Setup gcloud CLI
uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
with:
version: '290.0.1'
service_account_email: ${{ secrets.GCP_EMAIL }}
service_account_key: ${{ secrets.GCP_KEY }}

- name: Clean .env
run: |
> .env
- name: Build and publish Docker image
run: |
make publish_base_image
Original file line number Diff line number Diff line change
Expand Up @@ -15,37 +15,42 @@
# You should have received a copy of the GNU Lesser General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

name: Lint and run tests

on: [push]

jobs:

build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Install dev dependencies
run: |
pip install -r requirements-dev.txt
- name: Lint with flake8
run: |
# stop nck build if there are Python syntax errors or undefined names
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
# Uncomment when the repo is clean :)
flake8 ./nck/ --count --max-complexity=10 --max-line-length=127 --statistics
flake8 ./tests/ --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 ./tests/ --count --max-complexity=10 --max-line-length=127 --statistics
- name: Test with nose
run: |
nosetests

- name: Checkout
uses: actions/checkout@v1

- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.8

- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements-dev.txt
- name: Lint with flake8
run: |
# stop ack build if there are Python syntax errors or undefined names
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
# Uncomment when the repo is clean :)
flake8 ./ack/ --count --max-complexity=10 --max-line-length=127 --statistics
flake8 ./tests/ --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 ./tests/ --count --max-complexity=10 --max-line-length=127 --statistics
- name: Test with nose
run: |
nosetests
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ instance/
.scrapy

# Sphinx documentation
docs/_build/
docs/build/**
!docs/build/
!docs/build/.gitkeep

# PyBuilder
target/
Expand Down Expand Up @@ -112,7 +114,7 @@ tmp/
.idea/
credentials/*

.nck.egg-info
.ack.egg-info
.DS_Store

# Pipenv
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
repos:
- repo: https://github.com/ambv/black
rev: stable
rev: 19.10b0
hooks:
- id: black
entry: black
language_version: python3.7
language_version: python3
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v1.2.3
hooks:
Expand Down
13 changes: 0 additions & 13 deletions AUTHORS.rst

This file was deleted.

43 changes: 0 additions & 43 deletions CONTRIBUTING.md

This file was deleted.

43 changes: 8 additions & 35 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,41 +1,14 @@
FROM python:3.7
FROM python:3.8-slim-buster

# Install Unix packages
RUN apt-get update && apt-get install -y \
supervisor \
cron \
nano \
git \
build-essential \
unzip \
libaio-dev \
&& mkdir -p /opt/data/api
ENV PYTHONDONTWRITEBYTECODE True
ENV PYTHONUNBUFFERED True

# Oracle Dependencies
ADD ./vendor /opt/vendor
ADD requirements.txt .
RUN python -m pip install -r requirements.txt

WORKDIR /opt/vendor
WORKDIR /app
ADD . /app

ENV ORACLE_HOME=/opt/oracle/instantclient
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME

ENV OCI_HOME=/opt/oracle/instantclient
ENV OCI_LIB_DIR=/opt/oracle/instantclient
ENV OCI_INCLUDE_DIR=/opt/oracle/instantclient/sdk/include

# Install Oracle
RUN mkdir /opt/oracle
RUN chmod +x /opt/vendor/install.sh
RUN /opt/vendor/install.sh

RUN mkdir /app

# Copy code
ADD . /app/
RUN chmod -R 0644 /app
WORKDIR /app/
ENV PYTHONPATH=${PYTHONPATH}:.

RUN python setup.py install

ENTRYPOINT ["nckrun"]
ENTRYPOINT ["python", "ack/entrypoints/cli/main.py"]
Loading

0 comments on commit 7d4163c

Please sign in to comment.