From 3364619267867fe1541bd5b2c2ff201260847420 Mon Sep 17 00:00:00 2001 From: Dan Date: Thu, 11 Feb 2021 16:07:28 -0500 Subject: [PATCH] Removing deploy step from Travis, as we are moving to Quay.io for this process. Dropping the deloy.sh as it is no longer in use. Updating the docker file to remove denendency on cr-connect-python-base --- .travis.yml | 8 -------- Dockerfile | 17 +++++++++++++---- deploy.sh | 45 --------------------------------------------- 3 files changed, 13 insertions(+), 57 deletions(-) delete mode 100755 deploy.sh diff --git a/.travis.yml b/.travis.yml index daf2c02..86dfc9e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,14 +30,6 @@ script: after_success: - sonar-scanner -deploy: - provider: script - script: bash deploy.sh sartography/protocol-builder-mock - skip_cleanup: true - on: - all_branches: true - condition: $TRAVIS_BRANCH =~ ^(dev|testing|demo|training|staging|master|rrt\/.*)$ - notifications: email: on_success: change diff --git a/Dockerfile b/Dockerfile index bc602d0..ef931d0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,24 @@ -FROM sartography/cr-connect-python-base +FROM python:3.8 + +RUN pip install pipenv +RUN useradd _gunicorn --no-create-home --user-group + +RUN apt-get update && \ + apt-get install -y -q \ + gcc libssl-dev \ + curl postgresql-client git-core \ + gunicorn3 postgresql-client WORKDIR /app COPY Pipfile Pipfile.lock /app/ +RUN cd /app && pipenv lock --keep-outdated --requirements > requirements.txt +RUN pip install -r /app/requirements.txt RUN set -xe \ - && pipenv install --dev \ && apt-get remove -y gcc python3-dev libssl-dev \ && apt-get autoremove -y \ && apt-get clean -y \ - && rm -rf /var/lib/apt/lists/* \ - && useradd _gunicorn --no-create-home --user-group + && rm -rf /var/lib/apt/lists/* COPY . /app/ WORKDIR /app diff --git a/deploy.sh b/deploy.sh deleted file mode 100755 index 04e3e81..0000000 --- a/deploy.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash - -######################################################################### -# Builds the Docker image for the current git branch on Travis CI and -# publishes it to Docker Hub. -# -# Parameters: -# $1: Docker Hub repository to publish to -# -# Required environment variables (place in Settings menu on Travis CI): -# $DOCKER_USERNAME: Docker Hub username -# $DOCKER_TOKEN: Docker Hub access token -######################################################################### - -echo 'Building Docker image...' -DOCKER_REPO="$1" - -function branch_to_tag () { - if [ "$1" == "master" ]; then echo "latest"; else echo "$1" ; fi -} - -function branch_to_deploy_group() { - if [[ $1 =~ ^(rrt\/.*)$ ]]; then echo "rrt"; else echo "crconnect" ; fi -} - -DOCKER_TAG=$(branch_to_tag "$TRAVIS_BRANCH") - -DEPLOY_GROUP=$(branch_to_deploy_group "$TRAVIS_BRANCH") - -if [ "$DEPLOY_GROUP" == "rrt" ]; then - IFS='/' read -ra ARR <<< "$TRAVIS_BRANCH" # Split branch on '/' character - DOCKER_TAG=$(branch_to_tag "rrt_${ARR[1]}") -fi - -echo "DOCKER_REPO = $DOCKER_REPO" -echo "DOCKER_TAG = $DOCKER_TAG" - -echo "$DOCKER_TOKEN" | docker login -u "$DOCKER_USERNAME" --password-stdin || exit 1 -docker build -f Dockerfile -t "$DOCKER_REPO:$DOCKER_TAG" . || exit 1 - - -# Push Docker image to Docker Hub -echo "Publishing to Docker Hub..." -docker push "$DOCKER_REPO" || exit 1 -echo "Done."