Skip to content
Snippets Groups Projects
Commit 95cc862c authored by Dean Lovett's avatar Dean Lovett
Browse files

Initial Commit

feat: Added dind


wefe


fewfew


ffe


fix: dockerfile


ewggwegwe

wegew
removed release
parent 7ceaa5ec
No related branches found
No related tags found
No related merge requests found
services:
- docker:dind
variables:
# explicit tag to be used within pipeline
BUILD_IMAGE_NAME: "$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG:$CI_COMMIT_SHA"
# we also publish a floating tag to simplify manual testing
BUILD_IMAGE_NAME_LATEST: "$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG:latest"
DOCKER_VERSION: 19.03.8
CI_APPLICATION_TAG: "$CI_COMMIT_SHA"
CI_APPLICATION_REPOSITORY: "$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG/$CI_JOB_NAME"
stages:
- build
- test
- release
include:
- local: .gitlab/ci/build.gitlab-ci.yml
- local: .gitlab/ci/test.gitlab-ci.yml
build:
stage: build
image: "docker:${DOCKER_VERSION}"
services:
- "docker:${DOCKER_VERSION}-dind"
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"
script:
- docker build --build-arg DOCKER_VERSION="$DOCKER_VERSION"
--tag "$BUILD_IMAGE_NAME"
--tag "$BUILD_IMAGE_NAME_LATEST"
.
- docker push "$BUILD_IMAGE_NAME"
- docker push "$BUILD_IMAGE_NAME_LATEST"
tags:
- nexus_runner
\ No newline at end of file
test-shellcheck:
stage: test
image: koalaman/shellcheck-alpine
needs: []
script:
- shellcheck src/build.sh
\ No newline at end of file
FROM docker:19.03.8
RUN apk add bash ruby wget
RUN wget https://github.com/buildpacks/pack/releases/download/v0.9.0/pack-v0.9.0-linux.tgz && \
tar xvf pack-v0.9.0-linux.tgz && \
rm pack-v0.9.0-linux.tgz && \
mv pack /usr/local/bin/pack
COPY src/ build/
CMD ["/build/build.sh"]
\ No newline at end of file
#!/bin/bash -e
if ! docker info &>/dev/null; then
if [ -z "$DOCKER_HOST" ] && [ "$KUBERNETES_PORT" ]; then
export DOCKER_HOST='tcp://localhost:2375'
fi
fi
if [[ -n "$CI_REGISTRY" && -n "$CI_REGISTRY_USER" ]]; then
echo "Logging to GitLab Container Registry with CI credentials..."
echo "$CI_REGISTRY_PASSWORD" | docker login -u "$CI_REGISTRY_USER" --password-stdin "$CI_REGISTRY"
fi
image_previous="$CI_APPLICATION_REPOSITORY:$CI_COMMIT_BEFORE_SHA"
image_tagged="$CI_APPLICATION_REPOSITORY:$CI_APPLICATION_TAG"
image_latest="$CI_APPLICATION_REPOSITORY:latest"
# pull images for cache - this is required, otherwise --cache-from will not work
docker image pull "$image_previous" || \
docker image pull "$image_latest" || \
true
docker build \
--cache-from "$image_previous" \
--cache-from "$image_latest" \
--build-arg BUILDPACK_URL="$BUILDPACK_URL" \
--build-arg HTTP_PROXY="$HTTP_PROXY" \
--build-arg HTTPS_PROXY="$HTTPS_PROXY" \
--build-arg FTP_PROXY="$FTP_PROXY" \
--build-arg NO_PROXY="$NO_PROXY" \
--tag "$CI_APPLICATION_REPOSITORY:$CI_APPLICATION_TAG" \
--tag "$image_latest" .
docker push "$image_tagged"
docker push "$image_latest"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment