Skip to content
Snippets Groups Projects
This GitLab CI configuration is valid. Learn more
.gitlab-ci.yml 935 B
image: docker:18.09.7

stages:
  - build
  - test

services:
  - docker:18.09.7-dind

variables:
    DOCKER_DRIVER: overlay
    DOCKER_HOST: tcp://localhost:2375


push-image-to-registry:
  image: docker:18.09.7-dind
  stage: build

  script:
    - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
    - docker info
    - docker build --build-arg AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID --build-arg AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY --build-arg AWS_DEFAULT_REGION=$AWS_DEFAULT_REGION --network host --pull -t "$CI_REGISTRY/$CI_PROJECT_PATH:latest" .
    - docker push "$CI_REGISTRY/$CI_PROJECT_PATH:latest"

  only:
    - main

push-data-to-s3:
  image: python:3.7
  stage: test

  script:
    - pip3 install awscli
    - echo "Going to push data to s3"
    - aws s3 cp cwl s3://s3public/cwl/get-dem/ --recursive --endpoint https://oss.eu-west-0.prod-cloud-ocb.orange-business.com
  only:
    - main