Skip to content

Instantly share code, notes, and snippets.

View shalkam's full-sized avatar
🏠
Working from home

Mostafa Sholkamy shalkam

🏠
Working from home
View GitHub Profile
@shalkam
shalkam / Dockerfile
Last active July 15, 2019 20:09
Circleci node docker with gcloud sdk, kubectl, prisma and apollo
FROM circleci/node
ARG CLOUD_SDK_VERSION=251.0.0
ENV CLOUD_SDK_VERSION=$CLOUD_SDK_VERSION
ARG INSTALL_COMPONENTS
ENV PATH /opt/google-cloud-sdk/bin/:/home/circleci/.yarn/bin:$PATH
RUN sudo apt-get update -qqy && \
sudo apt-get install -qqy \
python-dev \
@shalkam
shalkam / Dockerfile
Created July 15, 2019 13:44
docker file with gcloud sdk, apollo and prisma
FROM node:10-alpine
ARG CLOUD_SDK_VERSION=251.0.0
ENV CLOUD_SDK_VERSION=$CLOUD_SDK_VERSION
ENV PATH /google-cloud-sdk/bin:$(yarn global bin):$PATH
RUN apk --no-cache add \
curl \
python \
py-crcmod \
bash \
@shalkam
shalkam / .gitlab-ci.yml
Created May 20, 2019 08:52
using service account
stages:
- deploy
deploy_app:
image: bitnami/kubectl:latest
stage: deploy
environment: production
script:
- USER_TOKEN=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token)
- CERTIFICATE_AUTHORITY_DATA=$(cat /var/run/secrets/kubernetes.io/serviceaccount/ca.crt | base64 -i -w0 -)
- kubectl config set-cluster k8s --server="https://kubernetes.default.svc"
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: gitlab-admin
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
@shalkam
shalkam / .gitlab-ci.yml
Created May 20, 2019 08:36
using kubeconfig.yml
stages:
- deploy
variables:
KUBE_CONFIG: "content_of_base64_kubeconfig.yml_goes_here"
deploy_app:
image: bitnami/kubectl:latest
stage: deploy
environment: production
only:
- master
@shalkam
shalkam / service.yml
Created April 2, 2019 14:40
prisma service
apiVersion: v1
kind: Service
metadata:
name: prisma
namespace: prisma
spec:
ports:
- port: 4466
targetPort: 4466
protocol: TCP
@shalkam
shalkam / config.yml
Last active April 2, 2019 14:29
deployment file for prisma
apiVersion: v1
kind: ConfigMap
metadata:
name: prisma-configmap
namespace: prisma
labels:
stage: production
name: prisma
app: prisma
data:
@shalkam
shalkam / .eslintignore
Last active November 9, 2018 11:35
Eslint setup for server
node_modules/
@shalkam
shalkam / example.js
Created June 19, 2018 22:07
React loadable helper function
import loadable from './loadable';
const AsyncComponent = loadable(import('./my-component'));
import "regenerator-runtime/runtime";
import React from "react";
import { shallow, mount } from "enzyme";
import sinon from "sinon";
import { reducer as formReducer } from "redux-form";
import { createStore, combineReducers } from "redux";
import { Provider } from "react-redux";
import userReducer from "../../redux/user-reducer";
import ReserveRedux, { Reserve } from "./reserve";