binoy_shah
04/22/2022, 3:33 PMvisch
04/22/2022, 3:35 PMvisch
04/22/2022, 3:36 PMbinoy_shah
04/22/2022, 3:36 PMbinoy_shah
04/22/2022, 3:37 PMvisch
04/22/2022, 3:37 PMbinoy_shah
04/22/2022, 3:37 PMvisch
04/22/2022, 3:38 PMbinoy_shah
04/22/2022, 3:38 PMvisch
04/22/2022, 3:39 PMbinoy_shah
04/22/2022, 3:39 PMvisch
04/22/2022, 3:40 PMvisch
04/22/2022, 3:40 PMvisch
04/22/2022, 3:40 PMbinoy_shah
04/22/2022, 3:41 PMmeltano.yml file in your mono-repo ?visch
04/22/2022, 3:42 PMbinoy_shah
04/22/2022, 3:42 PMvisch
04/22/2022, 3:42 PMvisch
04/22/2022, 3:42 PMbinoy_shah
04/22/2022, 3:42 PMbinoy_shah
04/22/2022, 3:43 PMvisch
04/22/2022, 3:43 PMbinoy_shah
04/22/2022, 3:44 PMvisch
04/22/2022, 3:44 PMbinoy_shah
04/22/2022, 3:45 PMbinoy_shah
04/22/2022, 3:45 PMvisch
04/22/2022, 3:46 PMvisch
04/22/2022, 3:46 PMbinoy_shah
04/22/2022, 3:46 PMvisch
04/22/2022, 3:46 PMbinoy_shah
04/22/2022, 3:47 PMvisch
04/22/2022, 3:47 PMstages:
- build
- run
#Only triggered via a scheduled run. We pull the latest Docker image to run the job with
#Using the docker image is faster to run as we don't have to install meltano or the tap/target packages
runner:
image:
name: $CI_REGISTRY_IMAGE:latest
entrypoint: [""]
before_script:
- cp -Rn /project/. . #Copy meltano project into image
stage: run
variables:
TARGET_POSTGRES_PASSWORD: $TAP_POSTGRES_PASSWORD
TARGET_POSTGRES_HOST: $TAP_POSTGRES_HOST
DBT_HOST: $TAP_POSTGRES_HOST
DBT_PASSWORD: $TAP_POSTGRES_PASSWORD
POSTGRES_PASSWORD: $TAP_POSTGRES_PASSWORD
services:
- name: postgres
script:
- "meltano run tap-toggl target-postgres dbt:run tap-postgres target-apprise"
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"binoy_shah
04/22/2022, 3:47 PMvisch
04/22/2022, 3:47 PMvisch
04/22/2022, 3:47 PMstages:
- build
- run
#Only triggered via a scheduled run. We pull the latest Docker image to run the job with
#Using the docker image is faster to run as we don't have to install meltano or the tap/target packages
runner:
image:
name: $CI_REGISTRY_IMAGE:latest
entrypoint: [""]
before_script:
- cp -Rn /project/. . #Copy meltano project into image
stage: run
variables:
TARGET_POSTGRES_PASSWORD: $TAP_POSTGRES_PASSWORD
TARGET_POSTGRES_HOST: $TAP_POSTGRES_HOST
DBT_HOST: $TAP_POSTGRES_HOST
DBT_PASSWORD: $TAP_POSTGRES_PASSWORD
POSTGRES_PASSWORD: $TAP_POSTGRES_PASSWORD
services:
- name: postgres
script:
- "meltano run tap-toggl target-postgres dbt:run tap-postgres target-apprise"
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
# Tags <project>:<sha>
# Tags <project>:<ref> (<branch> or <tag>)
# Tags <project>:latest
# Saves us time by building the Docker file once when things change. Runner runs a lot (every 15 minutes or so), docker-build-latest runs infreqently
docker-build-latest:
stage: build
image: docker:stable
variables:
DOCKER_DRIVER: overlay2
MELTANO_IMAGE: meltano/meltano
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker pull $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME || true
services: ["docker:dind"]
script:
- >
docker build
--cache-from $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
--tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
--tag $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
--build-arg MELTANO_IMAGE=$MELTANO_IMAGE
.
- docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA $CI_REGISTRY_IMAGE:latest
- docker push $CI_REGISTRY_IMAGE:latest
rules:
- if: $CI_COMMIT_BRANCH == "main" && $CI_PIPELINE_SOURCE != "schedule"visch
04/22/2022, 3:48 PMvisch
04/22/2022, 3:48 PMbinoy_shah
04/22/2022, 3:49 PMvisch
04/22/2022, 3:49 PMbinoy_shah
04/22/2022, 3:49 PMbinoy_shah
04/22/2022, 3:50 PMvisch
04/22/2022, 3:50 PMbinoy_shah
04/22/2022, 3:51 PMlatest i am guessingvisch
04/22/2022, 3:51 PM- docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA $CI_REGISTRY_IMAGE:latest
- docker push $CI_REGISTRY_IMAGE:latest
Note that this docker stuff comes from Meltano's file-docker stuffvisch
04/22/2022, 3:52 PMvisch
04/22/2022, 3:52 PMbinoy_shah
04/22/2022, 3:59 PM