appengine

command module
v0.0.0-...-25ad870 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 6, 2020 License: MIT Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

go-appengine

go-appengine 환경 구성

##########
# 작업환경1 - google clould 접속해서 작업하기
# google cloud console -> shell 접속

##########
# 작업환경2 - 로컬에서 작업하기
# go appengine sdk 다운로드 및 설치
# https://cloud.google.com/appengine/downloads
# mac
wget https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-228.0.0-darwin-x86_64.tar.gz
tar zxvf google-cloud-sdk-228.0.0-darwin-x86_64.tar.gz
# ./google-cloud-sdk/install.sh # 선택사항으로 특정 경로에 sdk 를 추가할때
export PATH=$PATH:~/workspace/google-cloud-sdk/bin
gcloud components install app-engine-go
GO111MODULE=on go get -u google.golang.org/appengine/...

# ubuntu
export CLOUD_SDK_REPO="cloud-sdk-$(lsb_release -c -s)"
echo "deb http://packages.cloud.google.com/apt $CLOUD_SDK_REPO main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
sudo apt-get update && sudo apt-get install google-cloud-sdk
sudo apt-get install google-cloud-sdk-app-engine-python google-cloud-sdk-app-engine-go google-cloud-sdk-datastore-emulator

appengine 관리

export GO111MODULE=on
# google cloud 올리기전에 로컬에서 테스트 해볼 수 있다.
# 아래 명령을 실행해두면 .go 소스 수정때마다 자동 빌드 된다.
dev_appserver.py app.yaml --port 9999

# google cloud 초기화
# url 링크 후 verification code 확인하여 입력
# 기존 프로젝트 또는 신규 프로젝트 생성 선택
# Compute Region and Zone 선택
gcloud init

# glcoud 구글 app engine 에 배포하기
# --promote 옵션을 사용하면 현재 배포된 버전으로 서비스(모든 트랙픽을 받는)하게 한다.
# 배포 종료시 접속 가능한 url 이 표시된다.
GO111MODULE=on gcloud app deploy ./app.yaml --promote

# 배포가 완료되면 확인
https:///ysoftman-test.appspot.com/

# 배포 후 접속 URL 확인 하기
gcloud app browse

# 앱 로그 확인
gcloud app logs tail -s default

firebase 업로드된 파일 사용

# firebae storage
# gs(googlestorage) url 과 일반 http url 로 파일에 접근할 수 있다.
https://console.firebase.google.com/project/ysoftman-test/storage/ysoftman-test.appspot.com/files

# gs(googlestorage) url 는 gsutil(google-cloud-sdk)로 접근할 수 있다.
# gsutil 명령어 참고
# https://cloud.google.com/storage/docs/gsutil/commands/cp
# gs(googlestorage) url 파일 보기
gsutil ls -ahl gs://ysoftman-test.appspot.com
# gs(googlestorage) url 파일로 로컬로 복사(다운로드)
gsutil cp -v gs://ysoftman-test.appspot.com/xelloss.jpg .

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL