Skip to content

Commit

Permalink
merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
eessex committed Mar 30, 2020
2 parents 8e0db99 + 8b21a3b commit 23c5b43
Show file tree
Hide file tree
Showing 10 changed files with 293 additions and 179 deletions.
11 changes: 11 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,19 @@ only_master: &only_master
branches:
only: master

only_release: &only_release
context: hokusai
filters:
branches:
only: release

workflows:
build-deploy:
jobs:
- hokusai/test:
<<: *not_staging

# Staging
- hokusai/push:
name: push-staging-image
<<: *only_master
Expand All @@ -32,3 +39,7 @@ workflows:
project-name: horizon
requires:
- push-staging-image

# Release
- hokusai/deploy-production:
<<: *only_release
58 changes: 28 additions & 30 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,33 +1,30 @@
FROM ruby:2.6.0
FROM ruby:2.6.0-alpine
ENV LANG C.UTF-8
ENV PORT 3000
EXPOSE 3000

# Needed to install npm/yarn
RUN curl -sL https://deb.nodesource.com/setup_11.x | bash
WORKDIR /app

RUN apt-get update -qq && \
apt-get install -y nodejs nginx python-pip dumb-init && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN apk update && apk --no-cache --quiet add \
build-base \
dumb-init \
nodejs \
postgresql-dev \
postgresql-client \
python2-dev \
py-pip \
tzdata \
yarn \
git && \
adduser -D -g '' deploy

# support hokusai registry commands
RUN pip install --no-cache-dir hokusai

RUN npm install -g yarn

# Set up nginx
RUN rm -v /etc/nginx/nginx.conf
ADD config/nginx.conf /etc/nginx/
ADD config/app.conf /etc/nginx/conf.d/

RUN ln -sf /dev/stdout /var/log/nginx/access.log && \
ln -sf /dev/stderr /var/log/nginx/error.log
RUN pip install --upgrade --no-cache-dir hokusai

RUN gem install bundler -v '<2'
# RUN npm install -g yarn

# throw errors if Gemfile has been modified since Gemfile.lock
RUN bundle config --global frozen 1

# Set up working directory
RUN mkdir /app
RUN gem install bundler -v '<2' && \
bundle config --global frozen 1

# Set up gems and packages
WORKDIR /tmp
Expand All @@ -39,14 +36,15 @@ COPY Gemfile \
RUN bundle install -j4 && \
yarn install --check-files

# Finally, add the rest of our app's code
# (this is done at the end so that changes to our app's code
# don't bust Docker's cache)
ADD . /app
WORKDIR /app
# Copy application code
COPY . ./

# Precompile Rails assets
RUN bundle exec rake assets:precompile
RUN bundle exec rake assets:precompile && \
chown -R deploy:deploy ./

# Switch to less privelidged user
USER deploy

ENTRYPOINT ["/usr/bin/dumb-init", "--"]
CMD nginx && bundle exec puma -C config/puma.rb
CMD ["bundle", "exec", "puma", "-C", "config/puma.rb"]
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ Horizon [![CircleCI](https://circleci.com/gh/artsy/horizon.svg?style=svg)](https

Visual representations of release pipelines.

* State: internal usage
* Staging (only): [releases.artsy.net](https://releases.artsy.net) (admin dashboard: [https://releases.artsy.net/admin](https://releases.artsy.net/admin))
* GitHub: https://github.com/artsy/horizon
* Point Team: [Platform](https://artsy.slack.com/messages/product-platform)
* Deployment: builds of the `master` branch are automatically deployed to staging by CircleCI. **There is no production environment.**
* **State:** Internal usage
* **Production:** [https://releases.artsy.net](https://releases.artsy.net) | [k8s](https://kubernetes.artsy.net/#!/search?q=horizon&namespace=default)
* **Staging:** [https://releases-staging.artsy.net](https://releases-staging.artsy.net) | [k8s](https://kubernetes-staging.artsy.net/#!/search?q=horizon&namespace=default)
* **GitHub:** https://github.com/artsy/horizon
* **CI/Deploys:** [CircleCi](https://circleci.com/gh/artsy/horizon); merged PRs to `artsy/horizon#master` are automatically deployed to staging; PRs from `staging` to `release` are automatically deployed to production. [Start a deploy...](https://github.com/artsy/horizon/compare/release...staging?expand=1)
* **Point Team:** [Platform](https://artsy.slack.com/messages/product-platform)

Quick links
---
Expand Down
23 changes: 0 additions & 23 deletions config/nginx.conf

This file was deleted.

4 changes: 3 additions & 1 deletion hokusai/config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
---
project-name: horizon
pre-deploy: "rake db:migrate"
hokusai-required-version: "~=0.5"
pre-deploy: "bundle exec rake db:migrate"
git-remote: git@github.com:artsy/horizon.git
6 changes: 3 additions & 3 deletions hokusai/development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
version: "2"
services:
horizon:
depends_on:
- horizon-redis
- horizon-postgres
environment:
- RAILS_ENV=development
- RAILS_LOG_TO_STDOUT=true
Expand All @@ -19,6 +16,9 @@ services:
- 8443:8443
volumes:
- ../:/app
depends_on:
- horizon-postgres
- horizon-redis
horizon-postgres:
image: postgres:9.5
environment:
Expand Down
Loading

0 comments on commit 23c5b43

Please sign in to comment.