From e74a7e0eef6dca7b1fd51cd2feacab3945bb74d3 Mon Sep 17 00:00:00 2001 From: Jim Van Fleet Date: Wed, 27 Jul 2016 11:04:01 -0400 Subject: [PATCH 1/6] Removing binstubs --- bin/build.sh | 6 ------ bin/destroy.sh | 6 ------ bin/rebuild.sh | 3 --- bin/rerun.sh | 3 --- bin/retry.sh | 5 ----- bin/run.sh | 5 ----- bin/test.sh | 3 --- 7 files changed, 31 deletions(-) delete mode 100755 bin/build.sh delete mode 100755 bin/destroy.sh delete mode 100755 bin/rebuild.sh delete mode 100755 bin/rerun.sh delete mode 100755 bin/retry.sh delete mode 100755 bin/run.sh delete mode 100755 bin/test.sh diff --git a/bin/build.sh b/bin/build.sh deleted file mode 100755 index 190c975..0000000 --- a/bin/build.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -source common.bash . - -echo "Building new Docker image($maintainer/$imagename)" -docker build --rm -t $maintainer/$imagename --build-arg maintainer=$maintainer --build-arg imagename=$imagename --build-arg version=$version . \ No newline at end of file diff --git a/bin/destroy.sh b/bin/destroy.sh deleted file mode 100755 index b282a47..0000000 --- a/bin/destroy.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -source common.bash . - -docker rm $(docker ps -a | grep $maintainer/$imagename | awk '{print $1}') -docker rmi $maintainer/$imagename diff --git a/bin/rebuild.sh b/bin/rebuild.sh deleted file mode 100755 index 3904e58..0000000 --- a/bin/rebuild.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -source bin/destroy.sh && source bin/build.sh \ No newline at end of file diff --git a/bin/rerun.sh b/bin/rerun.sh deleted file mode 100755 index e279386..0000000 --- a/bin/rerun.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -source bin/rebuild.sh && source bin/run.sh $1 \ No newline at end of file diff --git a/bin/retry.sh b/bin/retry.sh deleted file mode 100755 index 59406e2..0000000 --- a/bin/retry.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -source common.bash . - -docker rm $(docker ps -a | grep $maintainer/$imagename | awk '{print $1}') diff --git a/bin/run.sh b/bin/run.sh deleted file mode 100755 index 8af1b06..0000000 --- a/bin/run.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -source common.bash . - -docker run -it $maintainer/$imagename $1 \ No newline at end of file diff --git a/bin/test.sh b/bin/test.sh deleted file mode 100755 index 6d4b8be..0000000 --- a/bin/test.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -bats tests \ No newline at end of file From 381807ce2d5a2fc207d8f67112ab225918aa0536 Mon Sep 17 00:00:00 2001 From: Jim Van Fleet Date: Wed, 27 Jul 2016 11:11:26 -0400 Subject: [PATCH 2/6] Followed installation instructions --- .gitignore | 7 +++++++ BINSCRIPTS.md | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 .gitignore create mode 100644 BINSCRIPTS.md diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7323a01 --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +bin/build.sh +bin/destroy.sh +bin/install.sh +bin/rebuild.sh +bin/rerun.sh +bin/run.sh +bin/test.sh diff --git a/BINSCRIPTS.md b/BINSCRIPTS.md new file mode 100644 index 0000000..c25c1ff --- /dev/null +++ b/BINSCRIPTS.md @@ -0,0 +1,34 @@ +# util + +This repository is intended to be downloaded into a container repository during development for convenience purposes. Since the major mechanisms of developing to the Docker container construction lifecycle are identical across container images, this repository allows for consistency and additional ease of use across all container images. + +## Install + +To use these scripts on your container image construction project, issue these commands in the root directory of your container project: + +``` +``` + +### common.bash + +The installation process will create a common.bash file. This file should be the central, canonical authority for management of environment variables. While a subprocess may override them, the files in common.bash should be treated as authoritative defaults. Processes (e.g. `docker build`, `bats`, inside `Jenkinsfile`) can read this file and process the results therein. + +You should edit this file to change the image name, and add any other helpful environment variables. + +## Use + + +### Building + +#### build.sh +`bin/build ` +#### destroy.sh +#### rebuild.sh + +### Running +### rerun.sh +### run.sh + + +### Testing +#### test.sh \ No newline at end of file From e38d49eab43305c83cab6bd860ab33ca99b0fa9f Mon Sep 17 00:00:00 2001 From: Jim Van Fleet Date: Wed, 27 Jul 2016 11:13:48 -0400 Subject: [PATCH 3/6] Adding util installation to Jenkinsfile --- Jenkinsfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index d0c4a24..6075f37 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -7,6 +7,10 @@ node { stage 'Checkout' checkout scm + + stage 'Acquire util' + + sh 'curl "https://github.internet2.edu/raw/docker/util/master/bin/install.sh?token=AAAAEddkrL9MeeA6VWcNn_PgV30r4lD1ks5XogeiwA%3D%3D" | bash' stage 'Base' From 129bb10d7d1b103ecfa3d923a5269b0b9f281465 Mon Sep 17 00:00:00 2001 From: Jim Van Fleet Date: Wed, 27 Jul 2016 11:38:00 -0400 Subject: [PATCH 4/6] Adding ability to install util into Pipeline --- Jenkinsfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6075f37..107421b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -10,7 +10,9 @@ node { stage 'Acquire util' - sh 'curl "https://github.internet2.edu/raw/docker/util/master/bin/install.sh?token=AAAAEddkrL9MeeA6VWcNn_PgV30r4lD1ks5XogeiwA%3D%3D" | bash' + git([ url: "https://github.internet2.edu/docker/util.git", + credentialsId: "jenkins-github-access-token" ]) + sh 'mv util/bin bin' stage 'Base' From eb605f3a986fc00ee85bb6a8b5c3c756aacedd54 Mon Sep 17 00:00:00 2001 From: Jim Van Fleet Date: Wed, 27 Jul 2016 11:47:29 -0400 Subject: [PATCH 5/6] Acquiring util in the pipeline --- Jenkinsfile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 107421b..a1430b2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -9,10 +9,14 @@ node { checkout scm stage 'Acquire util' - - git([ url: "https://github.internet2.edu/docker/util.git", + + sh 'mkdir bin' + dir('bin'){ + git([ url: "https://github.internet2.edu/docker/util.git", credentialsId: "jenkins-github-access-token" ]) - sh 'mv util/bin bin' + sh 'ls' + sh 'mv bin/* .' + } stage 'Base' From c8a7677f669d3a2ffce19c549e2a04d14ce43163 Mon Sep 17 00:00:00 2001 From: Jim Van Fleet Date: Wed, 27 Jul 2016 11:51:18 -0400 Subject: [PATCH 6/6] Do not fail if bin directory exists --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index a1430b2..f2cf5c7 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -10,7 +10,7 @@ node { stage 'Acquire util' - sh 'mkdir bin' + sh 'mkdir -p bin' dir('bin'){ git([ url: "https://github.internet2.edu/docker/util.git", credentialsId: "jenkins-github-access-token" ])