Skip to content

Latest commit

 

History

History
116 lines (92 loc) · 4.38 KB

README.md

File metadata and controls

116 lines (92 loc) · 4.38 KB

adorsys/ci-build

https://hub.docker.com/r/adorsys/ci-build/

Description

The default build image.

Software list:

  • Java 8 and 11 (choosable via JABBA; default 8)
  • Node 10 and 12 (choosable via NVM; default 10)
  • NPM and YARN
  • Maven
  • Build Tools like gcc (required for some node dependencies)

Additional software list inside full variant

  • Docker CE
  • Firefox (bootstrap only)
  • JMeter (bootstrap only)
  • skopeo
  • jq
  • rush

We try to avoid version pinning. Prepare to always get the latest version.

Tags

Name Description Size
latest alias of full
full includes browser
light without browser and additional tools
YYYYMM Monthly Snapshots -

CI Examples

Use Java 11 in your job

Create a file calling .jabbarc in the project root with this content

and use jabba use inside your CI.

More informations: https://github.com/shyiko/jabba

Use Node 10 in your job

Create a file calling .nvmrc in the project root with this content

10

and use nvm use inside your CI.

More informations: https://github.com/creationix/nvm

Best Practice default options for maven

Based on the recommendation from Gitlab CI. It avoid all the spammy transfer output

variables:
  MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true"
  MAVEN_OPTS: "-Dhttps.protocols=TLSv1.2 -Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true"

Copy Images without Docker

  script:
# From Gitlab to Openshift
    - >-
      skopeo copy
      --src-creds=${CI_REGISTRY_USER}:${CI_REGISTRY_PASSWORD}
      --dest-creds=openshift:${OPENSHIFT_TOKEN}
      "docker://${OPENSHIFT_REGISTRY}/namespace/image:${CI_COMMIT_REF_NAME}"
      "docker://${HARBOR_REGISTRY}/project/imagename:${CI_COMMIT_REF_NAME}"
# From Gitlab to Harbor
    - >-
      skopeo copy
      --src-creds=${CI_REGISTRY_USER}:${CI_REGISTRY_PASSWORD}
      --dest-creds=${HARBOR_USER}:${HARBOR_TOKEN}
      "docker://${CI_REGISTRY_IMAGE}:${CI_COMMIT_TAG}"
      "docker://${HARBOR_REGISTRY}/project/imagename:${CI_COMMIT_TAG}"
# From Openshift to Harbor
    - >-
      skopeo copy
      --src-creds=openshift:${OPENSHIFT_TOKEN}
      --dest-creds=${HARBOR_USER}:${HARBOR_TOKEN}
      "docker://${OPENSHIFT_REGISTRY}/namespace/image:${CI_COMMIT_TAG}"
      "docker://${HARBOR_REGISTRY}/project/imagename:${CI_COMMIT_TAG}"

User docker caching to reuse exists layers

  script:
    - >-
      docker pull "${CI_REGISTRY_IMAGE}/${IMAGE_NAME}:${CI_COMMIT_TAG:-$CI_COMMIT_REF_SLUG}" 
      || docker pull "${CI_REGISTRY_IMAGE}/${IMAGE_NAME}:develop" 
      || true
    - >-
      docker build --pull
      --cache-from "${CI_REGISTRY_IMAGE}/${IMAGE_NAME}:${CI_COMMIT_TAG:-$CI_COMMIT_REF_SLUG}"
      --cache-from "${CI_REGISTRY_IMAGE}/${IMAGE_NAME}:develop"
      -t "${CI_REGISTRY_IMAGE}/${IMAGE_NAME}:${CI_COMMIT_TAG:-$CI_COMMIT_REF_SLUG}" .
    - docker push "${CI_REGISTRY_IMAGE}/${IMAGE_NAME}:${CI_COMMIT_TAG:-$CI_COMMIT_REF_SLUG}"