Skip to content

Commit

Permalink
Merge pull request #178 from mlibrary/ci
Browse files Browse the repository at this point in the history
continuous integration
  • Loading branch information
gkostin1966 authored Mar 21, 2023
2 parents 6192cd4 + 6fe1551 commit 4cc39d0
Show file tree
Hide file tree
Showing 190 changed files with 67,823 additions and 1,846 deletions.
22 changes: 22 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Ignore everything
*

# Except
!/app
!/bin
!/config
!/data
!/indexer
!/lib
!/log/.keep
!/public
!/solr/dromedary
!/spec
!/test
!/tmp/.keep
!/vendor
config.ru
Gemfile
Gemfile.lock
package.json
Rakefile
10 changes: 6 additions & 4 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ on:

env:
RAILS_ENV: "test"
DATABASE_URL: "postgresql://postgres:[email protected]:5432/umich-arclight-test"
SOLR_URL: "http://127.0.0.1:8983/solr/umich-arclight-test"
DATABASE_URL: "postgresql://postgres:[email protected]:5432/dromedary-test"
SOLR_URL: "http://127.0.0.1:9639/solr/dromedary-test"

jobs:
ci:
Expand Down Expand Up @@ -41,11 +41,13 @@ jobs:
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
env:
BUNDLE_RUBYGEMS__PKG__GITHUB__COM: ${{secrets.GH_PACKAGE_READ_TOKEN}}
- name: Run Solr (and create core)
run: docker run -d -p 8983:8983 -v $(pwd)/solr/arclight:/umich-arclight:ro solr:8 solr-precreate umich-arclight-test /umich-arclight
run: docker run -d -p 9639:8983 -v $(pwd)/solr/dromedary:/dromedary:ro ghcr.io/mlibrary/dromedary/dromedary-solr:latest solr-precreate dromedary-test /dromedary
- name: Yarn Install
run: yarn install
- name: Setup Database (db:setup)
run: bundle exec rake db:setup
- name: Continuous Integration (standard rb, rubocop, test, spec)
- name: Continuous Integration (standard, spec)
run: bundle exec rake
38 changes: 6 additions & 32 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,35 +1,9 @@
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
#
# If you find yourself ignoring temporary files generated by your text editor
# or operating system, you probably want to add a global ignore instead:
# git config --global core.excludesfile '~/.gitignore_global'

# Skip IntelliJ stuff
/.idea/*
*.iml

# Don't do the solr data or core.properties
/solr/med/data
/solr/med/conf/data
/solr/med/core.properties
/.solr

# Or local data
/data

# Ignore bundler config.
/.bundle

# We don't use a database.
/db

# Ignore all logfiles and tempfiles.
/log/*
/tmp/*
!/log/.keep
!/tmp/.keep

/.cache
/data
/db/*.sqlite3
/log
/node_modules
/yarn-error.log

**/tmp
!**/.keep
.byebug_history
1 change: 0 additions & 1 deletion .ruby-version

This file was deleted.

5 changes: 5 additions & 0 deletions .yarnrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1


lastUpdateCheck 1679078185494
41 changes: 25 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,36 @@
FROM ruby:2.6
FROM ruby:2.7

ARG UNAME=app
ARG UID=1000
ARG GID=1000
ARG ARCH=amd64

ENV BUNDLE_PATH /var/opt/app/gems
ENV RAILS_LOG_TO_STDOUT true

RUN curl https://deb.nodesource.com/setup_12.x | bash
RUN curl https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list

RUN apt-get update -yqq && \
apt-get install -yqq --no-install-recommends \
apt-transport-https
RUN gem install 'bundler:~>1.17.3' 'bundler:~>2.0.2'
vim nodejs yarn apt-transport-https

RUN groupadd -g $GID -o $UNAME
RUN useradd -m -d /usr/src/app -u $UID -g $GID -o -s /bin/bash $UNAME
RUN mkdir -p /gems && chown $UID:$GID /gems
RUN useradd -m -d /opt/app -u $UID -g $GID -o -s /bin/bash $UNAME
RUN mkdir /var/opt/app
RUN mkdir /var/opt/app/data
RUN mkdir /var/opt/app/gems
RUN chown $UID:$GID /var/opt/app
RUN chown $UID:$GID /var/opt/app/data
RUN touch $UID:$GID /var/opt/app/data/.keep
RUN chown $UID:$GID /var/opt/app/gems
RUN touch $UID:$GID /var/opt/app/gems/.keep
COPY --chown=$UID:$GID . /opt/app

USER $UNAME
COPY --chown=$UID:$GID Gemfile* /usr/src/app/

ENV RAILS_LOG_TO_STDOUT true
ENV BUNDLE_PATH /gems

WORKDIR /usr/src/app
RUN bundle install

COPY --chown=$UID:$GID . /usr/src/app
WORKDIR /opt/app
RUN gem install 'bundler:~>2.2.21'
RUN bundle config --local build.sassc --disable-march-tune-native

ENTRYPOINT ["./docker-entrypoint.sh"]
CMD ["bin/rails", "s", "-b", "0.0.0.0"]
CMD ["sleep", "infinity"]
32 changes: 0 additions & 32 deletions Dockerfile.prod

This file was deleted.

Loading

0 comments on commit 4cc39d0

Please sign in to comment.