Skip to content

Commit dcca447

Browse files
author
Circle CI Automated Builder
committed
Stylistic refactoring of Ruby code and added proxy support
1 parent 2fa0c2b commit dcca447

28 files changed

+327
-338
lines changed

.docker/nginx/Dockerfile

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
FROM nginx:alpine
2+
3+
COPY nginx.conf /etc/nginx/nginx.conf

.docker/nginx/nginx.conf

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#user nobody;
2+
worker_processes 1;
3+
4+
#error_log logs/error.log;
5+
#error_log logs/error.log notice;
6+
#error_log logs/error.log info;
7+
8+
#pid logs/nginx.pid;
9+
10+
11+
events {
12+
worker_connections 1024;
13+
}
14+
15+
16+
http {
17+
include mime.types;
18+
default_type application/octet-stream;
19+
20+
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
21+
'$status $body_bytes_sent "$http_referer" '
22+
'"$http_user_agent" "$http_x_forwarded_for"';
23+
24+
#access_log logs/access.log main;
25+
26+
27+
keepalive_timeout 600;
28+
proxy_connect_timeout 600;
29+
proxy_send_timeout 600;
30+
proxy_read_timeout 600;
31+
32+
server {
33+
listen 80;
34+
35+
location /confluence {
36+
proxy_set_header X-Forwarded-Host $host;
37+
proxy_set_header X-Forwarded-Server $host;
38+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
39+
proxy_pass http://container:8090/confluence;
40+
client_max_body_size 100M;
41+
}
42+
}
43+
}

.rspec

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
--color
22
--require spec_helper
33
--format documentation
4-
--fail-fast

.rubocop.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
AllCops:
2+
Exclude:
3+
- 'vendor/**/*'
4+
- 'spec/fixtures/**/*'
5+
- 'tmp/**/*'
6+
TargetRubyVersion: 2.2
7+
8+
9+
Metrics/LineLength:
10+
Enabled: false
11+
12+
Metrics/MethodLength:
13+
Enabled: false
14+
15+
Style/Documentation:
16+
Enabled: false
17+
18+
Style/AlignHash:
19+
Enabled: false
20+
21+
Style/AlignParameters:
22+
Enabled: false
23+
24+
Style/PredicateName:
25+
Enabled: false

.travis.yml

+1-3
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@ services:
66
- docker
77

88
before_install:
9-
- docker pull blacklabelops/nginx:latest
9+
- docker pull nginx:alpine
1010
- docker pull postgres:9.3
1111
- docker pull mysql:5.6
1212
- docker pull java:8
1313
- docker build .
14-
- travis_wait 30 &
15-

Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ RUN set -x \
3636
--delete "Server/Service/Engine/Host/@debug" \
3737
--delete "Server/Service/Engine/Host/Context/@debug" \
3838
"${CONF_INSTALL}/conf/server.xml" \
39-
&& touch -d "@0" "/opt/atlassian/confluence/conf/server.xml"
39+
&& touch -d "@0" "${CONF_INSTALL}/conf/server.xml"
4040

4141
# Use the default unprivileged account. This could be considered bad practice
4242
# on systems where multiple processes end up being executed by 'daemon' but
@@ -49,7 +49,7 @@ EXPOSE 8090
4949
# Set volume mount points for installation and home directory. Changes to the
5050
# home directory needs to be persisted as well as parts of the installation
5151
# directory due to eg. logs.
52-
VOLUME ["/var/atlassian/confluence"]
52+
VOLUME ["/var/atlassian/confluence", "/opt/atlassian/confluence/logs"]
5353

5454
# Set the default working directory as the Confluence home directory.
5555
WORKDIR /var/atlassian/confluence

Gemfile

+11-18
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,14 @@
11
source 'https://rubygems.org'
2-
# currently used ruby version
3-
ruby '2.2.3'
42

5-
group :test do
6-
gem 'rake'
7-
# libraries for acceptance testing
8-
gem 'rspec'
9-
gem 'serverspec'
10-
gem 'capybara'
11-
gem 'poltergeist'
12-
gem 'poltergeist-suppressor'
13-
# libraries for Docker
14-
gem 'docker-api', require: 'docker'
15-
gem 'archive-tar-minitar'
16-
gem 'rspec_junit_formatter'
3+
gem 'rake'
4+
gem 'rspec'
175

18-
gem 'pry'
19-
gem 'pry-rescue'
20-
gem 'byebug'
21-
end
6+
gem 'capybara'
7+
gem 'poltergeist'
8+
gem 'poltergeist-suppressor'
9+
10+
gem 'docker-api', require: 'docker'
11+
gem 'archive-tar-minitar'
12+
gem 'rspec_junit_formatter'
13+
14+
gem 'pry'

Gemfile.lock

