This file contains hidden or 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
echo "Creating the gitlab-registry secret ..." | |
# Save the JSON to create the gitlab-registry docker-registry secret | |
GITLAB_REGISTRY_SECRET_JSON=$( | |
kubectl create secret --namespace=$KUBE_NAMESPACE \ | |
docker-registry gitlab-registry \ | |
--docker-server="$CI_REGISTRY" \ | |
--docker-username="${CI_DEPLOY_USER:-$CI_REGISTRY_USER}" \ | |
--docker-password="${CI_DEPLOY_PASSWORD:-$CI_REGISTRY_PASSWORD}" \ | |
--docker-email="$GITLAB_USER_EMAIL" \ | |
--output json \ |
This file contains hidden or 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 create_secret() { | |
echo "Create secret..." | |
if [[ "$CI_PROJECT_VISIBILITY" == "public" ]]; then | |
return | |
fi | |
kubectl create secret -n "$KUBE_NAMESPACE" \ | |
docker-registry gitlab-registry \ | |
--docker-server="$CI_REGISTRY" \ | |
--docker-username="${CI_DEPLOY_USER:-$CI_REGISTRY_USER}" \ |
This file contains hidden or 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
Homebrew build logs for node on macOS 10.14 | |
Build date: 2018-06-20 14:53:33 |
This file contains hidden or 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
# Capybara defaults to CSS3 selectors rather than XPath. | |
# If you'd prefer to use XPath, just uncomment this line and adjust any | |
# selectors in your step definitions to use the XPath syntax. | |
# Capybara.default_selector = :xpath | |
Capybara.register_driver :chrome do |app| | |
capabilities = Selenium::WebDriver::Remote::Capabilities.chrome( | |
chromeOptions: { | |
args: [ | |
'--disable-default-apps', |
This file contains hidden or 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
module DeviseGoogleAuthenticatorHelpers | |
# | |
# Returns a valid One Time Password for the Google Authenticator gem. | |
# | |
# @param user [User] instance for which a valid OPT is requested. | |
# @return [Integer] first valid calculated OTP | |
# | |
def a_valid_otp_for(user) | |
calculate_otps_from(user.gauth_secret).first | |
end |
This file contains hidden or 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
module DeviseGoogleAuthenticatorHelpers | |
# | |
# Returns a valid One Time Password for the Google Authenticator gem. | |
# | |
# @param user [User] instance for which a valid OPT is requested. | |
# @return [Integer] first valid calculated OTP | |
# | |
def a_valid_otp_for(user) | |
calculate_otps_from(user.gauth_secret).first | |
end |
This file contains hidden or 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
pg-dump2swift-restore: | |
command: restorelast | |
environment: | |
- OS_CONTAINER_NAME=app-production-db-backups | |
- OS_PASSWORD=<mot de passe swift> | |
- OS_REGION=<region> | |
- OS_TENANT_NAME=<numéro de tenant swift> | |
- OS_USERNAME=<nom d'utilisateur swift> | |
- PGDATABASE=app_production | |
image: 'yourcursus/docker-pg_dump-to-swift:9.5' |
This file contains hidden or 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
pg-dump2swift: | |
environment: | |
- OS_CONTAINER_NAME=app-production-db-backups | |
- OS_PASSWORD=<mot de passe swift> | |
- OS_REGION=<region> | |
- OS_TENANT_NAME=<numéro de tenant swift> | |
- OS_USERNAME=<nom d'utilisateur swift> | |
- PGDATABASE=app_production | |
image: 'yourcursus/docker-pg_dump-to-swift:9.5' | |
links: |
This file contains hidden or 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
require 'rails_helper' | |
RSpec.describe UsersController, type: :controller do | |
describe 'index' do | |
context 'without any user' do | |
before { get :index } | |
it { is_expected.to respond_with 200 } | |
it 'should return an empty list' do | |
expect(JSON.parse(response.body)).to eql([]) | |
end |
This file contains hidden or 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
class UsersController < ApplicationController | |
def index | |
render json: User.all | |
end | |
end |