Skip to content
Snippets Groups Projects
Commit 06b48407 authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

Update .gitlab-ci.yml

parent e217d813
No related branches found
No related tags found
1 merge request!5Resolve "Make Proxy Use Autodevops"
......@@ -22,75 +22,4 @@ prepare_node:
- npm install
only:
- branches
- tags
build:
stage: build
image: "registry.gitlab.com/gitlab-org/cluster-integration/auto-build-image/master:stable"
variables:
DOCKER_TLS_CERTDIR: ""
services:
- docker:stable-dind
script:
- |
if [[ -z "$CI_COMMIT_TAG" ]]; then
export CI_APPLICATION_REPOSITORY=${CI_APPLICATION_REPOSITORY:-$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG}
export CI_APPLICATION_TAG=${CI_APPLICATION_TAG:-$CI_COMMIT_SHA}
else
export CI_APPLICATION_REPOSITORY=${CI_APPLICATION_REPOSITORY:-$CI_REGISTRY_IMAGE}
export CI_APPLICATION_TAG=${CI_APPLICATION_TAG:-$CI_COMMIT_TAG}
fi
- |
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..."
docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"
fi
if [[ -f Dockerfile ]]; then
echo "Building Dockerfile-based application..."
else
echo "Building Heroku-based application using gliderlabs/herokuish docker image..."
cp /build/Dockerfile Dockerfile
fi
# Build the dependencies
- docker run --dns=1.1.1.1 --rm -v "$PWD":/usr/src/app -w /usr/src/app node:10 bash -c "npm install prod --verbose && npm run prod"
- docker run --dns=1.1.1.1 --rm -v $(pwd):/app composer/composer:latest install
- docker pull $CI_APPLICATION_REPOSITORY:latest || true
- |
docker build \
--cache-from $CI_APPLICATION_REPOSITORY:latest \
--build-arg BUILDPACK_URL="$BUILDPACK_URL" \
--build-arg HTTP_PROXY="$HTTP_PROXY" \
--build-arg http_proxy="$http_proxy" \
--build-arg HTTPS_PROXY="$HTTPS_PROXY" \
--build-arg https_proxy="$https_proxy" \
--build-arg FTP_PROXY="$FTP_PROXY" \
--build-arg ftp_proxy="$ftp_proxy" \
--build-arg NO_PROXY="$NO_PROXY" \
--build-arg no_proxy="$no_proxy" \
$AUTO_DEVOPS_BUILD_IMAGE_EXTRA_ARGS \
--tag "$CI_APPLICATION_REPOSITORY:$CI_APPLICATION_TAG" \
--tag "$CI_APPLICATION_REPOSITORY:latest" .
- docker push "$CI_APPLICATION_REPOSITORY:latest"
- docker push "$CI_APPLICATION_REPOSITORY:$CI_APPLICATION_TAG"
only:
- branches
- tags
review:
variables:
AUTO_DEVOPS_BUILD_IMAGE_EXTRA_ARGS: --cache-from $CI_APPLICATION_REPOSITORY:$CI_APPLICATION_TAG
HELM_UPGRADE_EXTRA_ARGS: --set service.internalPort=80 --set service.commonName= --set ingress.tls.enabled=false --set ingress.annotations.kubernetes\.io/tls-acme="false" --set ingress.annotations.nginx\.ingress\.kubernetes\.io/ssl-redirect="false"
production:
variables:
HELM_UPGRADE_EXTRA_ARGS: --set service.internalPort=80 --set service.commonName= --set ingress.annotations.certmanager\.k8s\.io/cluster-issuer=letsencrypt-prod
environment:
url: https://proxy.metager.de
- tags
\ No newline at end of file
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