Skip to content

Commit

Permalink
Merge pull request #233 from CodeForPhilly/develop
Browse files Browse the repository at this point in the history
Release: v3.0.2
  • Loading branch information
themightychris authored Aug 25, 2021
2 parents 04c42d2 + 5054f3f commit ec874b0
Show file tree
Hide file tree
Showing 10 changed files with 110 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/release-prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches: [ develop ]

env:
GITHUB_USERNAME: codeforphilly-bot
GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}
RELEASE_BRANCH: releases/v3

Expand Down Expand Up @@ -42,7 +43,7 @@ jobs:
if [ -n "${pr_number}" ]; then
echo "Updating PR #${pr_number}"
existing_comment_id=$(hub api "/repos/${GITHUB_REPOSITORY}/issues/${pr_number}/comments" | jq '.[] | select(.user.login=="jarvus-bot") | .id')
existing_comment_id=$(hub api "/repos/${GITHUB_REPOSITORY}/issues/${pr_number}/comments" | jq ".[] | select(.user.login==\"${GITHUB_USERNAME}\") | .id")
else
echo "Opening PR"
hub pull-request -b "${RELEASE_BRANCH}" -h develop -F <(echo "${pr_body}") > /tmp/pr.json
Expand Down
3 changes: 3 additions & 0 deletions .holo/branches/docs-skeleton.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[holobranch]
extend = "docs-site"
lens = false
4 changes: 4 additions & 0 deletions .holo/branches/fixtures/_skeleton-v2.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[holomapping]
holosource="=>fixtures"
files = "**"
before = "*"
4 changes: 4 additions & 0 deletions .holo/branches/helm-chart/_skeleton-v2.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[holomapping]
holosource="=>helm-chart"
files = "**"
before = "*"
2 changes: 1 addition & 1 deletion .holo/sources/skeleton-v2.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[holosource]
url = "https://github.com/JarvusInnovations/emergence-skeleton-v2"
ref = "refs/tags/v2.6.12"
ref = "refs/tags/v2.7.0"
74 changes: 74 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# This Dockerfile is hyper-optimized to minimize layer changes

FROM jarvus/habitat-compose:latest as habitat

ARG HAB_LICENSE=no-accept
ENV HAB_LICENSE=$HAB_LICENSE
ENV STUDIO_TYPE=Dockerfile
ENV HAB_ORIGIN=codeforphilly
RUN hab origin key generate

# pre-layer all external runtime plan deps
COPY habitat/plan.sh /habitat/plan.sh
RUN hab pkg install \
core/bash \
emergence/php-runtime \
$({ cat '/habitat/plan.sh' && echo && echo 'echo "${pkg_deps[@]/$pkg_origin\/*/}"'; } | hab pkg exec core/bash bash) \
&& hab pkg exec core/coreutils rm -rf /hab/cache/{artifacts,src}/

# pre-layer all external runtime composite deps
COPY habitat/composite/plan.sh /habitat/composite/plan.sh
RUN hab pkg install \
jarvus/habitat-compose \
emergence/nginx \
$({ cat '/habitat/composite/plan.sh' && echo && echo 'echo "${pkg_deps[@]/$pkg_origin\/*/} ${composite_mysql_pkg}"'; } | hab pkg exec core/bash bash) \
&& hab pkg exec core/coreutils rm -rf /hab/cache/{artifacts,src}/


FROM habitat as projector

# pre-layer all build-time plan deps
RUN hab pkg install \
core/hab-plan-build \
jarvus/hologit \
jarvus/toml-merge \
$({ cat '/habitat/plan.sh' && echo && echo 'echo "${pkg_build_deps[@]/$pkg_origin\/*/}"'; } | hab pkg exec core/bash bash) \
&& hab pkg exec core/coreutils rm -rf /hab/cache/{artifacts,src}/

# pre-layer all build-time composite deps
RUN hab pkg install \
jarvus/toml-merge \
$({ cat '/habitat/composite/plan.sh' && echo && echo 'echo "${pkg_build_deps[@]/$pkg_origin\/*/}"'; } | hab pkg exec core/bash bash) \
&& hab pkg exec core/coreutils rm -rf /hab/cache/{artifacts,src}/

# build application
COPY . /src
ARG SITE_TREE
ENV SITE_TREE=$SITE_TREE
ARG SITE_VERSION
ENV SITE_VERSION=$SITE_VERSION
RUN hab pkg exec core/hab-plan-build hab-plan-build /src
RUN hab pkg exec core/hab-plan-build hab-plan-build /src/habitat/composite


FROM habitat as runtime

# configure persistent volumes
RUN hab pkg exec core/coreutils mkdir -p '/hab/svc/mysql/data' '/hab/svc/laddr/data' '/hab/svc/nginx/files' \
&& hab pkg exec core/coreutils chown hab:hab -R '/hab/svc/mysql/data' '/hab/svc/laddr/data' '/hab/svc/nginx/files'

# configure entrypoint
VOLUME ["/hab/svc/mysql/data", "/hab/svc/laddr/data", "/hab/svc/nginx/files"]
ENTRYPOINT ["hab", "sup", "run"]
CMD ["codeforphilly/laddr-composite"]

# install .hart artifact from builder stage
COPY --from=projector /hab/cache/artifacts/$HAB_ORIGIN-* /hab/cache/artifacts/
RUN hab pkg install /hab/cache/artifacts/$HAB_ORIGIN-* \
&& hab pkg exec core/coreutils rm -rf /hab/cache/{artifacts,src}/

# add source metadata to environment
ARG SOURCE_TAG
ENV SOURCE_TAG=$SOURCE_TAG
ARG SOURCE_COMMIT
ENV SOURCE_COMMIT=$SOURCE_COMMIT
2 changes: 2 additions & 0 deletions habitat/composite/default.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[services.app.config]
default_timezone = "America/New_York"
10 changes: 10 additions & 0 deletions habitat/composite/plan.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
composite_app_pkg_name=laddr
pkg_name="${composite_app_pkg_name}-composite"
pkg_origin=codeforphilly
pkg_maintainer="Code for Philly <[email protected]>"
pkg_scaffolding=emergence/scaffolding-composite
composite_mysql_pkg=core/mysql

pkg_version() {
scaffolding_detect_pkg_version
}
2 changes: 2 additions & 0 deletions habitat/default.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[sites.default]
database = "laddr"
8 changes: 8 additions & 0 deletions habitat/plan.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
pkg_name=laddr
pkg_origin=codeforphilly
pkg_maintainer="Code for Philly <[email protected]>"
pkg_scaffolding=emergence/scaffolding-site

pkg_version() {
scaffolding_detect_pkg_version
}

0 comments on commit ec874b0

Please sign in to comment.