Home

Awesome

Python application test with Github Actions

gcp-from-zero

This is a new repo

First thing to do is DevOps Workflow

ssh-keygen -t rsa

Give github this content: cat /home/ec2-user/.ssh/id_rsa.pub

Then checkout the code.

  1. Create virtualenv

virtualenv ~/.gcp-from-zero

  1. Source it

source ~/.gcp-from-zero/bin/activate

To integrate Cloud Build instead of Github Actions

Example here: cloudbuild.yaml

steps:
- name: python:3.7
  id: INSTALL
  entrypoint: python3
  args:
  - '-m'
  - 'pip'
  - 'install'
  - '-t'
  - '.'
  - '-r'
  - 'requirements.txt'
- name: python:3.7
  entrypoint: ./pylint_runner
  id: LINT
  waitFor:
  - INSTALL
- name: "gcr.io/cloud-builders/gcloud"
  args: ["app", "deploy"]
timeout: "1600s"
images: ['gcr.io/$PROJECT_ID/pylint']