Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set up CI with Azure Pipelines #3

Open
wants to merge 38 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
0b99f24
Set up CI with Azure Pipelines
ntrncic Dec 12, 2019
0f31377
Update azure-pipelines.yml for Azure Pipelines
domdinicola Dec 16, 2019
418e1c3
Update azure-pipelines.yml for Azure Pipelines
domdinicola Dec 16, 2019
34cb84a
Update azure-pipelines.yml for Azure Pipelines
domdinicola Dec 16, 2019
fddfb11
Update azure-pipelines.yml for Azure Pipelines
domdinicola Dec 16, 2019
ae545ca
Update azure-pipelines.yml for Azure Pipelines
domdinicola Dec 16, 2019
f8ad56f
Update azure-pipelines.yml for Azure Pipelines
domdinicola Dec 16, 2019
9c10ef2
Update azure-pipelines.yml for Azure Pipelines
domdinicola Dec 16, 2019
10dc276
Update azure-pipelines.yml for Azure Pipelines
domdinicola Dec 16, 2019
f90b786
Update azure-pipelines.yml for Azure Pipelines
domdinicola Dec 16, 2019
2574141
Update azure-pipelines.yml for Azure Pipelines
domdinicola Dec 16, 2019
c155497
Update azure-pipelines.yml for Azure Pipelines
domdinicola Dec 16, 2019
a47dc00
Update azure-pipelines.yml for Azure Pipelines
domdinicola Dec 16, 2019
41f4908
Update azure-pipelines.yml for Azure Pipelines
ntrncic Dec 16, 2019
f4b0e0b
Update azure-pipelines.yml for Azure Pipelines
ntrncic Dec 16, 2019
e5f836e
Update azure-pipelines.yml for Azure Pipelines
ntrncic Dec 16, 2019
4f27304
Update azure-pipelines.yml for Azure Pipelines
ntrncic Dec 16, 2019
97fb3dc
Update azure-pipelines.yml for Azure Pipelines
ntrncic Dec 16, 2019
5534ec7
Update azure-pipelines.yml for Azure Pipelines
ntrncic Dec 16, 2019
8b6b52c
Update azure-pipelines.yml for Azure Pipelines
ntrncic Dec 16, 2019
f074939
Update azure-pipelines.yml for Azure Pipelines
ntrncic Dec 16, 2019
0e93ed8
Update azure-pipelines.yml for Azure Pipelines
ntrncic Dec 16, 2019
f59d65c
Update Dockerfile
ntrncic Dec 16, 2019
beb156e
new dockerfile
ntrncic Dec 17, 2019
a67a6d0
Update azure-pipelines.yml for Azure Pipelines
ntrncic Dec 16, 2019
638b6e6
Update Makefile
ntrncic Dec 16, 2019
c235802
Update Makefile
ntrncic Dec 16, 2019
1ff5e11
Update Makefile
ntrncic Dec 16, 2019
da49f3d
Update Makefile
ntrncic Dec 16, 2019
a750a38
Update Makefile
ntrncic Dec 16, 2019
313aa51
Update Makefile
ntrncic Dec 16, 2019
6a00272
Update Makefile
ntrncic Dec 16, 2019
be3b90c
Update azure-pipelines.yml for Azure Pipelines
domdinicola Dec 17, 2019
c1cec14
Update azure-pipelines.yml for Azure Pipelines
domdinicola Dec 17, 2019
9da4138
add
ntrncic Dec 17, 2019
bc84ef4
dockerfileprd updates
ntrncic Dec 17, 2019
5442415
for nik
robertavram Dec 17, 2019
8bf68fd
Update Dockerfile.prd
ntrncic Dec 18, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions Dockerfile.prd
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
FROM unicef/donor-reporting-portal-backend:0.6-base

COPY . /code
WORKDIR /code
RUN pip3 install . \
&& rm -fr /code

ENV PYTHONUNBUFFERED=1
ENV DJANGO_SETTINGS_MODULE=donor_reporting_portal.config.settings
ENV SECRET_KEY="not-so-secret-key-just-for-collectstatic"
ENV STATIC_ROOT=/tmp/static
ENV MEDIA_ROOT=/tmp/media

