File tree 5 files changed +65
-2
lines changed
5 files changed +65
-2
lines changed Original file line number Diff line number Diff line change
1
+ Dockerfile
2
+ README.md
3
+ version
Original file line number Diff line number Diff line change
1
+ FROM ruby:2.0.0-p645-slim
2
+ MAINTAINER Lewis Marshall <
[email protected] >
3
+
4
+ # Update and install all of the required packages.
5
+ RUN apt-get update && apt-get install -y \
6
+ wget \
7
+ tar
8
+
9
+ # TODO: could make these just mount points (to stay compatible with platform)
10
+ # Download the fleetctl binary:
11
+ RUN FLEET_URL=https://github.com/coreos/fleet/releases/download/v0.10.2/fleet-v0.10.2-linux-amd64.tar.gz && \
12
+ export FLEET_TAR=$(basename ${FLEET_URL}) && \
13
+ wget -O /tmp/${FLEET_TAR} ${FLEET_URL} && \
14
+ cd /tmp && \
15
+ tar -xzvf ${FLEET_TAR} && \
16
+ cp $(basename ${FLEET_TAR} .tar.gz)/fleetctl /usr/local/bin/fleetctl
17
+
18
+ # Download the kubectl binary:
19
+ ENV KUBE_VER=0.20.2
20
+ ENV KUBE_URL=https://storage.googleapis.com/kubernetes-release/release/v${KUBE_VER}/bin/linux/amd64/kubectl
21
+ RUN /bin/bash -l -c "wget ${KUBE_URL} \
22
+ -O /usr/local/bin/kubectl && \
23
+ chmod +x /usr/local/bin/kubectl"
24
+
25
+ # Add the kb8or files
26
+ RUN mkdir /var/lib/kb8or
27
+ WORKDIR /var/lib/kb8or
28
+ ADD . /var/lib/kb8or/
29
+ RUN bundle install
30
+ RUN ln -s /var/lib/kb8or/kb8or.rb /usr/local/bin/kb8or
31
+
32
+ # Add the deploy mount - point
33
+ RUN mkdir -p /var/lib/deploy
34
+ WORKDIR /var/lib/deploy
35
+ VOLUME /var/lib/deploy
36
+
37
+ CMD bash
Original file line number Diff line number Diff line change 16
16
17
17
require 'methadone'
18
18
require 'yaml'
19
- Dir . glob ( File . join ( File . dirname ( __FILE__ ) , 'libs/*.rb' ) ) { |f | require f }
19
+ require 'pathname'
20
+
21
+ KB8_HOME = File . dirname ( Pathname . new ( __FILE__ ) . realdirpath )
22
+ Dir . glob ( File . join ( KB8_HOME , 'libs/*.rb' ) ) { |f | require f }
20
23
21
24
class Kb8or
22
25
include Methadone ::Main
23
26
include Methadone ::CLILogging
24
27
25
- version '0.0.6'
28
+ version File . read ( File . join ( KB8_HOME , 'version' ) )
26
29
description 'Will create OR update a kb8 application in a re-runnable way'
27
30
28
31
arg :deploy_file
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+ # Example runner - how this could work within Jenkins...
3
+
4
+ set -e
5
+
6
+ # TODO: make this more generic!
7
+ if [ " $USER " == " JENKINS" ]; then
8
+ export SUDO=" sudo "
9
+ fi
10
+
11
+ # Get the relative checked out code directory in Jenkins:
12
+ REAL_ROOT=/var/lib
13
+ JENKINS_ROOT=/var
14
+ REAL_CODE_HOME=${PWD/ $JENKINS_ROOT / $REAL_ROOT }
15
+ VER=$( cat version)
16
+
17
+ # Now run kb8or...
18
+ $SUDO docker run -it --rm --name kb8or -v " ${REAL_CODE_HOME} " :/var/lib/deploys ukhomeofficedigital/kb8or:${VER} && \
19
+ kb8or $@
Original file line number Diff line number Diff line change
1
+ 0.0.6
You can’t perform that action at this time.
0 commit comments