From 05bf18ea4c074097d809c2d6d238a1636b16285a Mon Sep 17 00:00:00 2001 From: Beatriz Fernandes Date: Tue, 25 Jun 2024 14:44:54 +0000 Subject: [PATCH] Fix isoline herev8 --- .gitlab-ci.yml | 62 +++++++++++++++++++++++++++++++++++++++++++ ci-utils/build_app.sh | 9 +++++++ wrappers/here8.rb | 3 +-- 3 files changed, 72 insertions(+), 2 deletions(-) create mode 100644 .gitlab-ci.yml create mode 100755 ci-utils/build_app.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..2532d1d --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,62 @@ +image: docker:latest + +services: + - docker:dind + +variables: + PROJECT_NAME: ${CI_PROJECT_NAME} + REGISTRY_URL: registry.mapotempo.com + +stages: + - deliver + +workflow: + rules: + - if: $CI_COMMIT_TAG + - if: $CI_COMMIT_BRANCH + +Deliver API: + image: carlallen/docker:buildx + stage: deliver + cache: + - key: + files: + - Gemfile.lock + prefix: ${CI_PROJECT_NAME} + paths: + - vendor/bundle + when: "always" + - key: ${CI_PROJECT_NAME} + paths: + - .buildx-cache + when: "always" + services: + - docker:dind + environment: + name: ${CI_COMMIT_REF_NAME} + variables: + DOCKER_DRIVER: overlay2 + DOCKER_HOST: tcp://docker:2375 + before_script: + - apk update > /dev/null && apk add git bash jq curl rsync > /dev/null + - docker login -u $USER -p $PASSWORD $REGISTRY_URL + script: + - | + DOCKER_FILE='./Dockerfile' \ + ci-utils/build_app.sh + rules: + - if: $CI_COMMIT_TAG + - if: $CI_COMMIT_BRANCH =~ /^(alpha|beta|prod)/ + # changes: + # - api/**/* + # - config/environments/**/* + # - config/initializers/**/* + # - config/locales/**/* + # - docker/Dockerfile + # - docker/env.d/**/* + # - docker/snippets/**/* + # - docker/webapp.conf + # - lib/**/* + # - public/**/* + # - wrappers/**/* + when: always diff --git a/ci-utils/build_app.sh b/ci-utils/build_app.sh new file mode 100755 index 0000000..238ee1f --- /dev/null +++ b/ci-utils/build_app.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +echo "SLACK_CHANNELS: $SLACK_CHANNELS" +echo "PROJECT_NAME: $PROJECT_NAME" + +git clone --depth 1 --single-branch --branch "${BRANCH:-master}" "https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.com/${GITLAB_USER}/ci-utils.git" ci-tmp +rsync -a ci-tmp/* ./ci-utils + +./ci-utils/build_and_push.sh "${PROJECT_NAME}" "${SLACK_CHANNELS}" diff --git a/wrappers/here8.rb b/wrappers/here8.rb index 3da91bf..3110098 100644 --- a/wrappers/here8.rb +++ b/wrappers/here8.rb @@ -26,8 +26,7 @@ def initialize(cache, hash = {}) super(cache, hash) @url_router = 'https://router.hereapi.com' @url_matrix = 'https://matrix.router.hereapi.com' - @url_isoline = 'https://isoline.route.api.here.com/routing' - @url_tce = 'https://tce.api.here.com' + @url_isoline = 'https://isoline.router.hereapi.com' @apikey = hash[:apikey] @mode = hash[:mode] @over_400km = hash[:over_400km]