Skip to content

Commit

Permalink
debug(ci:gitlab): LS service debug
Browse files Browse the repository at this point in the history
  • Loading branch information
lakkeger committed Feb 15, 2024
1 parent b635929 commit d8e94a7
Showing 1 changed file with 41 additions and 23 deletions.
64 changes: 41 additions & 23 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
image: "python:3.9.16"
image: docker:20.10.16-dind

stages:
- deploy
Expand All @@ -10,30 +10,46 @@ variables:
AWS_DEFAULT_REGION: us-east-1
AWS_REGION: us-east-1
AWS_ENDPOINT_URL: http://localhost.localstack.cloud:4566
DEBUG: 1
LS_LOG: "trace"
PIP_CACHE_DIR: $CI_PROJECT_DIR/.cache/pip
LOCALSTACK_AUTH_TOKEN: $LOCALSTACK_AUTH_TOKEN
LOCALSTACK_AUTH_TOKEN: '${LS_AUTH_TOKEN}'
DEBUG: '${DEBUG}'
DOCKER_HOST: tcp://docker:2375
DOCKER_TLS_CERTDIR: ""

services:
- name: docker:20.10.16-dind
alias: docker
command: ["--tls=false"]

default:
services:
- name: docker:20.10.21-dind-alpine3.17
alias: docker
command: ["--tls=false"]
- name: localstack/localstack-pro:latest
alias: localstack
variables:
DOCKER_HOST: tcp://docker:2375
DOCKER_TLS_CERTDIR: ""
DOCKER_TLS_VERIFY: "false"
before_script:
- mkdir -p $CI_PROJECT_DIR/.cache/pip
- apt-get update && apt-get install -y zip jq
- pip install localstack
- pip install -r requirements-dev.txt
- LS_IP="$(getent hosts localstack | cut -d' ' -f1)"
- echo "${LS_IP} localhost.localstack.cloud " >> /etc/hosts
before_script: &default_before_scripts
- apk update
- apk add --no-cache gcc musl-dev linux-headers bash zip jq
- apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/v3.15/main python3~3.9 python3-dev~3.9 py3-packaging~20.9 py3-setuptools~52 py3-requests~2.26
- apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/v3.15/community py3-pip~20.3 py3-distro~1.6
- mkdir -p $PIP_CACHE_DIR
- python3 -m pip install localstack awscli awscli-local
- docker pull localstack/localstack-pro:latest
- dind_ip="$(getent hosts docker | cut -d' ' -f1)"
- echo "${dind_ip} localhost.localstack.cloud " >> /etc/hosts
- localstack start -d
- localstack wait -t 30
- (test -f ./ls-state-pod.zip && localstack state import ./ls-state-pod.zip) || true
# - apt-get update && apt-get install -y ca-certificates curl
# - install -m 0755 -d /etc/apt/keyrings
# - curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
# - chmod a+r /etc/apt/keyrings/docker.asc
# - echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
# - apt-get update
# - apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
# - apt-get install -y zip jq
# - mkdir -p $PIP_CACHE_DIR
# - pip install localstack
# - pip install -r requirements-dev.txt
# - DIND_IP="$(getent hosts docker | cut -d' ' -f1)"
# - echo "${DIND_IP} localhost.localstack.cloud " >> /etc/hosts
# - localstack start -d
# - (test -f ./ls-state-pod.zip && localstack state import ./ls-state-pod.zip) || true
cache:
paths:
- $CI_PROJECT_DIR/.cache/pip
Expand All @@ -50,6 +66,8 @@ deploy:

test:
stage: test
allow_failure: true
before_script:
- *default_before_scripts
- python3 -m pip install -r requirements-dev.txt
script:
- pytest tests
- python3 -m pytest tests

0 comments on commit d8e94a7

Please sign in to comment.