Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scratch #507

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
# From
# https://github.com/GoogleCloudPlatform/cloud-foundation-toolkit/blob/master/infra/terraform/modules/lint_file/lint.yaml.tftpl

name: 'lint'

name: 'testing lint'
run-name: 'testing lint run-name parameter'
on:
pull_request:
branches:
Expand All @@ -27,7 +27,7 @@ concurrency:
cancel-in-progress: true

jobs:
lint:
lint-everything:
name: 'lint'
runs-on: 'ubuntu-latest'
steps:
Expand All @@ -36,11 +36,19 @@ jobs:
run: |
MAKEFILE=$(find . -name Makefile -print -quit)
if [ ! -z "$MAKEFILE" ]; then
echo MAKEFILE not null: $MAKEFILE
cat $MAKEFILE
echo dev-tools=gcr.io/cloud-foundation-cicd/cft/developer-tools:1 >> "$GITHUB_OUTPUT"
cat $GITHUB_OUTPUT
else
echo MAKEFILE is null
VERSION=$(grep "DOCKER_TAG_VERSION_DEVELOPER_TOOLS := " $MAKEFILE | cut -d\ -f3)
echo VERSION $VERSION
IMAGE=$(grep "DOCKER_IMAGE_DEVELOPER_TOOLS := " $MAKEFILE | cut -d\ -f3)
echo IMAGE $IMAGE
REGISTRY=$(grep "REGISTRY_URL := " $MAKEFILE | cut -d\ -f3)
echo REGISTRY $REGISTRY
echo dev-tools=${REGISTRY}/${IMAGE}:${VERSION} >> "$GITHUB_OUTPUT"
cat $GITHUB_OUTPUT
fi
- run: docker run --rm -v ${{ github.workspace }}:/workspace ${{ steps.variables.outputs.dev-tools }} /usr/local/bin/test_lint.sh
85 changes: 43 additions & 42 deletions build/int.cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,45 +15,46 @@
timeout: 14400s
steps:
- id: prepare
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && prepare_environment']
env:
- 'TF_VAR_org_id=$_ORG_ID'
- 'TF_VAR_folder_id=$_FOLDER_ID'
- 'TF_VAR_billing_account=$_BILLING_ACCOUNT'
- id: init
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
args: ['/bin/bash', '-c', 'RUN_STAGE=init go test -v -timeout 0']
dir: test/integration
waitFor:
- prepare
- id: test-samples-0
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
args: ['/bin/bash', '-c', 'go test -v -timeout 0 -run TestSamples/0']
dir: test/integration
waitFor:
- init
- id: test-samples-1
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
args: ['/bin/bash', '-c', 'go test -v -timeout 0 -run TestSamples/1']
dir: test/integration
waitFor:
- init
- id: test-samples-2
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
args: ['/bin/bash', '-c', 'go test -v -timeout 0 -run TestSamples/2']
dir: test/integration
waitFor:
- init
- id: test-samples-3
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
args: ['/bin/bash', '-c', 'go test -v -timeout 0 -run TestSamples/3']
dir: test/integration
waitFor:
- init
tags:
- 'ci'
- 'integration'
substitutions:
_DOCKER_IMAGE_DEVELOPER_TOOLS: 'cft/developer-tools'
_DOCKER_TAG_VERSION_DEVELOPER_TOOLS: '1'
name: 'gcr.io/cloud-foundation-cicd/cft/developer-tools:1.16.5'
# args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && prepare_environment']
args: ['/bin/bash', '-c', 'ls']
# env:
# - 'TF_VAR_org_id=$_ORG_ID'
# - 'TF_VAR_folder_id=$_FOLDER_ID'
# - 'TF_VAR_billing_account=$_BILLING_ACCOUNT'
# - id: init
# name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
# args: ['/bin/bash', '-c', 'RUN_STAGE=init go test -v -timeout 0']
# dir: test/integration
# waitFor:
# - prepare
# - id: test-samples-0
# name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
# args: ['/bin/bash', '-c', 'go test -v -timeout 0 -run TestSamples/0']
# dir: test/integration
# waitFor:
# - init
# - id: test-samples-1
# name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
# args: ['/bin/bash', '-c', 'go test -v -timeout 0 -run TestSamples/1']
# dir: test/integration
# waitFor:
# - init
# - id: test-samples-2
# name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
# args: ['/bin/bash', '-c', 'go test -v -timeout 0 -run TestSamples/2']
# dir: test/integration
# waitFor:
# - init
# - id: test-samples-3
# name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
# args: ['/bin/bash', '-c', 'go test -v -timeout 0 -run TestSamples/3']
# dir: test/integration
# waitFor:
# - init
# tags:
# - 'ci'
# - 'integration'
# substitutions:
# _DOCKER_IMAGE_DEVELOPER_TOOLS: 'cft/developer-tools'
# _DOCKER_TAG_VERSION_DEVELOPER_TOOLS: '1'