diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 529ac86..4ec613d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,8 +1,5 @@ services: -- ${DOCKER_REGISTRY}/leenooks/ci-docker:dind - -variables: - DOCKER_REGISTRY: registry.leenooks.net +- ${CI_REGISTRY}/leenooks/ci-docker:dind stages: - build @@ -12,7 +9,7 @@ stages: # For some reason compiling on CentOS 6.x results in buffer corruption build:6-7.1: stage: build - image: ${DOCKER_REGISTRY}/leenooks/ci-tsm:6-7.1 + image: ${CI_REGISTRY}/leenooks/ci-tsm:6-7.1 script: - make -f Makefile.linux64 only: @@ -26,7 +23,7 @@ build:6-7.1: test:6-7.1: stage: test - image: ${DOCKER_REGISTRY}/leenooks/ci-tsm:6-7.1 + image: ${CI_REGISTRY}/leenooks/ci-tsm:6-7.1 dependencies: - build:6-7.1 script: @@ -39,7 +36,7 @@ test:6-7.1: # Compile on CentOS 6.x, for some reason compiling on CentOS 7.x results in buffer corruption build:7-8.1: stage: build - image: ${DOCKER_REGISTRY}/leenooks/ci-tsm:7-8.1 + image: ${CI_REGISTRY}/leenooks/ci-tsm:7-8.1 script: - make -f Makefile.linux64 only: @@ -53,7 +50,7 @@ build:7-8.1: test:7-8.1: stage: test - image: ${DOCKER_REGISTRY}/leenooks/ci-tsm:7-8.1 + image: ${CI_REGISTRY}/leenooks/ci-tsm:7-8.1 dependencies: - build:7-8.1 script: @@ -73,17 +70,18 @@ docker:7-8.1: before_script: - docker info - docker version - - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN ${DOCKER_REGISTRY} + - echo "$CI_JOB_TOKEN" | docker login -u "$CI_REGISTRY_USER" "$CI_REGISTRY" --password-stdin variables: + CACHETAG: build VERSION: 8.1.0 - DOCKER_IMAGE: deon/tsmpipe - DOCKER_HOST: tcp://${DOCKER_REGISTRY}-leenooks-ci-docker:2375 dependencies: - test:7-8.1 script: - - docker pull ${DOCKER_REGISTRY}/${DOCKER_IMAGE}:${VERSION} || true - - docker build --cache-from ${DOCKER_REGISTRY}/${DOCKER_IMAGE}:${VERSION} -t ${DOCKER_REGISTRY}/${DOCKER_IMAGE}:${VERSION} . - - docker push ${DOCKER_REGISTRY}/${DOCKER_IMAGE}:${VERSION} + - if [ -f init ]; then chmod 500 init; fi + - docker pull ${CI_REGISTRY_IMAGE}:${CACHETAG} || true + - docker build --cache-from ${CI_REGISTRY_IMAGE}:${CACHETAG} -t ${CI_REGISTRY_IMAGE}:${VERSION} -t ${CI_REGISTRY_IMAGE}:${CACHETAG} . + - docker push ${CI_REGISTRY_IMAGE}:${VERSION} + - docker push ${CI_REGISTRY_IMAGE}:${CACHETAG} tags: - docker only: diff --git a/Dockerfile b/Dockerfile index ac2e2c7..6fbdc04 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,19 @@ # NAME deon/tsmpipe -# VERSION 8.1.0 +# VERSION 8.1.4 FROM centos:7 -#RUN curl -SL ftp://public.dhe.ibm.com/storage/tivoli-storage-management/maintenance/client/v8r1/Linux/LinuxX86/BA/v812/8.1.2.0-TIV-TSMBAC-LinuxX86.tar | tar -C /tmp/ -xf - gskcrypt64-8.0.50.78.linux.x86_64.rpm gskssl64-8.0.50.78.linux.x86_64.rpm TIVsm-API64.x86_64.rpm && yum install -y /tmp/*rpm && rm -f /tmp/*rpm -RUN curl -SL http://yum.leenooks.net/CentOS/7/8.1.2.0-TIV-TSMBAC-LinuxX86.tar | tar -C /tmp/ -xf - gskcrypt64-8.0.50.78.linux.x86_64.rpm gskssl64-8.0.50.78.linux.x86_64.rpm TIVsm-API64.x86_64.rpm && yum install -y /tmp/*rpm && rm -f /tmp/*rpm +RUN SOURCE_URL=http://yum.leenooks.net/docker/tsmba && \ + PREFIX=TSMCLI_LNX/tsmcli/linux86 && \ + CHARS=$(echo ${PREFIX} | awk -F"/" '{print NF}') && \ + TSMPIPE=http://yum.leenooks.net/CentOS/7/ln/custom/tsmpipe-7.1.6_0_1.6.6-0.x86_64.rpm && \ + curl -SL ${SOURCE_URL}/8.1.4 | tar -C /tmp/ --strip-components ${CHARS} -xzf - ${PREFIX}/gskcrypt64-*.linux.x86_64.rpm ${PREFIX}/gskssl64-*.linux.x86_64.rpm ${PREFIX}/TIVsm-API64.x86_64.rpm && \ + yum install -y /tmp/*rpm ${TSMPIPE} && rm -f /tmp/*rpm + RUN ln -s /tsm/dsm.sys /opt/tivoli/tsm/client/api/bin64/ \ && ln -s /tsm/dsm.opt /opt/tivoli/tsm/client/api/bin64/ \ && ln -s /tsm/dsmcert.kdb /opt/tivoli/tsm/client/api/bin64/ \ && ln -s /tsm/dsmcert.sth /opt/tivoli/tsm/client/api/bin64/ -COPY tsmpipe /usr/bin VOLUME [ "/tsm" ]