From 5c2e505f39b773773b6818d347ab7d7f1d6f4676 Mon Sep 17 00:00:00 2001
From: Nick Hurst <hurst.178@osu.edu>
Date: Fri, 21 Sep 2018 11:07:21 -0400
Subject: [PATCH 1/4] updates node version from 8 to 10

---
 CI/Dockerfile      | 12 ++++--------
 centos6/Dockerfile |  9 +++++----
 centos7/Dockerfile |  7 ++++---
 3 files changed, 13 insertions(+), 15 deletions(-)

diff --git a/CI/Dockerfile b/CI/Dockerfile
index 7e1f32a..2407081 100644
--- a/CI/Dockerfile
+++ b/CI/Dockerfile
@@ -7,15 +7,14 @@ ARG RVM_GID=rvm:x:5000:
 ARG DOCKER_GID=docker:x:900:
 ENV RVM_GID=${RVM_GID}docker: DOCKER_GID=${DOCKER_GID}docker:
 
-RUN curl --silent --location https://rpm.nodesource.com/setup_8.x | bash -
+RUN curl --silent --location https://rpm.nodesource.com/setup_10.x | sudo bash - && \
+  curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
+
 RUN echo $RVM_GID $DOCKER_GID | xargs -n1 echo >> /etc/group && \
     yum -y update && \
     yum install -y epel-release yum-utils && \
-    yum-config-manager --add-repo https://dl.yarnpkg.com/rpm/yarn.repo && \
-    yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo && \
     yum -y groupinstall "Development Tools" && \
     yum -y install \
-      docker-ce \
       libffi-devel \
       libyaml-devel \
       mysql-devel \
@@ -35,8 +34,7 @@ RUN echo $RVM_GID $DOCKER_GID | xargs -n1 echo >> /etc/group && \
       which && \
     yum clean all && \
     install-go && install-phantomjs && \
-    pip install --upgrade pip docker-compose && \
-    useradd -g docker -G rvm docker
+    useradd -g docker -G rvm
 
 USER docker
 WORKDIR /home/docker
@@ -51,7 +49,5 @@ ENV PATH=$PATH:$RVMPATH/bin:$GOPATH/bin:/usr/local/go/bin
 RUN gpg --keyserver $RVM_KEY_SERVER --recv-keys $RVM_PUBLIC_KEY_ID && \
     curl -sSL $RVM_URL | bash -s stable --with-default-gems='bundler'
 
-COPY ./scripts/docker-* /usr/local/bin/
-
 ENTRYPOINT /bin/bash --login
 CMD bash
diff --git a/centos6/Dockerfile b/centos6/Dockerfile
index c9bf6eb..e801c9b 100644
--- a/centos6/Dockerfile
+++ b/centos6/Dockerfile
@@ -3,11 +3,12 @@ FROM centos:centos6
 COPY ./etc/skel /etc/skel
 COPY ./scripts/install-autoconf /usr/local/sbin/install-autoconf
 
-RUN curl --silent --location https://rpm.nodesource.com/setup_8.x | bash -
-RUN yum -y update && \
+RUN curl --silent --location https://rpm.nodesource.com/setup_10.x | sudo bash - && \
+  curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
+
+RUN yum update -y && \
     yum install -y epel-release yum-utils && \
-    yum-config-manager --add-repo https://dl.yarnpkg.com/rpm/yarn.repo && \
-    yum -y install \
+    yum install -y \
       autoconf \
       automake \
       binutils \
diff --git a/centos7/Dockerfile b/centos7/Dockerfile
index 8071185..3540d2d 100644
--- a/centos7/Dockerfile
+++ b/centos7/Dockerfile
@@ -2,10 +2,11 @@ FROM centos:centos7
 
 COPY ./etc/skel /etc/skel
 
-RUN curl --silent --location https://rpm.nodesource.com/setup_8.x | bash -
-RUN yum -y update && \
+RUN curl --silent --location https://rpm.nodesource.com/setup_10.x | sudo bash - && \
+  curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
+
+RUN yum update -y && \
     yum install -y epel-release yum-utils && \
-    yum-config-manager --add-repo https://dl.yarnpkg.com/rpm/yarn.repo && \
     yum -y install \
       autoconf \
       automake \
-- 
GitLab


From 1f4d2e00e48d5163cc645b063a5306aff9cf32b4 Mon Sep 17 00:00:00 2001
From: Nick Hurst <hurst.178@osu.edu>
Date: Fri, 21 Sep 2018 11:24:41 -0400
Subject: [PATCH 2/4] renames folders -- updates ci config

---
 .gitlab-ci.yml                          | 44 ++++---------------------
 {centos6 => 6}/Dockerfile               |  0
 {centos6 => 6}/etc/skel/.bash_logout    |  0
 {centos6 => 6}/etc/skel/.bash_profile   |  0
 {centos6 => 6}/etc/skel/.bashrc         |  0
 {centos6 => 6}/etc/skel/.bundle/config  |  0
 {centos6 => 6}/etc/skel/.gemrc          |  0
 {centos6 => 6}/scripts/install-autoconf |  0
 {centos7 => 7}/Dockerfile               |  0
 {centos7 => 7}/etc/skel/.bash_logout    |  0
 {centos7 => 7}/etc/skel/.bash_profile   |  0
 {centos7 => 7}/etc/skel/.bashrc         |  0
 {centos7 => 7}/etc/skel/.bundle/config  |  0
 {centos7 => 7}/etc/skel/.gemrc          |  0
 CI/Dockerfile                           | 21 ++----------
 15 files changed, 9 insertions(+), 56 deletions(-)
 rename {centos6 => 6}/Dockerfile (100%)
 rename {centos6 => 6}/etc/skel/.bash_logout (100%)
 rename {centos6 => 6}/etc/skel/.bash_profile (100%)
 rename {centos6 => 6}/etc/skel/.bashrc (100%)
 rename {centos6 => 6}/etc/skel/.bundle/config (100%)
 rename {centos6 => 6}/etc/skel/.gemrc (100%)
 rename {centos6 => 6}/scripts/install-autoconf (100%)
 rename {centos7 => 7}/Dockerfile (100%)
 rename {centos7 => 7}/etc/skel/.bash_logout (100%)
 rename {centos7 => 7}/etc/skel/.bash_profile (100%)
 rename {centos7 => 7}/etc/skel/.bashrc (100%)
 rename {centos7 => 7}/etc/skel/.bundle/config (100%)
 rename {centos7 => 7}/etc/skel/.gemrc (100%)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index cdf1229..bb33991 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,59 +1,29 @@
 stages:
   - build
-  - cache
   - release
-  - cleanup
   - trigger
 
-variables: &vars
-  CACHE: asctech/centos-cache
-  RELEASE: code.osu.edu:5000/asctech/docker/centos
-  PIPELINE: centos-$CI_PIPELINE_ID
-
 .build: &build
   stage: build
-  before_script:
-    - TAG=$CI_JOB_NAME
-    - DOCKERFILE=$([ $TAG = ci ] && echo ./CI || echo ./centos$TAG)
-  script: docker build --no-cache -t $PIPELINE:$TAG $BUILD_ARGS $DOCKERFILE
-
+  image: docker:latest
+  tags: [build]
+  script: docker build -t $CI_REGISTRY_IMAGE:$CI_JOB_NAME ./$CI_JOB_NAME
 
 :7: *build
 :6: *build
-ci:
-  <<: *build
-  variables:
-    <<: *vars
-    BUILD_ARGS: --build-arg RVM_GID=$RVM_GID --build-arg DOCKER_GID=$DOCKER_GID
-
-before_script: ["docker-login","TAG=$(echo $CI_JOB_NAME | awk '{print $2}')"]
-
-.cache: &cache
-  stage: cache
-  script: docker tag $PIPELINE:$TAG $CACHE:$TAG
-
-cache 7: *cache
-cache 6: *cache
-cache ci: *cache
+ci: *build
 
 .release: &release
   only: [master]
   stage: release
-  script: docker tag $PIPELINE:$TAG $RELEASE:$TAG && docker push $_
+  image: docker:latest
+  tags: [build]
+  script: docker push $CI_REGISTRY_IMAGE:$(echo $CI_JOB_NAME | cut -c 9-)
 
 release 7: *release
 release 6: *release
 release ci: *release
 
-.cleanup: &cleanup
-  when: always
-  stage: cleanup
-  script: docker rmi $PIPELINE:$TAG
-
-cleanup 7: *cleanup
-cleanup 6: *cleanup
-cleanup ci: *cleanup
-
 .trigger: &trigger
   only: [master]
   stage: trigger
