-
Notifications
You must be signed in to change notification settings - Fork 3
/
integration_test.sh
executable file
·116 lines (105 loc) · 5.44 KB
/
integration_test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#!/bin/bash
set -o errexit
set -o pipefail
set -o nounset
readonly CWD="$(pwd)"
readonly TESTS_DIR="tests"
function git_clone() {
local git_url="$1"
git clone --quiet --depth 1 "$git_url"
}
function git_named_clone() {
local git_url="$1"
local dir="$2"
git clone --quiet --depth 1 "$git_url" "$dir"
}
function clone_repos() {
rm -rf "$TESTS_DIR" && mkdir -p "$TESTS_DIR" && cd "$TESTS_DIR"
# offical docker images
git_clone https://github.com/docker-library/ruby.git &
git_clone https://github.com/docker-library/mariadb.git &
git_clone https://github.com/docker-library/ghost.git &
git_clone https://github.com/docker-library/redis.git &
git_clone https://github.com/docker-library/python.git &
git_clone https://github.com/docker-library/buildpack-deps.git &
git_clone https://github.com/docker-library/postgres.git &
git_clone https://github.com/docker-library/rabbitmq.git &
git_clone https://github.com/docker-library/redmine.git &
git_clone https://github.com/docker-library/mysql.git &
git_clone https://github.com/docker-library/golang.git &
git_clone https://github.com/docker-library/drupal.git &
git_clone https://github.com/docker-library/haproxy.git &
git_clone https://github.com/docker-library/elasticsearch.git &
git_clone https://github.com/docker-library/kibana.git &
git_clone https://github.com/docker-library/php.git &
git_clone https://github.com/docker-library/mongo.git &
git_clone https://github.com/docker-library/gcc.git &
git_clone https://github.com/docker-library/httpd.git &
git_clone https://github.com/docker-library/java.git &
git_clone https://github.com/docker-library/wordpress.git &
git_clone https://github.com/docker-library/tomcat.git &
git_clone https://github.com/docker-library/logstash.git &
git_clone https://github.com/docker-library/julia.git &
git_clone https://github.com/docker-library/busybox.git &
git_clone https://github.com/docker-library/percona.git &
git_clone https://github.com/docker-library/django.git &
git_clone https://github.com/docker-library/memcached.git &
git_clone https://github.com/docker-library/docker.git &
git_clone https://github.com/docker-library/rails.git &
git_clone https://github.com/docker-library/pypy.git &
git_clone https://github.com/docker-library/hello-world.git &
git_clone https://github.com/docker-library/celery.git &
git_clone https://github.com/nodejs/docker-node.git &
git_clone https://github.com/nginxinc/docker-nginx.git &
# popular Dockerfile repos
git_clone https://github.com/wking/dockerfile.git &
git_clone https://github.com/eugeneware/docker-wordpress-nginx.git &
git_clone https://github.com/CentOS/CentOS-Dockerfiles.git &
git_clone https://github.com/octohost/octohost.git &
git_clone https://github.com/komljen/dockerfile-examples.git &
git_clone https://github.com/tianon/dockerfiles.git &
git_clone https://github.com/Netflix-Skunkworks/zerotodocker.git &
git_clone https://github.com/amplab/docker-scripts.git &
git_clone https://github.com/oracle/docker-images.git &
git_clone https://github.com/dockerfile/ubuntu-desktop.git &
git_clone https://github.com/yesnault/docker-phabricator.git &
git_clone https://github.com/mattgruter/dockerfile-guacamole.git &
git_clone https://github.com/uzyexe/dockerfile-terraform.git &
git_clone https://github.com/mattgruter/dockerfile-doubledocker.git &
git_clone https://github.com/mattgruter/dockerfile-drone.git &
git_clone https://github.com/ArchiveTeam/warrior-dockerfile.git &
git_clone https://github.com/wckr/wocker-dockerfile.git &
git_clone https://github.com/kartoza/docker-postgis.git &
# colliding names
git_named_clone https://github.com/yaronr/dockerfile.git yaronr-dockerfile &
git_named_clone https://github.com/seapy/dockerfiles.git seapy-dockerfiles &
git_named_clone https://github.com/nickstenning/dockerfiles.git nickstenning-dockerfiles &
git_named_clone https://github.com/crosbymichael/Dockerfiles.git crosbymichael-dockerfiles &
git_named_clone https://github.com/SvenDowideit/dockerfiles.git svendowideit-dockerfiles &
git_named_clone https://github.com/codenvy/dockerfiles.git codenvy-dockerfiles &
git_named_clone https://github.com/couchbase/docker.git couchbase-docker &
git_named_clone https://github.com/EvaEngine/Dockerfiles.git evaengine-dockerfiles &
git_named_clone https://github.com/yankcrime/dockerfiles.git yankcrime-dockerfiles &
git_named_clone https://github.com/voxxit/dockerfiles.git voxxit-dockerfiles &
git_named_clone https://github.com/mikz/dockerfiles.git mikz-dockerfiles &
git_named_clone https://github.com/ksoichiro/dockerfiles.git ksoichiro-dockerfiles &
git_named_clone https://github.com/jgautheron/dockerfiles.git jgautheron-dockerfiles &
git_named_clone https://github.com/coderstephen/dockerfiles.git coderstephen-dockerfiles &
git_named_clone https://github.com/ehazlett/dockerfiles.git ehazlett-dockerfiles &
git_named_clone https://github.com/Evlos/dockerfile.git evlos-dockerfile &
wait
cd "$CWD"
}
function lint_dockerfiles() {
stack install
local hadolint_bin="hadolint"
local dockerfiles=$(find . -name 'Dockerfile')
for dockerfile in $dockerfiles; do
$hadolint_bin "$dockerfile" | awk "{print \"$dockerfile \" \$0}" || true
done
}
function main() {
clone_repos
lint_dockerfiles
}
main