minke 1.13.18 → 1.13.19

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 37f21bb55040f8575e3f678af26ec5f622bd6158
4
- data.tar.gz: a467dc8c47cb96fb4a8c90c332e1e271845648d8
3
+ metadata.gz: db5c87cfe8c45388d9219ed6df1533ddede1ea85
4
+ data.tar.gz: 4df5df6ff06439bbdadd40cb65111a4aacfaed5a
5
5
  SHA512:
6
- metadata.gz: 6567b76c4342cb898cf5b7111af987c86419be86f6ca1240d6f96fb2041a8a46a5c8b8f23716f12cfe2ec2fb6598666bab7ff43af3047abe9b61997ff77fe8c0
7
- data.tar.gz: d819a2df102d12f1647bf6c1b4b0cd98785575cff6f64c3f6abe6a5c01c703646838ad48f6bde16d7804071740597559bce5c012299d8084189c83ede524c599
6
+ metadata.gz: 09c308d7681d4f510db4a3a6511e825848e160379a3cc0857d07a3d959081bc98e0b6a7fd25fbc82fbae3a7f3dcfd7f07f2d3ad151e7b41262f4d83ce8455be7
7
+ data.tar.gz: 25de6501558149029163480c0c4815d38f3324afce9de60e282c8ad1f05cc9f96560514cbe77c8d5866a1bbea619fed956c96a68f5dff3b8b40d80bae80bc7f8
data/.travis.yml CHANGED
@@ -30,7 +30,7 @@ after_deploy:
30
30
  docker build -t nicholasjackson/minke --build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` --build-arg VCS_REF=`git rev-parse --short HEAD` .;
31
31
  docker login -e="$DOCKER_EMAIL" -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD";
32
32
  docker push nicholasjackson/minke:latest;
33
- docker tag nicholasjackson/minke nicholasjackson/minke:1.13.18;
34
- docker push nicholasjackson/minke:1.13.18;
33
+ docker tag nicholasjackson/minke nicholasjackson/minke:1.13.19;
34
+ docker push nicholasjackson/minke:1.13.19;
35
35
  curl https://hooks.microbadger.com/images/nicholasjackson/minke/tkpohfdrYPE0B0TL5NzLcOap4k0=;
36
36
  fi
data/bin/minke CHANGED
@@ -45,6 +45,7 @@ HELP
45
45
  global = OptionParser.new do |opts|
46
46
  opts.banner = "Usage: minke [options] [subcommand [options]]"
47
47
  opts.on("-v", "--[no-]verbose", "Run verbosely") { |v| options[:verbose] = true }
48
+ opts.on("-A", "--forward-ssh", "Forward ssh keys to docker") { |v| options[:forward_ssh] = true }
48
49
  opts.separator ""
49
50
  opts.separator subtext
50
51
  end
data/docker/Dockerfile CHANGED
@@ -35,6 +35,7 @@ RUN chmod +x /entrypoint.sh
35
35
 
36
36
  RUN gem update --system
37
37
  RUN gem install bundler -v 1.13.6
38
+ RUN bundle config build.nokogiri --use-system-libraries
38
39
  RUN bundle install
39
40
 
40
41
  RUN mkdir /usr/local/backup
@@ -1,14 +1,29 @@
1
1
  #!/bin/bash
2
- MINKE_VERSION="1.13.18"
2
+ MINKE_VERSION="1.13.19"
3
3
 
4
4
  DOCKER_SOCK="/var/run/docker.sock:/var/run/docker.sock"
5
5
  NEW_UUID=$(base64 /dev/urandom | tr -d '/+' | head -c 32 | tr '[:upper:]' '[:lower:]')
6
-
7
6
  DOCKER_IMAGE="nicholasjackson/minke:${MINKE_VERSION}"
8
-
9
7
  COMMAND=$*
10
-
11
8
  GEM_VOLUMES=""
9
+ SSH_AUTH=""
10
+
11
+ # Forward keys to docker host
12
+ if [[ $1 == "-A" || $2 == "-A" ]]; then
13
+ if [[ "${DOCKER_MACHINE}" != "" ]]; then
14
+ # for docker machine
15
+ SSH_SOCK=boot2docker.$$.ssh.socket
16
+ docker-machine ssh ${DOCKER_MACHINE} -A -S $SSH_SOCK -M -f -n tail -f /dev/null
17
+ AGENT_SOCK=$(docker-machine ssh ${DOCKER_MACHINE} -S $SSH_SOCK echo \$SSH_AUTH_SOCK)
18
+ SSH_AUTH="-e AGENT_SOCK=${AGENT_SOCK}"
19
+ fi
20
+
21
+ if [[ "${DOCKER_MACHINE}" == "" ]]; then
22
+ SSH_AUTH="-e AGENT_SOCK=${SSH_AUTH_SOCK}"
23
+ fi
24
+
25
+ echo "Forwarding SSH Keys: ${SSH_AUTH}"
26
+ fi
12
27
 
13
28
  # Test if interactive terminal and set the flag
14
29
  [[ -t 1 ]] && IT="-it" || IT=""
@@ -16,26 +31,28 @@ GEM_VOLUMES=""
16
31
  if [[ $1 != \generate* ]]; then
17
32
  # Test if we need to mount any special volumes for paths specified in the Gemfile
18
33
  while read -r line; do
19
- if [[ $line != \#* ]]; then
20
- l=$(echo $line | sed "s/.*:path *=> *//" | sed "s/['|\"]\(.*\)['|\"]/\1/")
21
- GEM_VOLUMES="${GEM_VOLUMES} -v $l:$l"
22
- fi
34
+ if [[ $line != \#* ]]; then
35
+ l=$(echo $line | sed "s/.*:path *=> *//" | sed "s/['|\"]\(.*\)['|\"]/\1/")
36
+ GEM_VOLUMES="${GEM_VOLUMES} -v $l:$l"
37
+ fi
23
38
  done < <(grep :path Gemfile)
24
39
 
25
40
  DIR=$(dirname `pwd`)
26
- DOCKER_RUN="docker run ${IT} --rm --net=minke_${NEW_UUID} ${GEM_VOLUMES} -v ${DOCKER_SOCK} -v ${DIR}:${DIR} -e BUNDLE_PATH=${PWD}/vendor -e BUNDLE_JOBS=2 -e DOCKER_NETWORK=minke_${NEW_UUID} -w ${DIR}/_build ${DOCKER_IMAGE} ${COMMAND}"
41
+ DOCKER_RUN="docker run ${IT} --rm --net=minke_${NEW_UUID} ${SSH_AUTH} ${GEM_VOLUMES} -v ${DOCKER_SOCK} -v ${DIR}:${DIR} -e BUNDLE_PATH=${PWD}/vendor -e BUNDLE_JOBS=2 -e DOCKER_NETWORK=minke_${NEW_UUID} -w ${DIR}/_minke ${DOCKER_IMAGE} ${COMMAND}"
27
42
 
28
43
  echo "Running command: minke ${COMMAND}"
29
-
30
44
  id=$(docker network create minke_${NEW_UUID})
31
- #echo "${DOCKER_RUN}"
32
45
  eval "${DOCKER_RUN}"
33
46
  id=$(docker network rm minke_${NEW_UUID})
47
+
48
+ if [[ "${DOCKER_MACHINE}" != "" ]]; then
49
+ # Clean up socket
50
+ docker-machine ssh default -S $SSH_SOCK -O exit
51
+ fi
34
52
  fi
35
53
 
36
54
  if [[ $1 = \generate* ]]; then
37
55
  DIR=$(pwd)
38
56
  DOCKER_RUN="docker run --rm -v ${DOCKER_SOCK} -v ${DIR}:${DIR} -w ${DIR}:${DIR} ${DOCKER_IMAGE} ${COMMAND}"
39
- echo $DOCKER_RUN
40
57
  eval "$DOCKER_RUN"
41
58
  fi
@@ -66,16 +66,23 @@ module Minke
66
66
  def run_command_in_container command
67
67
  begin
68
68
  @logger.info "Running command: #{command}"
69
-
70
- settings = @generator_config.build_settings.docker_settings
69
+ settings = @generator_config.build_settings.docker_settings
70
+ volumes = settings.binds.clone unless settings.binds == nil
71
+ environment = settings.env.clone unless settings.env == nil
71
72
  build_image = create_container_image
72
73
  working_directory = create_working_directory
73
74
 
75
+ if ENV['AGENT_SOCK'] != nil
76
+ volumes.push "#{ENV['AGENT_SOCK']}:/ssh-agent"
77
+ environment.push "SSH_AUTH_SOCK=/ssh-agent"
78
+ environment.push "GIT_SSH_COMMAND=ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
79
+ end
80
+
74
81
  args = {
75
82
  :image => build_image,
76
83
  :command => command,
77
- :volumes => settings.binds,
78
- :environment => settings.env,
84
+ :volumes => volumes,
85
+ :environment => environment,
79
86
  :working_directory => working_directory
80
87
  }
81
88
  container, success = @docker_runner.create_and_run_container args
data/lib/minke/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Minke
2
- VERSION = "1.13.18"
2
+ VERSION = "1.13.19"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minke
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.13.18
4
+ version: 1.13.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nic Jackson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-29 00:00:00.000000000 Z
11
+ date: 2016-12-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler