1008: Implement on LocalStack

Signed-off-by: Guillaume de Rouville <guillaume.derouville@gmail.com>
This commit is contained in:
Guillaume de Rouville 2021-08-20 16:09:35 +02:00
parent 4d03638911
commit 6ef0cfe321
4 changed files with 35 additions and 5 deletions

View File

@ -189,6 +189,22 @@ jobs:
name: Documentation name: Documentation
runs-on: ubuntu-latest runs-on: ubuntu-latest
timeout-minutes: 30 timeout-minutes: 30
services:
localstack:
image: localstack/localstack:0.12.16
env:
SERVICES: s3, cloudformation
LOCALSTACK_API_KEY: ${{ secrets.LOCALSTACK_API_KEY }}
ports:
- 4566:4566
- 4571:4571
options: >-
--health-cmd "curl -f http://localhost:4566/health"
--health-start-period 5s
--health-timeout 5s
--health-interval 5s
--health-retries 10
steps: steps:
- name: Check out - name: Check out
uses: actions/checkout@v2 uses: actions/checkout@v2

View File

@ -3,11 +3,13 @@ plan:
name: cloudformation name: cloudformation
inputs: inputs:
awsConfig.accessKey: awsConfig.accessKey:
secret: ENC[AES256_GCM,data:MJSSjaXpMawrpM5trPQzZR2Cg/M=,iv:D8Ff3Uy8hpzFPKg+okFkVM5DRam9Dyk31GjIizklvP0=,tag:J/7/+xjHdy94mYTQmB0sUw==,type:str] secret: ENC[AES256_GCM,data:HaGzSQ==,iv:FzsuSq7ZKttWs0WDC0q+vT/hxUx+WcQ4iy7vnV+Q8Dg=,tag:Oy9Xxq+4LMVkXkF/3ZjjsA==,type:str]
awsConfig.localMode:
text: "true"
awsConfig.region: awsConfig.region:
text: us-east-2 text: us-east-2
awsConfig.secretKey: awsConfig.secretKey:
secret: ENC[AES256_GCM,data:BnBc29SIbLj3DDWwpem7mcLQSPoP6a/opqIYxLZyQPdSJojL/Jy9jA==,iv:nK3mj7jOgJdAwcO2i5OYj1FxHsYnoodyXMih9eqLnOQ=,tag:1zaXCkwL8d8ilyxCGzPN6Q==,type:str] secret: ENC[AES256_GCM,data:aHDXVQ==,iv:ZEA4JLLedUvITocXE5G4Ar6pDNilyvgdvEYsMy/LVIk=,tag:BALivFcV0xBQD//qvo0aUw==,type:str]
cfnStack.onFailure: cfnStack.onFailure:
text: DELETE text: DELETE
sops: sops:
@ -25,8 +27,8 @@ sops:
Lzd0bU1qMXF0dzIzTG05cmlzZURxUncKp2wNXD/HKXgGv16pM/yvaYfWL5lsQyWo Lzd0bU1qMXF0dzIzTG05cmlzZURxUncKp2wNXD/HKXgGv16pM/yvaYfWL5lsQyWo
CDsT4rHHMZ21XtS9W+7oL9IqMMmDUQf6RZgDgoqLVmTjdBeA8yB2yg== CDsT4rHHMZ21XtS9W+7oL9IqMMmDUQf6RZgDgoqLVmTjdBeA8yB2yg==
-----END AGE ENCRYPTED FILE----- -----END AGE ENCRYPTED FILE-----
lastmodified: "2021-08-13T02:12:09Z" lastmodified: "2021-08-20T13:10:08Z"
mac: ENC[AES256_GCM,data:tZ35vWWlepyQOuKtzO1pau51YQZZ+Lg2LKK9PlSJvJZYzp+QaUVMCsoTAkZXgMH12C9ced6Jo1pfV9kQjxG1/g+5JmjgClFCWCMTIRa8Z9iI3hGu35SjxG4KVRlmeZsjstEW+78JBOekBUWYzkX0vAlKq44qLLug3FDc+sxFetQ=,iv:yB85C7b5X4y/koB3zN3ktUoYrYdB7N07FvJigwjxao0=,tag:3PSTd39bLyPRa4uZzHycjg==,type:str] mac: ENC[AES256_GCM,data:UIhYTG5ofk04dPLOaYiryOt/JC+8/ousZlGpotAAenHOYVo0FChYKywofquOVlpqdC0a/wT6eEz59ofpxDuzV/8/Qh/5MumHqfJUYtQezQYVhreLpWdLsHTn99Ndqjzhj+on9ODumqsAOM+PgVEKRTxSHtTOZB8i4gfO77hg5nk=,iv:E11iRe9z+PxHCy9qtnEYVv+uXVxn1CfAqIgGspd5ObM=,tag:PzORtWy+xVwXof5nbHrDDw==,type:str]
pgp: [] pgp: []
encrypted_suffix: secret encrypted_suffix: secret
version: 3.7.1 version: 3.7.1

View File

@ -163,6 +163,7 @@ setup() {
} }
@test "doc-1008-aws-cloudformation" { @test "doc-1008-aws-cloudformation" {
skip_unless_local_localstack
setup_example_sandbox "doc" setup_example_sandbox "doc"
### Create a basic plan ### Create a basic plan
@ -236,7 +237,7 @@ setup() {
mkdir workspace mkdir workspace
cd workspace cd workspace
# Writing the package # Writing package
dagger init dagger init
mkdir -p cue.mod/pkg/github.com/tjovicic/gcpcloudrun mkdir -p cue.mod/pkg/github.com/tjovicic/gcpcloudrun
cp $CODEBLOC_SRC/dev-cue-package/source.cue cue.mod/pkg/github.com/tjovicic/gcpcloudrun/source.cue cp $CODEBLOC_SRC/dev-cue-package/source.cue cue.mod/pkg/github.com/tjovicic/gcpcloudrun/source.cue

View File

@ -77,6 +77,17 @@ copy_to_sandbox() {
fi fi
} }
# Check if there is a localstack instance.
#
# This is needed to do docs test in the CI.
skip_unless_local_localstack() {
if [ "$(curl -s http://localhost:4566)" = '{"status": "running"}' ]; then
echo "Localstack available"
else
skip "Localstack not available"
fi
}
# Check if there is a local kubernetes cluster. # Check if there is a local kubernetes cluster.
# #
# This is need to do kubernetes test in the CI. # This is need to do kubernetes test in the CI.