+8-31
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,28 @@ GEM
33
specs:
44
archive-tar-minitar (0.5.2)
55
builder (3.2.2)
6-
byebug (8.2.1)
76
capybara (2.5.0)
87
mime-types (>= 1.16)
98
nokogiri (>= 1.3.3)
109
rack (>= 1.0.0)
1110
rack-test (>= 0.5.4)
1211
xpath (~> 2.0)
1312
cliver (0.3.2)
14-
coderay (1.1.0)
13+
coderay (1.1.1)
1514
diff-lcs (1.2.5)
16-
docker-api (1.24.1)
15+
docker-api (1.23.0)
1716
excon (>= 0.38.0)
1817
json
1918
excon (0.45.4)
20-
interception (0.5)
2119
json (1.8.3)
2220
method_source (0.8.2)
2321
mime-types (3.0)
2422
mime-types-data (~> 3.2015)
2523
mime-types-data (3.2015.1120)
26-
mini_portile2 (2.0.0)
24+
mini_portile (0.6.2)
2725
multi_json (1.11.2)
28-
net-scp (1.2.1)
29-
net-ssh (>= 2.6.5)
30-
net-ssh (2.9.2)
31-
net-telnet (0.1.1)
32-
nokogiri (1.6.7)
33-
mini_portile2 (~> 2.0.0.rc2)
26+
nokogiri (1.6.6.4)
27+
mini_portile (~> 0.6.0)
3428
poltergeist (1.8.1)
3529
capybara (~> 2.1)
3630
cliver (~> 0.3.1)
@@ -43,9 +37,6 @@ GEM
4337
coderay (~> 1.1.0)
4438
method_source (~> 0.8.1)
4539
slop (~> 3.4)
46-
pry-rescue (1.4.2)
47-
interception (>= 0.5)
48-
pry
4940
rack (1.6.4)
5041
rack-test (0.6.3)
5142
rack (>= 1.0)
@@ -59,28 +50,14 @@ GEM
5950
rspec-expectations (3.4.0)
6051
diff-lcs (>= 1.2.0, < 2.0)
6152
rspec-support (~> 3.4.0)
62-
rspec-its (1.2.0)
63-
rspec-core (>= 3.0.0)
64-
rspec-expectations (>= 3.0.0)
6553
rspec-mocks (3.4.0)
6654
diff-lcs (>= 1.2.0, < 2.0)
6755
rspec-support (~> 3.4.0)
6856
rspec-support (3.4.1)
6957
rspec_junit_formatter (0.2.3)
7058
builder (< 4)
7159
rspec-core (>= 2, < 4, != 2.12.0)
72-
serverspec (2.24.3)
73-
multi_json
74-
rspec (~> 3.0)
75-
rspec-its
76-
specinfra (~> 2.43)
77-
sfl (2.2)
7860
slop (3.6.0)
79-
specinfra (2.44.6)
80-
net-scp
81-
net-ssh (~> 2.7)
82-
net-telnet
83-
sfl
8461
websocket-driver (0.6.3)
8562
websocket-extensions (>= 0.1.0)
8663
websocket-extensions (0.1.2)
@@ -92,14 +69,14 @@ PLATFORMS
9269

9370
DEPENDENCIES
9471
archive-tar-minitar
95-
byebug
9672
capybara
9773
docker-api
9874
poltergeist
9975
poltergeist-suppressor
10076
pry
101-
pry-rescue
10277
rake
10378
rspec
10479
rspec_junit_formatter
105-
serverspec
80+
81+
BUNDLED WITH
82+
1.11.2

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2015 Martin Aksel Jensen <[email protected]>
3+
Copyright (c) 2016 Martin Aksel Jensen, [email protected]
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

-35
This file was deleted.

bin/deploy

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22

33
# Prepare Git committer information
4-
git config user.email "circleci@circleci"
4+
git config user.email "[email protected]"
55
git config user.name "Circle CI Automated Builder"
66

77
# Obtain the currently latest version of Atlassian Confluence version defined by the

circle.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ machine:
66

77
dependencies:
88
pre:
9-
- docker pull blacklabelops/nginx:latest
9+
- docker pull nginx:alpine
1010
- docker pull postgres:9.3
1111
- docker pull mysql:5.6
12-
- docker pull java:8
12+
- docker pull java:7
1313
- docker build .
1414

1515
test:

spec/acceptance/000_docker_spec.rb

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
require 'docker'
2-
require 'spec_helper'
3-
41
describe 'Docker image building' do
52
context 'when validating host software' do
63
it 'should supported version' do
@@ -15,7 +12,7 @@
1512
it { is_expected.to have_exposed_port tcp: 8090 }
1613
it { is_expected.to_not have_exposed_port udp: 8090 }
1714
it { is_expected.to have_volume '/var/atlassian/confluence' }
18-
it { is_expected.not_to have_volume '/opt/atlassian/confluence' }
15+
it { is_expected.to have_volume '/opt/atlassian/confluence/logs' }
1916
it { is_expected.to have_working_directory '/var/atlassian/confluence' }
2017
end
2118
end

0 commit comments

Comments
 (0)