diff --git a/centos6/Dockerfile b/6/Dockerfile
similarity index 100%
rename from centos6/Dockerfile
rename to 6/Dockerfile
diff --git a/centos6/etc/skel/.bash_logout b/6/etc/skel/.bash_logout
similarity index 100%
rename from centos6/etc/skel/.bash_logout
rename to 6/etc/skel/.bash_logout
diff --git a/centos6/etc/skel/.bash_profile b/6/etc/skel/.bash_profile
similarity index 100%
rename from centos6/etc/skel/.bash_profile
rename to 6/etc/skel/.bash_profile
diff --git a/centos6/etc/skel/.bashrc b/6/etc/skel/.bashrc
similarity index 100%
rename from centos6/etc/skel/.bashrc
rename to 6/etc/skel/.bashrc
diff --git a/centos6/etc/skel/.bundle/config b/6/etc/skel/.bundle/config
similarity index 100%
rename from centos6/etc/skel/.bundle/config
rename to 6/etc/skel/.bundle/config
diff --git a/centos6/etc/skel/.gemrc b/6/etc/skel/.gemrc
similarity index 100%
rename from centos6/etc/skel/.gemrc
rename to 6/etc/skel/.gemrc
diff --git a/centos6/scripts/install-autoconf b/6/scripts/install-autoconf
similarity index 100%
rename from centos6/scripts/install-autoconf
rename to 6/scripts/install-autoconf
diff --git a/centos7/Dockerfile b/7/Dockerfile
similarity index 100%
rename from centos7/Dockerfile
rename to 7/Dockerfile
diff --git a/centos7/etc/skel/.bash_logout b/7/etc/skel/.bash_logout
similarity index 100%
rename from centos7/etc/skel/.bash_logout
rename to 7/etc/skel/.bash_logout
diff --git a/centos7/etc/skel/.bash_profile b/7/etc/skel/.bash_profile
similarity index 100%
rename from centos7/etc/skel/.bash_profile
rename to 7/etc/skel/.bash_profile
diff --git a/centos7/etc/skel/.bashrc b/7/etc/skel/.bashrc
similarity index 100%
rename from centos7/etc/skel/.bashrc
rename to 7/etc/skel/.bashrc
diff --git a/centos7/etc/skel/.bundle/config b/7/etc/skel/.bundle/config
similarity index 100%
rename from centos7/etc/skel/.bundle/config
rename to 7/etc/skel/.bundle/config
diff --git a/centos7/etc/skel/.gemrc b/7/etc/skel/.gemrc
similarity index 100%
rename from centos7/etc/skel/.gemrc
rename to 7/etc/skel/.gemrc
diff --git a/CI/Dockerfile b/CI/Dockerfile
index 2407081..24778d8 100644
--- a/CI/Dockerfile
+++ b/CI/Dockerfile
@@ -1,17 +1,11 @@
 FROM centos:centos7
 
 COPY ./etc/skel /etc/skel
-COPY ./scripts/install-go ./scripts/install-phantomjs /usr/local/sbin/
-
-ARG RVM_GID=rvm:x:5000:
-ARG DOCKER_GID=docker:x:900:
-ENV RVM_GID=${RVM_GID}docker: DOCKER_GID=${DOCKER_GID}docker:
 
 RUN curl --silent --location https://rpm.nodesource.com/setup_10.x | sudo bash - && \
   curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
 
-RUN echo $RVM_GID $DOCKER_GID | xargs -n1 echo >> /etc/group && \
-    yum -y update && \
+RUN yum -y update && \
     yum install -y epel-release yum-utils && \
     yum -y groupinstall "Development Tools" && \
     yum -y install \
@@ -33,21 +27,10 @@ RUN echo $RVM_GID $DOCKER_GID | xargs -n1 echo >> /etc/group && \
       wget \
       which && \
     yum clean all && \
-    install-go && install-phantomjs && \
-    useradd -g docker -G rvm
+    useradd -g docker
 
 USER docker
 WORKDIR /home/docker
 
-ENV RVMPATH=/home/docker/.rvm GOPATH=/home/docker/go \
-    RVM_URL=https://get.rvm.io \
-    RVM_KEY_SERVER=hkp://keys.gnupg.net \
-    RVM_PUBLIC_KEY_ID=409B6B1796C275462A1703113804BB82D39DC0E3
-
-ENV PATH=$PATH:$RVMPATH/bin:$GOPATH/bin:/usr/local/go/bin
-
-RUN gpg --keyserver $RVM_KEY_SERVER --recv-keys $RVM_PUBLIC_KEY_ID && \
-    curl -sSL $RVM_URL | bash -s stable --with-default-gems='bundler'
-
 ENTRYPOINT /bin/bash --login
 CMD bash
-- 
GitLab


From 32a56ddcd63c88fd6c08b6e44499c35215de7ef8 Mon Sep 17 00:00:00 2001
From: Nick Hurst <hurst.178@osu.edu>
Date: Fri, 21 Sep 2018 11:32:59 -0400
Subject: [PATCH 3/4] fixes Dockerfiles

