Skip to content

Commit 1056e3b

Browse files
committed
fix
1 parent 53aaef8 commit 1056e3b

File tree

2 files changed

+9
-22
lines changed

2 files changed

+9
-22
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- name: Install dependencies
2626
run: |
2727
python -m pip install --upgrade pip
28-
python -m pip install docker boto3 click
28+
python -m pip install boto3 click
2929
3030
- name: Login to DockerHub
3131
uses: docker/login-action@v1
@@ -95,7 +95,13 @@ jobs:
9595
9696
- name: Build and Deploy layers
9797
if: github.ref == 'refs/heads/master'
98-
run: python scripts/deploy.py ${{ matrix.gdal-version }} ${{ matrix.image-name }} --deploy
98+
run: |
99+
docker run \
100+
-v ${{ github.workspace }}:/local --rm \
101+
lambgeo/lambda-gdal:${{ matrix.gdal-version }}${{ steps.amazonlinux.outputs.version }} \
102+
sh -c "sh /local/scripts/create-layer.sh"
103+
104+
python scripts/deploy.py ${{ matrix.gdal-version }} ${{ matrix.image-name }} --deploy
99105
100106
- name: Push to DockerHub
101107
if: github.ref == 'refs/heads/master'

scripts/deploy.py

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11

2-
3-
import os
42
import click
53

6-
import docker
7-
84
from boto3.session import Session as boto3_session
95
from botocore.client import Config
106

@@ -56,24 +52,9 @@
5652
@click.option('--deploy', is_flag=True)
5753
def main(gdalversion, alversion, deploy):
5854
"""Build and Deploy Layers."""
59-
client = docker.from_env()
60-
6155
version = "-al2" if alversion == "base-2" else ""
62-
runtimes = CompatibleRuntimes_al2 if alversion == "base-2" else CompatibleRuntimes_al1
6356

64-
docker_name = f"lambgeo/lambda-gdal:{gdalversion}{version}"
65-
66-
click.echo(f"Pulling docker image: {docker_name}...")
67-
client.images.pull(docker_name)
68-
69-
click.echo("Create Package")
70-
client.containers.run(
71-
image="layer:latest",
72-
command="/bin/sh /local/scripts/create-layer.sh",
73-
remove=True,
74-
volumes={os.path.abspath("./"): {"bind": "/local/", "mode": "rw"}},
75-
user=0,
76-
)
57+
runtimes = CompatibleRuntimes_al2 if alversion == "base-2" else CompatibleRuntimes_al1
7758

7859
gdalversion_nodot = gdalversion.replace(".", "")
7960
layer_name = f"gdal{gdalversion_nodot}{version}"

0 commit comments

Comments
 (0)