https://hub.docker.com/r/adorsys/ci-build/
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)
We try to avoid version pinning. Prepare to always get the latest version.
Name | Description | Size |
---|---|---|
latest | alias of full | |
full | includes browser | |
light | without browser and additional tools | |
YYYYMM | Monthly Snapshots | - |
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
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
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"
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}"
- This technique requires reproducible builds.
- Angular creates reproducible out of the box
- Java projects using maven require a maven plugin https://zlika.github.io/reproducible-build-maven-plugin/
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}"