ENV UWSGI_PROTOCOL=http \
UWSGI_WORKERS=4 \
UWSGI_AUTO_PROCNAME=true \
UWSGI_BUFFER_SIZE=32768 \
UWSGI_DIE_ON_TERM=true \
UWSGI_DISABLE_LOGGING=false \
UWSGI_DISABLE_WRITE_EXCEPTION=true \
UWSGI_FREEBIND=true \
UWSGI_HARAKIRI=180 \
UWSGI_HTTP_TIMEOUT=180 \
UWSGI_IGNORE_SIGPIPE=true \
UWSGI_IGNORE_WRITE_ERRORS=true \
UWSGI_LIMIT_POST=20971520 \
UWSGI_LOG_X_FORWARDED_FOR=false \
UWSGI_MEMORY_REPORT=true \
UWSGI_NEED_APP=true \
UWSGI_POST_BUFFERING=65536 \
UWSGI_PROCNAME_PREFIX_SPACED="[DonorReportingPortal]" \
UWSGI_RELOAD_ON_RSS=600 \
UWSGI_THREADS=4 \
UWSGI_THUNDER_LOCK=true \
UWSGI_VACUUM=true \
UWSGI_MODULE="donor_reporting_portal.config.wsgi:application" \
UWSGI_HTTP_SOCKET=0.0.0.0:8000 \
UWSGI_MASTER=true \
UWSGI_ENABLE_THREADS=true \
UWSGI_LAZY_APPS=true \
UWSGI_SINGLE_INTERPRETER=true

EXPOSE 8000

ADD docker/*.sh /usr/local/bin/

ENTRYPOINT ["entrypoint.sh"]
RUN ["chmod", "+x", "/usr/local/bin/entrypoint.sh"]
WORKDIR /var/donor_reporting_portal

CMD ["donor_reporting_portal"]
22 changes: 22 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Python Django
# Test a Django project on multiple versions of Python.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/python

pool:
vmImage: 'ubuntu-16.04'

variables:
imageName: '$(Build.BuildId)'
# define two more variables dockerId and dockerPassword in the build pipeline in UI

steps:
- script: |
cd docker
make build
docker tag unicef/donor-reporting-portal-backend:${TARGET} unicef/donor-reporting-portal-backend:dev
docker push unicef/donor-reporting-portal-backend:${TARGET}
docker push unicef/donor-reporting-portal-backend:dev
env:
pswd: $(dockerPassword)
displayName: 'Build and push Docker image'
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG BASE_IMAGE=0.6

FROM unicef/donor-reporting-portal-backend:${BASE_IMAGE}-base
FROM unicef/donor-reporting-portal-backend:0.6-base

#ARG BUILD_DATE
#ARG VERSION
Expand Down
10 changes: 3 additions & 7 deletions docker/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ BASE?=$(shell echo "${TARGET}" | sed "s/\([0-9]\)\.\([0-9]\)\.\(.*\)/\1.\2/g" )
BUILD_OPTIONS?=
CMD?=donor_reporting_portal
CONTAINER_NAME?=donor_reporting_portal-${TARGET}
ORGANIZATION=unicef
IMAGE_NAME=donor-reporting-portal-backend
DOCKER_IMAGE_NAME?=${ORGANIZATION}/${IMAGE_NAME}
DOCKER_IMAGE_NAME?=unicef/donor-reporting-portal-backend
DOCKER_IMAGE?=${DOCKER_IMAGE_NAME}:${TARGET}
DOCKERFILE?=Dockerfile
RUN_OPTIONS?=
Expand Down Expand Up @@ -48,7 +46,7 @@ build-test:
TARGET=dev $(MAKE) .build test

build:
$(MAKE) .build test
$(MAKE) .build

.run:
cd .. && docker run \
Expand Down Expand Up @@ -92,10 +90,8 @@ local:
$(MAKE) .run

release:
@echo ${DOCKER_PASS} | docker login -u ${DOCKER_USER} --password-stdin
docker tag ${DOCKER_IMAGE_NAME}:${TARGET} ${DOCKER_IMAGE_NAME}:dev
echo "${DOCKER_PASS}" | docker login -u "${DOCKER_USER}" --password-stdin
docker push ${DOCKER_IMAGE_NAME}:${TARGET}
docker push ${DOCKER_IMAGE_NAME}:dev

# deploy:
# lazo rancher upgrade donor_reporting_portal:donor_reporting_portal ${DOCKER_IMAGE_NAME}:${TARGET}
Expand Down