Skip to content

Instantly share code, notes, and snippets.

View spyzhov's full-sized avatar
:octocat:

Stepan Pyzhov spyzhov

:octocat:
  • McMakler GmbH
  • Germany, Berlin
View GitHub Profile
@spyzhov
spyzhov / Dockerfile
Last active July 7, 2024 13:41
Build Golang application in Dockerfile, with private repositories in dependencies, without experimental features.
# NB! not for production!
# https://docs.docker.com/engine/reference/builder/#arg
# Warning: It is not recommended to use build-time variables for passing secrets like github keys, user credentials etc. Build-time variable values are visible to any user of the image with the docker history command.
FROM golang:1.13 as builder
# This argument should be defined as your personal access tokens, from: https://github.com/settings/tokens
ARG GITHUB_ACCESS_TOKEN
# Any kind of configurations:
ENV GO111MODULE=on

HOWTO: Install XHProf

1. Add php extension

Go to the Dockerfile.dev and add lines:

# Install XHProf
RUN cd /root && \
    curl "https://github.com/tideways/php-xhprof-extension/archive/v5.0.0.tar.gz" -fsL -o ./a.tar.gz  && \
@spyzhov
spyzhov / gocheck.sh
Last active April 9, 2019 08:33
Golang checker for a several linters
#!/usr/bin/env bash
BIN="${GOPATH}/bin"
if [[ "$(which go)" == "" ]]; then
echo "Install GoLang first..."
exit 1
fi
if [[ "$(which gofmt)" == "" ]]; then
echo "Install GoLang with gofmt first..."
exit 1
@spyzhov
spyzhov / review.sh
Last active May 3, 2019 08:58
Review git changes in branch
#!/usr/bin/env bash
BRAN=$1
DEST=master
if [ "$(git status -s)" != "" ] ; then
echo "Have unstashed changes"
exit 1
fi