File tree Expand file tree Collapse file tree 2 files changed +9
-22
lines changed
Expand file tree Collapse file tree 2 files changed +9
-22
lines changed Original file line number Diff line number Diff line change 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
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'
Original file line number Diff line number Diff line change 11
2-
3- import os
42import click
53
6- import docker
7-
84from boto3 .session import Session as boto3_session
95from botocore .client import Config
106
5652@click .option ('--deploy' , is_flag = True )
5753def 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 } "
You can’t perform that action at this time.
0 commit comments