Skip to content

Commit b805ac2

Browse files
authored
Fix gitlabci (#29)
1 parent ac318de commit b805ac2

File tree

5 files changed

+37
-15
lines changed

5 files changed

+37
-15
lines changed

.github/workflows/cloudpod_release.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ on:
77
description: This will be the version of the release, but will also be used as 'tag' for the localstack docker image
88
push:
99
paths-ignore:
10-
- 'README.md'
10+
- ./*.md
11+
- LICENSE
12+
- .circleci/*
13+
- .gitlab-ci.yml
1114
branches:
1215
- main
1316

.github/workflows/integration-test.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ name: Run Integration Tests
33
on:
44
push:
55
paths-ignore:
6-
- 'README.md'
6+
- ./*.md
7+
- LICENSE
8+
- .circleci/*
9+
- .gitlab-ci.yml
710
branches:
811
- main
912
pull_request:

.github/workflows/preview_create.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ name: Create PR Preview
33
on:
44
pull_request:
55
types: [opened, synchronize, reopened]
6+
paths-ignore:
7+
- ./*.md
8+
- LICENSE
9+
- .circleci/*
10+
- .gitlab-ci.yml
611

712
jobs:
813
test:

.gitlab-ci.yml

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
image: docker:20.10.16-dind
1+
image: docker:24.0.7-dind-alpine3.18 # Alpine 3.18's repo contains by default Python v3.11.8
22

33
stages:
44
- deploy
@@ -15,18 +15,17 @@ variables:
1515
DOCKER_TLS_CERTDIR: ""
1616
DEBUG: 1
1717
LS_LOG: trace
18+
LAMBDA_RUNTIME_ENVIRONMENT_TIMEOUT: 300
1819

1920
services:
20-
- name: docker:20.10.16-dind
21+
- name: docker:24.0.7-dind-alpine3.18
2122
alias: docker
2223
command: ["--tls=false"]
2324

2425
default:
2526
before_script: &default_before_scripts
2627
- apk update
27-
- apk add --no-cache gcc musl-dev linux-headers bash zip jq curl
28-
- apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/v3.15/main python3~3.9
29-
- apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/v3.15/community py3-psutil~5.8
28+
- apk add --no-cache gcc musl-dev linux-headers bash zip jq curl py3-psutil python3
3029
- python3 -m ensurepip
3130
- python3 -m pip install --no-cache --upgrade pip setuptools
3231
- mkdir -p $PIP_CACHE_DIR
@@ -37,10 +36,6 @@ default:
3736
- localstack start -d
3837
- localstack wait -t 30
3938
- (test -f ./ls-state-pod.zip && localstack state import ./ls-state-pod.zip) || true
40-
after_script:
41-
- curl "$AWS_ENDPOINT_URL/_localstack/diagnose" | tee ls_diagnose.log
42-
- docker ps | tee docker_ps.log
43-
- docker inspect localstack-main | tee docker_inspect.log
4439
cache:
4540
paths:
4641
- $CI_PROJECT_DIR/.cache/pip
@@ -51,15 +46,31 @@ default:
5146

5247
deploy:
5348
stage: deploy
49+
rules:
50+
- when: never
51+
changes:
52+
- ./*.md
53+
- LICENSE
54+
- .circleci/*
55+
- .github/*
56+
- when: always
5457
script:
5558
- ./bin/deploy.sh
5659
- localstack state export ./ls-state-pod.zip
60+
- localstack logs
5761

5862
test:
5963
stage: test
64+
rules:
65+
- when: never
66+
changes:
67+
- ./*.md
68+
- LICENSE
69+
- .circleci/*
70+
- .github/*
71+
- when: always
6072
before_script:
6173
- *default_before_scripts
6274
- python3 -m pip install -r requirements-dev.txt
6375
script:
64-
- python3 -m pytest tests
65-
76+
- python3 -m pytest tests || (localstack logs && exit 1)

bin/deploy.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ if [ "$os" == "Darwin" ]; then
5151
(
5252
cd lambdas/resize
5353
rm -rf libs lambda.zip
54-
docker run --platform linux/x86_64 --rm -v "$PWD":/var/task "public.ecr.aws/sam/build-python3.11" /bin/sh -c "pip install -r requirements.txt -t libs; exit"
54+
docker run --platform linux/x86_64 --rm -v "$PWD":/var/task "public.ecr.aws/sam/build-python3.11" /bin/sh -c "pip3 install -r requirements.txt -t libs; exit"
5555

5656
cd libs && zip -r ../lambda.zip . && cd ..
5757
zip lambda.zip handler.py
@@ -62,7 +62,7 @@ else
6262
cd lambdas/resize
6363
rm -rf package lambda.zip
6464
mkdir package
65-
pip install -r requirements.txt --platform manylinux2014_x86_64 --only-binary=:all: -t package
65+
pip3 install -r requirements.txt --platform manylinux2014_x86_64 --only-binary=:all: -t package
6666
zip lambda.zip handler.py
6767
cd package
6868
zip -r ../lambda.zip *;

0 commit comments

Comments
 (0)