---
 6/Dockerfile                              | 5 +++--
 7/Dockerfile                              | 5 +++--
 {CI => ci}/Dockerfile                     | 5 +++--
 {CI => ci}/etc/skel/.bash_logout          | 0
 {CI => ci}/etc/skel/.bash_profile         | 0
 {CI => ci}/etc/skel/.bashrc               | 0
 {CI => ci}/etc/skel/.bundle/config        | 0
 {CI => ci}/etc/skel/.gemrc                | 0
 {CI => ci}/etc/skel/.rvmrc                | 0
 {CI => ci}/etc/skel/.ssh/config           | 0
 {CI => ci}/etc/skel/go/bin/.keep          | 0
 {CI => ci}/etc/skel/go/pkg/.keep          | 0
 {CI => ci}/etc/skel/go/src/.keep          | 0
 {CI => ci}/scripts/docker-cleanup         | 0
 {CI => ci}/scripts/docker-login           | 0
 {CI => ci}/scripts/docker-rename-to-build | 0
 {CI => ci}/scripts/install-go             | 0
 {CI => ci}/scripts/install-phantomjs      | 0
 18 files changed, 9 insertions(+), 6 deletions(-)
 rename {CI => ci}/Dockerfile (90%)
 rename {CI => ci}/etc/skel/.bash_logout (100%)
 rename {CI => ci}/etc/skel/.bash_profile (100%)
 rename {CI => ci}/etc/skel/.bashrc (100%)
 rename {CI => ci}/etc/skel/.bundle/config (100%)
 rename {CI => ci}/etc/skel/.gemrc (100%)
 rename {CI => ci}/etc/skel/.rvmrc (100%)
 rename {CI => ci}/etc/skel/.ssh/config (100%)
 rename {CI => ci}/etc/skel/go/bin/.keep (100%)
 rename {CI => ci}/etc/skel/go/pkg/.keep (100%)
 rename {CI => ci}/etc/skel/go/src/.keep (100%)
 rename {CI => ci}/scripts/docker-cleanup (100%)
 rename {CI => ci}/scripts/docker-login (100%)
 rename {CI => ci}/scripts/docker-rename-to-build (100%)
 rename {CI => ci}/scripts/install-go (100%)
 rename {CI => ci}/scripts/install-phantomjs (100%)

diff --git a/6/Dockerfile b/6/Dockerfile
index e801c9b..7a13725 100644
--- a/6/Dockerfile
+++ b/6/Dockerfile
@@ -3,8 +3,8 @@ FROM centos:centos6
 COPY ./etc/skel /etc/skel
 COPY ./scripts/install-autoconf /usr/local/sbin/install-autoconf
 
-RUN curl --silent --location https://rpm.nodesource.com/setup_10.x | sudo bash - && \
-  curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
+RUN curl --silent --location https://rpm.nodesource.com/setup_10.x | bash - && \
+  curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | tee /etc/yum.repos.d/yarn.repo
 
 RUN yum update -y && \
     yum install -y epel-release yum-utils && \
@@ -34,6 +34,7 @@ RUN yum update -y && \
       wget \
       which && \
     yum clean all && \
+    rm -rf /var/cache/yum && \
     install-autoconf && \
     cp -r /etc/skel /home/root
 
diff --git a/7/Dockerfile b/7/Dockerfile
index 3540d2d..217b188 100644
--- a/7/Dockerfile
+++ b/7/Dockerfile
@@ -2,8 +2,8 @@ FROM centos:centos7
 
 COPY ./etc/skel /etc/skel
 
-RUN curl --silent --location https://rpm.nodesource.com/setup_10.x | sudo bash - && \
-  curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
+RUN curl --silent --location https://rpm.nodesource.com/setup_10.x |  bash - && \
+  curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo |  tee /etc/yum.repos.d/yarn.repo
 
 RUN yum update -y && \
     yum install -y epel-release yum-utils && \
@@ -33,6 +33,7 @@ RUN yum update -y && \
       wget \
       which && \
     yum clean all && \
+    rm -rf /var/cache/yum && \
     cp -r /etc/skel /home/root
 
 CMD bash
diff --git a/CI/Dockerfile b/ci/Dockerfile
similarity index 90%
rename from CI/Dockerfile
rename to ci/Dockerfile
index 24778d8..ca1d27c 100644
--- a/CI/Dockerfile
+++ b/ci/Dockerfile
@@ -2,8 +2,8 @@ FROM centos:centos7
 
 COPY ./etc/skel /etc/skel
 
