forked from m4ce/docker-puppet_forge_server
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from coi-gov-pl/feature/using-bundler-with-coi-…
…fork Use the latest version of puppet-forge-server gem
- Loading branch information
Showing
7 changed files
with
108 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
sudo: required | ||
language: ruby | ||
services: | ||
- docker | ||
script: rake |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,27 @@ | ||
# | ||
# Dockerfile | ||
# | ||
# Author: Matteo Cerutti <[email protected]> | ||
# | ||
|
||
FROM centos:7 | ||
MAINTAINER Matteo Cerutti <[email protected]> | ||
MAINTAINER Krzysztof Suszyński <[email protected]> | ||
|
||
ENV PUPPET_FORGE_SERVER_USER forge | ||
ENV PUPPET_FORGE_SERVER_USER_ID 576 | ||
ENV PUPPET_FORGE_SERVER_RACK puma | ||
ENV PUPPET_FORGE_SERVER_VERSION '-v 1.8.0' | ||
ENV PUPPET_FORGE_SERVER_BASEDIR /srv/puppet-forge-server | ||
|
||
RUN yum install gcc make ruby-devel rubygems -y | ||
RUN yum install gcc make ruby-devel -y | ||
|
||
# Needed to fetch dependencies | ||
RUN echo ':ssl_verify_mode: 0' > ~/.gemrc | ||
RUN gem install puppet-forge-server $PUPPET_FORGE_SERVER_VERSION | ||
RUN gem install $PUPPET_FORGE_SERVER_RACK | ||
RUN gem install bundler | ||
RUN useradd --system --create-home --uid $PUPPET_FORGE_SERVER_USER_ID --home-dir $PUPPET_FORGE_SERVER_BASEDIR $PUPPET_FORGE_SERVER_USER | ||
|
||
ADD run.sh /run.sh | ||
COPY src/Gemfile Gemfile | ||
COPY src/Gemfile.lock Gemfile.lock | ||
RUN bundle --retry=3 | ||
|
||
WORKDIR $PUPPET_FORGE_SERVER_BASEDIR | ||
USER $PUPPET_FORGE_SERVER_USER | ||
|
||
COPY src/run.sh /run.sh | ||
|
||
ENTRYPOINT ["/run.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,4 +32,6 @@ docker run -d --restart=always -p 8080:8080 \ | |
``` | ||
|
||
## Contact | ||
Matteo Cerutti - [email protected] | ||
Centralny Osrodek Informatyki - [email protected] | ||
|
||
Original version created by Matteo Cerutti - [email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
desc 'Cleans produced image' | ||
task :clean do | ||
sh 'docker rmi -f coigovpl/puppet-forge-server || true' | ||
sh 'docker images -q --filter "dangling=true" | xargs docker rmi || true' | ||
end | ||
|
||
desc 'Builds an image' | ||
task :build do | ||
sh 'docker build -t coigovpl/puppet-forge-server .' | ||
end | ||
|
||
task :default => [:clean, :build] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
source 'https://rubygems.org' | ||
|
||
# Lock Ruby version to default centos-7 | ||
ruby '~> 2.0.0' | ||
|
||
gem 'puppet-forge-server' | ||
gem 'puma' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
GEM | ||
remote: https://rubygems.org/ | ||
specs: | ||
PriorityQueue (0.1.2) | ||
backports (3.11.1) | ||
deep_merge (1.2.1) | ||
haml (4.0.7) | ||
tilt | ||
iconv (1.0.5) | ||
json (1.8.6) | ||
logger-colors (1.0.0) | ||
lrucache (0.1.4) | ||
PriorityQueue (~> 0.1.2) | ||
multi_json (1.13.1) | ||
multipart-post (2.0.0) | ||
open4 (1.3.4) | ||
open_uri_redirections (0.2.1) | ||
puma (3.11.2) | ||
puppet-forge-server (1.10.1) | ||
deep_merge (~> 1.0) | ||
haml (~> 4.0) | ||
iconv (~> 1.0.4) | ||
json (~> 1.8) | ||
logger-colors (~> 1.0) | ||
lrucache (~> 0.1.4) | ||
multipart-post (~> 2.0.0) | ||
open4 (~> 1.3) | ||
open_uri_redirections (~> 0.1) | ||
rack (= 1.5.5) | ||
rack-mount (~> 0.8) | ||
redcarpet (~> 3.3.0) | ||
sinatra (~> 1.4) | ||
sinatra-contrib (~> 1.4) | ||
rack (1.5.5) | ||
rack-mount (0.8.3) | ||
rack (>= 1.0.0) | ||
rack-protection (1.5.3) | ||
rack | ||
rack-test (0.7.0) | ||
rack (>= 1.0, < 3) | ||
redcarpet (3.3.4) | ||
sinatra (1.4.8) | ||
rack (~> 1.5) | ||
rack-protection (~> 1.4) | ||
tilt (>= 1.3, < 3) | ||
sinatra-contrib (1.4.7) | ||
backports (>= 2.0) | ||
multi_json | ||
rack-protection | ||
rack-test | ||
sinatra (~> 1.4.0) | ||
tilt (>= 1.3, < 3) | ||
tilt (2.0.8) | ||
|
||
PLATFORMS | ||
ruby | ||
|
||
DEPENDENCIES | ||
puma | ||
puppet-forge-server | ||
|
||
RUBY VERSION | ||
ruby 2.0.0p648 | ||
|
||
BUNDLED WITH | ||
1.16.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,8 @@ | |
# Author: Matteo Cerutti <[email protected]> | ||
# | ||
|
||
PUPPET_FORGE_SERVER_CACHE_SIZE=${PUPPET_FORGE_SERVER_CACHE_SIZE:-250} | ||
PUPPET_FORGE_SERVER_CACHE_TTL=${PUPPET_FORGE_SERVER_CACHE_TTL:-1800} | ||
PUPPET_FORGE_SERVER_PORT=${PUPPET_FORGE_SERVER_PORT:-8080} | ||
PUPPET_FORGE_SERVER_USER=${PUPPET_FORGE_SERVER_USER:-$(whoami)} | ||
homedir=$( getent passwd "${PUPPET_FORGE_SERVER_USER}" | cut -d: -f6 ) | ||
|
@@ -33,8 +35,10 @@ mkdir -p $PUPPET_FORGE_SERVER_CACHE_DIR | |
mkdir -p $PUPPET_FORGE_SERVER_LOG_DIR | ||
|
||
echo "Starting puppet-forge-server" | ||
exec puppet-forge-server \ | ||
exec bundle exec puppet-forge-server \ | ||
--port $PUPPET_FORGE_SERVER_PORT \ | ||
--cache-basedir $PUPPET_FORGE_SERVER_CACHE_DIR \ | ||
--ram-cache-ttl $PUPPET_FORGE_SERVER_CACHE_TTL \ | ||
--ram-cache-size $PUPPET_FORGE_SERVER_CACHE_SIZE \ | ||
--log-dir $PUPPET_FORGE_SERVER_LOG_DIR \ | ||
$PUPPET_FORGE_SERVER_OPTS |