Skip to content

Commit c903a20

Browse files
committed
feat: remove unnecessary volume and use WORKDIR instead
1 parent 32ee5ff commit c903a20

File tree

8 files changed

+55
-26
lines changed

8 files changed

+55
-26
lines changed

.dockerignore

-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
.git
21
codeship-*.yml
32
deployment.env
43
deployment.env.encrypted
5-
vendor/**
6-
!vendor/autoload.php
74
storage/app/public/**
85
storage/app/temp/**
96
storage/framework/cache/**

Makefile

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
build:
2+
cp -R -u -p -v ./.env.example ./.env
3+
docker-compose build
4+
5+
down:
6+
docker-compose down
7+
8+
up:
9+
docker-compose up -d
10+
docker-compose exec platform composer run compile
11+
12+
enter:
13+
docker-compose exec platform bash
14+
15+
pre-test:
16+
docker-compose exec platform composer run pre-test
17+
18+
test:
19+
docker-compose exec platform composer run test-dev
20+
21+
test-ci:
22+
docker-compose exec platform composer run test
23+
24+
cleanup:
25+
docker-compose exec platform composer run fixlint
26+
27+
down:
28+
docker-compose down
29+
30+
stop:
31+
docker-compose stop

codeship-services.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ build:
33
image: build
44
dockerfile_path: docker/build.Dockerfile
55
volumes:
6-
- .:/vols/src
7-
- ./tmp/out:/vols/out
6+
- .:/var/www
7+
- ./tmp/out:/tmp/out
88
cached: true
99
default_cache_branch: develop
1010

@@ -53,7 +53,7 @@ test/base: &_test_defaults
5353
build: &_test_build_defaults
5454
dockerfile_path: docker/test.Dockerfile
5555
volumes:
56-
- .:/vols/src
56+
- .:/var/www
5757
environment: &_test_env_defaults
5858
DB_PORT: 3306
5959
DB_DATABASE: ushahidi
@@ -95,14 +95,14 @@ test/php-7.3:
9595
aglio:
9696
image: humangeo/aglio
9797
volumes:
98-
- .:/vols/src
98+
- .:/var/www
9999

100100
awscli:
101101
build:
102102
image: awscli
103103
dockerfile_path: docker/awscli.Dockerfile
104104
volumes:
105-
- .:/vols/src
105+
- .:/var/www
106106
encrypted_env_file: deployment.env.encrypted
107107
cached: true
108108

codeship-steps.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
steps:
1818
- name: "Docs (develop)"
1919
service: aglio
20-
command: aglio -i /vols/src/docs/api/index.apib -o /vols/src/docs/api/index.html
20+
command: aglio -i /var/www/docs/api/index.apib -o /var/www/docs/api/index.html
2121
- name: "Deploy Docs (develop)"
2222
service: awscli
23-
command: aws s3 sync /vols/src/docs/ s3://preview.ushahidi.com/platform/develop --acl public-read
23+
command: aws s3 sync /var/www/docs/ s3://preview.ushahidi.com/platform/develop --acl public-read
2424

2525
- name: "Deployment director"
2626
service: deploy

docker-compose.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ services:
3939
- "80:8080"
4040
volumes:
4141
- storage-app-public:/var/www/storage/app/public
42-
- ./:/vols/src
42+
- .:/var/www
4343
platform_tasks:
4444
build: .
4545
environment:

docker/build.run.sh

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
#!/bin/bash
22

33
check_vols_src() {
4-
if [ ! -d /vols/src ]; then
5-
echo "No /vols/src with code"
4+
if [ ! -d /var/www ]; then
5+
echo "No /var/www with code"
66
exit 1
77
fi
88
}
99
check_vols_out() {
10-
if [ ! -d /vols/out ]; then
11-
echo "No /vols/out for output!"
10+
if [ ! -d /var/out ]; then
11+
echo "No /var/out for output!"
1212
exit 1
1313
fi
1414
}
@@ -27,7 +27,7 @@ function sync {
2727
echo "- vendor"
2828
echo "- tmp"
2929
} > /tmp/rsync_exclude
30-
rsync -ar --exclude-from=/tmp/rsync_exclude --delete-during /vols/src/ ./
30+
rsync -ar --exclude-from=/tmp/rsync_exclude --delete-during /var/www/ ./
3131
}
3232

3333
function run_composer_install {
@@ -37,7 +37,7 @@ function run_composer_install {
3737
function bundle {
3838
check_vols_out
3939
local version=${GITHUB_VERSION:-${CI_BRANCH:-v0.0.0}}
40-
DEST_DIR=/vols/out ./bin/release $version
40+
DEST_DIR=/var/out ./bin/release $version
4141
}
4242

4343
sync

docker/common.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ function copy_external_config() {
1717
}
1818

1919
function check_vols_src() {
20-
if [ ! -d /vols/src ]; then
21-
echo "No /vols/src with code"
20+
if [ ! -d /var/www ]; then
21+
echo "No /var/www with code"
2222
exit 1
2323
fi
2424
}
@@ -93,7 +93,7 @@ function sync {
9393
echo "- storage/passport/**"
9494
echo "- tmp"
9595
} > /tmp/rsync_exclude
96-
rsync -ar --exclude-from=/tmp/rsync_exclude --delete-during /vols/src/ ./
96+
rsync -ar --exclude-from=/tmp/rsync_exclude --delete-during /var/www/ ./
9797
rm -f phpunit.xml behat.yml phpspec.yml
9898
}
9999

src/DataSource/Console/ListCommand.php

+7-6
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,14 @@ public function __construct(\Ushahidi\DataSource\DataSourceManager $sources)
4646
protected function getSources()
4747
{
4848
if ($source = $this->option('source')) {
49-
$sources = [$source];
50-
} elseif ($this->option('all')) {
51-
$sources = $this->sources->getSources();
52-
} else {
53-
$sources = $this->sources->getEnabledSources();
49+
return [$source];
50+
}
51+
52+
if ($this->option('all')) {
53+
return $this->sources->getSources();
5454
}
55-
return $sources;
55+
56+
return $this->sources->getEnabledSources();
5657
}
5758

5859
public function handle()

0 commit comments

Comments
 (0)