Skip to content

Commit

Permalink
Merge pull request #224 from istresearch/develop into main
Browse files Browse the repository at this point in the history
v4.0.12.8
  • Loading branch information
baracudda authored Feb 23, 2022
2 parents 939277d + 758a37a commit 0748780
Show file tree
Hide file tree
Showing 24 changed files with 3,162 additions and 168 deletions.
15 changes: 12 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ jobs:
VERSION_TAG="ci-${VERSION_STR}-${BRANCH}"
fi
echo ${VERSION_TAG} > scm/version_tag.txt
echo "Using tag: ${VERSION_TAG}"
- run:
name: Ensure PyApp Image Exists, building if necessary
command: |
Expand All @@ -49,7 +50,10 @@ jobs:
name: Build "Default Branding" Image
command: |
VERSION_TAG=$(cat scm/version_tag.txt)
source scm/utils-engage.sh; BuildVersionForRp "$VERSION_TAG"
# only build this if constructing a tag version
if [[ ! -z $CIRCLE_TAG ]]; then
source scm/utils-engage.sh; BuildVersionForRp "$VERSION_TAG"
fi
- run:
name: Build "Engage Branding" Image
command: |
Expand All @@ -66,7 +70,10 @@ jobs:
name: Build "Generic Branding" Image
command: |
VERSION_TAG=$(cat scm/version_tag.txt)
source scm/utils-engage.sh; BuildVersionForGeneric "${VERSION_TAG}-generic"
# only build this if constructing a tag version
if [[ ! -z $CIRCLE_TAG ]]; then
source scm/utils-engage.sh; BuildVersionForGeneric "${VERSION_TAG}-generic"
fi
deploy-dev-container:
docker:
Expand All @@ -92,16 +99,18 @@ jobs:
VERSION_TAG="ci-${VERSION_STR}-${BRANCH}"
fi
echo ${VERSION_TAG} > scm/version_tag.txt
echo "Using tag: ${VERSION_TAG}"
- run:
name: Deploy To K8s
command: |
VERSION_TAG=$(cat scm/version_tag.txt)
K8_URL=https://circleci.com/api/v1.1/project/github/$CIRCLE_PROJECT_USERNAME/p4-deploy/tree/develop
echo "Deploy to K8s: $CIRCLE_PROJECT_USERNAME/p4-engage:${VERSION_TAG}"
curl -XPOST --user "${oCI_API_TOKEN}:" \
--data build_parameters[CIRCLE_JOB]=eks_deploy \
--data build_parameters[DEPLOY_PROJECT]=pulse-engage \
--data build_parameters[DEPLOY_IMAGE]=$CIRCLE_PROJECT_USERNAME/p4-engage:${VERSION_TAG} \
$K8_URL
$K8_URL
workflows:
version: 2
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,7 @@ ansible/site.retry

# CircleCI artifacts
scm/*_tag.txt

_v*/

workspace/info/
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.0.12.7
4.0.12.8
12 changes: 8 additions & 4 deletions docker/Dockerfile.engage
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,17 @@ LABEL org.label-schema.name="Engage" \
ENV VERSION_TAG=$VERSION_TAG

# apply branding/overrides
COPY --chown=engage:engage docker/customizations/any /opt/rp
COPY --chown=engage:engage docker/customizations/engage /opt/rp
USER root
RUN rsync -a /opt/rp/ ./ && rm -R /opt/rp
USER engage

# compress static files
RUN mkdir -p static/sitestatic \
&& cp -fr static/brands static/sitestatic/brands \
&& source /venv/bin/activate; REDIS_URL=redis://redis DATABASE_URL=postgres://bla SECRET_KEY=123 python manage.py collectstatic --noinput --no-post-process \
&& source /venv/bin/activate; REDIS_URL=redis://redis DATABASE_URL=postgres://bla SECRET_KEY=123 python manage.py compress --extension='.haml' --force -v0
RUN echo "Collecting static files into one location..." \
&& source /venv/bin/activate; REDIS_URL=redis://redis DATABASE_URL=postgres://bla SECRET_KEY=123 \
python manage.py collectstatic --noinput --settings=temba.settings_collect_static \
&& echo "Collected, compressing..." \
&& source /venv/bin/activate; REDIS_URL=redis://redis DATABASE_URL=postgres://bla SECRET_KEY=123 \
python manage.py compress --extension='.haml' --force -v0 --settings=temba.settings_compress_static \
&& echo "Done"
1 change: 1 addition & 0 deletions docker/Dockerfile.generic
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ LABEL org.label-schema.name="Engage" \
WORKDIR /rapidpro

# apply branding/overrides
COPY --chown=engage:engage docker/customizations/any /opt/rp
COPY --chown=engage:engage docker/customizations/generic /opt/rp
USER root
RUN rsync -a /opt/rp/ ./ && rm -R /opt/rp
Expand Down
1 change: 1 addition & 0 deletions docker/Dockerfile.pygeos
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Alpine image with Python 3.9 as default python3 install
FROM node:12.22-alpine3.14

COPY docker/geolibs.sh /
Expand Down
4 changes: 3 additions & 1 deletion docker/Dockerfile.pylibs
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@ ENV PIP_RETRIES=$ARG_PIP_RETRIES \
PIP_EXTRA_INDEX_URL=$ARG_PIP_EXTRA_INDEX_URL \
LIBRARY_PATH=/lib:/usr/lib

USER root

ARG USER_PID
RUN addgroup engage; adduser -D -S -s /bin/false -u $USER_PID engage -g engage \
RUN grp=engage; usr=engage && addgroup -S $grp && adduser -u $USER_PID -S $usr -G $grp \
&& mkdir -p /rapidpro; chown -R engage:engage /rapidpro \
&& mkdir -p /venv; chown -R engage:engage /venv

Expand Down
1 change: 1 addition & 0 deletions docker/Dockerfile.rp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ LABEL org.label-schema.name="RapidPro" \
WORKDIR /rapidpro

# apply branding/overrides
COPY --chown=engage:engage docker/customizations/any /opt/rp
COPY --chown=engage:engage docker/customizations/rp /opt/rp
USER root
RUN rsync -a /opt/rp/ ./ && rm -R /opt/rp
Expand Down
Loading

0 comments on commit 0748780

Please sign in to comment.