-
Notifications
You must be signed in to change notification settings - Fork 25.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RFC: Proposal to replace fixtures with docker-compose #35651
Changes from 3 commits
bbc57cc
268665a
4416463
0623db7
a232329
b8db838
1c009ca
7f52fe3
9bd8e55
df045ef
d18603d
1306d8f
4bc31ba
06f606b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
FROM ubuntu:16.04 | ||
ADD . /fixture | ||
RUN chmod +x /fixture/src/main/resources/provision/installsmb.sh | ||
|
||
EXPOSE 389 | ||
EXPOSE 636 | ||
EXPOSE 3268 | ||
EXPOSE 3269 | ||
|
||
CMD /fixture/src/main/resources/provision/installsmb.sh | ||
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,34 @@ | ||
apply plugin: 'elasticsearch.build' | ||
|
||
Map<String, String> vagrantEnvVars = [ | ||
'VAGRANT_CWD' : "${project.projectDir.absolutePath}", | ||
'VAGRANT_VAGRANTFILE' : 'Vagrantfile', | ||
'VAGRANT_PROJECT_DIR' : "${project.projectDir.absolutePath}" | ||
] | ||
|
||
String box = "test.ad.elastic.local" | ||
|
||
task update(type: org.elasticsearch.gradle.vagrant.VagrantCommandTask) { | ||
command 'box' | ||
subcommand 'update' | ||
boxName box | ||
environmentVars vagrantEnvVars | ||
buildscript { | ||
repositories { | ||
jcenter() | ||
} | ||
dependencies { | ||
classpath "com.avast.gradle:docker-compose-gradle-plugin:0.4.5" | ||
} | ||
} | ||
|
||
task up(type: org.elasticsearch.gradle.vagrant.VagrantCommandTask) { | ||
command 'up' | ||
args '--provision', '--provider', 'virtualbox' | ||
boxName box | ||
environmentVars vagrantEnvVars | ||
dependsOn update | ||
apply plugin: "base" | ||
apply plugin: 'docker-compose' | ||
|
||
dockerCompose { | ||
useComposeFiles = ['docker-compose.yml'] | ||
removeContainers = true // no persistent data! | ||
// MacOS does not allow writing to /usr/bin, but Linux installs it there on some distributions | ||
executable = file('/usr/local/bin/docker-compose').exists() ? '/usr/local/bin/docker-compose' : '/usr/bin/docker-compose' | ||
} | ||
|
||
task halt(type: org.elasticsearch.gradle.vagrant.VagrantCommandTask) { | ||
command 'halt' | ||
boxName box | ||
environmentVars vagrantEnvVars | ||
/** | ||
* Allows for other subprojects to depend on the project level and not care about the details | ||
* of composeUp | ||
*/ | ||
jar { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems funky. I think I'd prefer to depend on the task. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wasn't fully convinced either, just wanted to bring it up. Let's do the task it's more straight forward. |
||
dependsOn 'composeUp' | ||
} | ||
|
||
task destroy(type: org.elasticsearch.gradle.vagrant.VagrantCommandTask) { | ||
command 'destroy' | ||
args '-f' | ||
boxName box | ||
environmentVars vagrantEnvVars | ||
dependsOn halt | ||
clean { | ||
dependsOn 'composeDown' | ||
} | ||
|
||
thirdPartyAudit.enabled = false | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
version: '3' | ||
services: | ||
fixture: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
ports: | ||
- "61389:389" | ||
- "61636:636" | ||
- "63268:3268" | ||
- "63269:3269" |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ if [ -f $MARKER_FILE ]; then | |
exit 0; | ||
fi | ||
|
||
VDIR=/vagrant | ||
VDIR=/fixture | ||
RESOURCES=$VDIR/src/main/resources | ||
CERTS_DIR=$RESOURCES/certs | ||
SSL_DIR=/var/lib/samba/private/tls | ||
|
@@ -29,6 +29,7 @@ mkdir -p $SSL_DIR | |
cp $CERTS_DIR/*.pem $SSL_DIR | ||
chmod 600 $SSL_DIR/key.pem | ||
|
||
mkdir -p /etc/ssl/certs/ | ||
cat $SSL_DIR/ca.pem >> /etc/ssl/certs/ca-certificates.crt | ||
|
||
mv /etc/samba/smb.conf /etc/samba/smb.conf.orig | ||
|
@@ -93,3 +94,6 @@ EOL | |
ldapmodify -D [email protected] -w Passw0rd -H ldaps://127.0.0.1:636 -f /tmp/entrymods -v | ||
|
||
touch $MARKER_FILE | ||
|
||
# keep the container alive | ||
while true ; do sleep 3600 ; done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think
jcenter
is already in our build script.