This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## docker login to platform other than dockerhub | |
docker login [email protected] registry.cn-hangzhou.aliyuncs.com | |
## dockcer build | |
docker build -t registry.cn-hangzhou.aliyuncs.com/docker-study-lab/continuous_profiling:v0.2 . | |
## docker push | |
docker push registry.cn-hangzhou.aliyuncs.com/docker-study-lab/continuous_profiling:v0.2 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM php:7.1.22-fpm | |
# Update packages | |
RUN apt-get update | |
# Install PHP and composer dependencies | |
RUN apt-get install -qq git curl libmcrypt-dev libjpeg-dev libpng-dev libfreetype6-dev libbz2-dev | |
# Clear out the local repository of retrieved package files | |
RUN apt-get clean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Jwt | |
{ | |
/** | |
* Secret Key | |
* | |
* @var | |
*/ | |
private $secret = '123'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo gitlab-ci-multi-runner register |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function toBaseN(num, base) { | |
if (num === 0) { | |
return '0'; | |
} | |
var digits = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; | |
var len = Math.min(digits.length, base); | |
var result = ''; | |
while (num > 0) { | |
result = digits[num % len] + result; | |
num = parseInt(num / len, 10); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Convert a numeric string from base 10 to another base. | |
* | |
* @param $value decimal string | |
* @param int $b base , max is 62 | |
* @return string | |
*/ | |
function to_base($value, $b = 62) | |
{ | |
$base = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stages: | |
- build | |
- test | |
- deploy | |
before_script: | |
- mkdir -p ~/.ssh | |
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' > /root/.ssh/id_rsa | |
- chmod -R 600 ~/.ssh | |
- echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts #make sure remote servers's ssh host keys are verified |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '2' | |
services: | |
# The Application | |
app: | |
build: | |
context: ./ | |
dockerfile: php-fpm.dockerfile | |
working_dir: /var/www | |
volumes: | |
- ./:/var/www |