Move composed to a folder

This commit is contained in:
Guillem Hernandez Sola
2018-06-13 11:44:39 +02:00
parent 80460ccdc9
commit 75f631d93f
9 changed files with 0 additions and 0 deletions

19
compose/misc/Jenkinsfile vendored Executable file
View File

@@ -0,0 +1,19 @@
node {
def commit_id
stage('Preparation') {
checkout scm
sh "git rev-parse --short HEAD > .git/commit-id"
commit_id = readFile('.git/commit-id').trim()
}
stage('test') {
nodejs(nodeJSInstallationName: 'nodejs') {
sh 'npm install --only=dev'
sh 'npm test'
}
}
stage('docker build/push') {
docker.withRegistry('https://index.docker.io/v1/', 'dockerhub') {
def app = docker.build("wardviaene/docker-nodejs-demo:${commit_id}", '.').push()
}
}
}

31
compose/misc/Jenkinsfile.v2 Executable file
View File

@@ -0,0 +1,31 @@
node {
def commit_id
stage('Preparation') {
checkout scm
sh "git rev-parse --short HEAD > .git/commit-id"
commit_id = readFile('.git/commit-id').trim()
}
stage('test') {
def myTestContainer = docker.image('node:4.6')
myTestContainer.pull()
myTestContainer.inside {
sh 'npm install --only=dev'
sh 'npm test'
}
}
stage('test with a DB') {
def mysql = docker.image('mysql').run("-e MYSQL_ALLOW_EMPTY_PASSWORD=yes")
def myTestContainer = docker.image('node:4.6')
myTestContainer.pull()
myTestContainer.inside("--link ${mysql.id}:mysql") { // using linking, mysql will be available at host: mysql, port: 3306
sh 'npm install --only=dev'
sh 'npm test'
}
mysql.stop()
}
stage('docker build/push') {
docker.withRegistry('https://index.docker.io/v1/', 'dockerhub') {
def app = docker.build("wardviaene/docker-nodejs-demo:${commit_id}", '.').push()
}
}
}

7
compose/misc/Vagrantfile vendored Executable file
View File

@@ -0,0 +1,7 @@
Vagrant.configure(2) do |config|
config.vm.define "docker" do |docker|
docker.vm.box = "ubuntu/trusty64"
docker.vm.network "private_network", ip: "192.168.0.249"
docker.vm.hostname = "docker.example.com"
end
end