-RUN curl --silent --location https://rpm.nodesource.com/setup_10.x | sudo bash - && \
-  curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
+RUN curl --silent --location https://rpm.nodesource.com/setup_10.x |  bash - && \
+  curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo |  tee /etc/yum.repos.d/yarn.repo
 
 RUN yum -y update && \
     yum install -y epel-release yum-utils && \
@@ -27,6 +27,7 @@ RUN yum -y update && \
       wget \
       which && \
     yum clean all && \
+    rm -rf /var/cache/yum && \
     useradd -g docker
 
 USER docker
diff --git a/CI/etc/skel/.bash_logout b/ci/etc/skel/.bash_logout
similarity index 100%
rename from CI/etc/skel/.bash_logout
rename to ci/etc/skel/.bash_logout
diff --git a/CI/etc/skel/.bash_profile b/ci/etc/skel/.bash_profile
similarity index 100%
rename from CI/etc/skel/.bash_profile
rename to ci/etc/skel/.bash_profile
diff --git a/CI/etc/skel/.bashrc b/ci/etc/skel/.bashrc
similarity index 100%
rename from CI/etc/skel/.bashrc
rename to ci/etc/skel/.bashrc
diff --git a/CI/etc/skel/.bundle/config b/ci/etc/skel/.bundle/config
similarity index 100%
rename from CI/etc/skel/.bundle/config
rename to ci/etc/skel/.bundle/config
diff --git a/CI/etc/skel/.gemrc b/ci/etc/skel/.gemrc
similarity index 100%
rename from CI/etc/skel/.gemrc
rename to ci/etc/skel/.gemrc
diff --git a/CI/etc/skel/.rvmrc b/ci/etc/skel/.rvmrc
similarity index 100%
rename from CI/etc/skel/.rvmrc
rename to ci/etc/skel/.rvmrc
diff --git a/CI/etc/skel/.ssh/config b/ci/etc/skel/.ssh/config
similarity index 100%
rename from CI/etc/skel/.ssh/config
rename to ci/etc/skel/.ssh/config
diff --git a/CI/etc/skel/go/bin/.keep b/ci/etc/skel/go/bin/.keep
similarity index 100%
rename from CI/etc/skel/go/bin/.keep
rename to ci/etc/skel/go/bin/.keep
diff --git a/CI/etc/skel/go/pkg/.keep b/ci/etc/skel/go/pkg/.keep
similarity index 100%
rename from CI/etc/skel/go/pkg/.keep
rename to ci/etc/skel/go/pkg/.keep
diff --git a/CI/etc/skel/go/src/.keep b/ci/etc/skel/go/src/.keep
similarity index 100%
rename from CI/etc/skel/go/src/.keep
rename to ci/etc/skel/go/src/.keep
diff --git a/CI/scripts/docker-cleanup b/ci/scripts/docker-cleanup
similarity index 100%
rename from CI/scripts/docker-cleanup
rename to ci/scripts/docker-cleanup
diff --git a/CI/scripts/docker-login b/ci/scripts/docker-login
similarity index 100%
rename from CI/scripts/docker-login
rename to ci/scripts/docker-login
diff --git a/CI/scripts/docker-rename-to-build b/ci/scripts/docker-rename-to-build
similarity index 100%
rename from CI/scripts/docker-rename-to-build
rename to ci/scripts/docker-rename-to-build
diff --git a/CI/scripts/install-go b/ci/scripts/install-go
similarity index 100%
rename from CI/scripts/install-go
rename to ci/scripts/install-go
diff --git a/CI/scripts/install-phantomjs b/ci/scripts/install-phantomjs
similarity index 100%
rename from CI/scripts/install-phantomjs
rename to ci/scripts/install-phantomjs
-- 
GitLab


From 41adc1cf2b9e97348bdc492f28784c86b18ac1da Mon Sep 17 00:00:00 2001
From: Nick Hurst <hurst.178@osu.edu>
Date: Fri, 21 Sep 2018 11:40:50 -0400
Subject: [PATCH 4/4] fixes useradd on ci image

---
 ci/Dockerfile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ci/Dockerfile b/ci/Dockerfile
index ca1d27c..2b2b368 100644
--- a/ci/Dockerfile
+++ b/ci/Dockerfile
@@ -28,7 +28,7 @@ RUN yum -y update && \
       which && \
     yum clean all && \
     rm -rf /var/cache/yum && \
-    useradd -g docker
+    useradd --user-group docker
 
 USER docker
 WORKDIR /home/docker
-- 
GitLab