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
# fetch the hostname of the Azure Container Registry | |
registry=$(az acr list -g habitat-k8s --query "[?starts_with(name, 'habk8s')] | [0].loginServer" -o tsv) | |
# run the image sourced from the private repository, and expose port 3000 | |
kubectl run rails-todo --image=${registry}/rails-todo:latest --port 3000 | |
# watch our pod provision | |
watch kubectl get po | |
# once the pod is running exit watch |
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
# fetch the hostname of the Azure Container Registry | |
registry=$(az acr list -g habitat-k8s --query "[?starts_with(name, 'habk8s')] | [0].loginServer" -o tsv) | |
# tag the latest image with our registry hostname | |
docker tag devigned/rails-todo:latest ${registry}/rails-todo:latest | |
# push the image to our private registry | |
docker push ${registry}/rails-todo:latest |
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
#!/bin/sh | |
export GEM_HOME="{{pkg.svc_static_path}}/vendor/bundle/ruby/2.4.0" | |
export GEM_PATH="$(hab pkg path core/ruby)/lib/ruby/gems/2.4.0:$(hab pkg path core/bundler):$GEM_HOME" | |
export LD_LIBRARY_PATH="$(hab pkg path core/gcc-libs)/lib" | |
export RAILS_ENV="production" | |
export RAILS_SERVE_STATIC_FILES="true" | |
export SSL_CERT_FILE="$(hab pkg path core/cacerts)/ssl/certs/cacert.pem" | |
cd {{pkg.svc_static_path}} |
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
#!/bin/sh | |
rm -rf {{pkg.svc_static_path}}/* | |
cp -R {{pkg.path}}/static/* {{pkg.svc_static_path}} | |
rm -rf "{{pkg.svc_static_path}}/config/secrets.yml" "{{pkg.svc_static_path}}/config/mongoid.yml" | |
ln -sf {{pkg.svc_config_path}}/secrets.yml {{pkg.svc_static_path}}/config/secrets.yml | |
ln -sf {{pkg.svc_config_path}}/mongoid.yml {{pkg.svc_static_path}}/config/mongoid.yml |
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
# Connection string for mongodb | |
mongodb_uri = "some_connection_string" | |
# our secret key for Rails (don't check this in...) | |
secret_key_base = "cb6bca2c702c8954382c30acb7ff98eaa1e53af5fe77292b9f825113ba6419714d39d1663ebabaf8ea138b4ed066252df7e77cb7dc27a7ec41f8bf61a728bbaa" | |
# Rails related IP info | |
rails_binding_ip = "0.0.0.0" | |
rails_port = 3000 |
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
production: | |
clients: | |
default: | |
uri: {{cfg.mongodb_uri}} | |
options: | |
# The default timeout is 5, which is the time in seconds | |
# for a connection to time out. | |
# We recommend 15 because it allows for plenty of time | |
# in most operating environments. | |
connect_timeout: 15 |
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
pkg_origin=devigned | |
pkg_name=rails-todo | |
pkg_version=0.1.0 | |
pkg_maintainer="David Justice" | |
pkg_license=('MIT') | |
pkg_upstream_url=https://github.com/devigned/hab-rails-todo | |
pkg_source=nosuchfile.tar.gz | |
pkg_deps=( | |
core/ruby/2.4.1 | |
core/cacerts |
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
#!/usr/bin/env bash | |
set -euf -o pipefail | |
group="habitat-k8s" | |
location='westus' | |
vm_name="habitat-dev" | |
cluster_name="k8s-cluster" | |
name_prefix="habk8s" | |
new_name=$(echo $(mktemp -u ${name_prefix}XXXX) | tr '[:upper:]' '[:lower:]') |
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
git clone https://github.com/devigned/level1.git | |
cd level1/api-ruby | |
bundle install | |
bundle exec rails server | |
cd todo-ember | |
npm install | |
npm install -g ember-cli | |
ember serve |
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
git clone https://github.com/devigned/level1.git | |
cd level1 | |
./script/provision.sh | |
cd api-ruby | |
bundle install | |
bundle exec cap production deploy:initial |
NewerOlder