Coder Social home page Coder Social logo

cg-site's Introduction

cloud.gov

This site uses the cloud.gov Pages USWDS Jekyll template. cloud.gov Pages runs on cloud.gov and supports the development of this template. By leveraging this template cloud.gov get the benefits of a maintained template as well as a way to test out new functionality in the template.

This Jekyll theme uses the U.S. Web Design System v 2.0 and provides developers a starter kit and reference implementation for cloud.gov Pages websites.

This code uses the Jekyll site engine and built with Ruby. If you prefer to use Javascript, check out pages-uswds-gatsby, which uses Gatsby site engine.

This site uses a customized U.S. Web Design System theme and strives to be compliant with requirements set by 21st Century IDEA Act. The standards require that a website or digital service:

  • is accessible to individuals with disabilities;
  • has a consistent appearance;
  • does not duplicate any legacy websites (the legislation also requires agencies to ensure that legacy websites are regularly reviewed, removed, and consolidated);
  • has a search function;
  • uses an industry standard secure connection;
  • is designed around user needs with data-driven analysis influencing management and development decisions, using qualitative and quantitative data to determine user goals, needs, and behaviors, and continually test the website, web-based form, web-based application, or digital service to ensure that user needs are addressed;
  • allows for user customization; and
  • is mobile-friendly.

Key Functionality

This repository contains the following examples and functionality:

✅ Publish blog posts, press releases, announcements, etc. To modify this code, check out blog/index.html, which manages how the posts are listed. You should then check out _layouts/post.html to see how individual posts are structured.

✅ Publish single one-off pages. Instead of creating lots of folders throughout the root directory, you should put single pages in _pages folder and change the permalink at the top of each page. Use sub-folders only when you really need to.

✅ Publish data (for example: job listings, links, references), you can use the template _layouts/data.html. Just create a file in you _pages folder with the following options:

---
title: Collections Page
layout: data
permalink: /collections
datafile: collections
---

The reference to datafile referers to the name of the file in _data/collections.yml and loops through the values. Feel free to modify this as needed.

✅ There are two different kinds of pages, one does not have a side bar navigation, and the other uses _includes/sidenav.html. You can enable this option by adding sidenav: true to your page front matter.

---
title: Document with Sidenav
layout: page
sidenav: true
permalink: /document-with-sidenav
---

✅ Enable search with Search.gov by adding option to _config.yml.

---
searchgov:
  endpoint: https://search.gov  # You should not change this.
  affiliate: pages-uswds-example # replace this with your search.gov account
  access_key: your-access-key # This is placeholder. Not private.
  inline: true #this renders the results on the same domain. Otherwise, it will render the results in the search.gov domain
---

How to edit cloud.gov content

  • Non-developers should focus on editing markdown content in the _posts, _docs, and _pages folder. Generally most of the cloud.gov content will be in the _docs file.

  • Pricing updates can go directly into _data/pricing.yml file and if any of the aws services need to be updated that can occur in the _data/services.yml file.

  • We try to keep configuration options to a minimum so you can easily change functionality. You should review _config.yml to see the options that are available to you. There are a few values on top that you need to change. They refer to the agency name and contact information. The rest of _config.yml has a range of more advanced options.

  • If you look at package.json you will see that the npm run pages command that will run when running on the cloud.gov Pages platform.

  • Do not edit files in the _site/ folder. These files are auto-generated, and any change you make in the folder will be overwritten.

  • To edit the look and feel of the site, you need to edit files in _includes/ folder, which render key components, like the menu, side navigation, and logos.

  • Some pages are styled to be .html rather than markdown you can find these in the _layouts folder.

    • The homepage can be editted more directly by manipulating the .html in home.html
    • The pricing page is mostly edited with the pricing.html
    • The getting-started page is in the _pages/sign-up.md folder.
  • _layouts/ may require the least amount of editing of all the files since they are primarily responsible for printing the content.

  • search/index.html is used by search.gov.

  • If you make major changes to content, let the #search team know and they can reindex the site. More information on the search.gov account here: https://search.usa.gov/sites/6217

Updating content on your own computer

    git clone https://github.com/cloud-gov/cg-site
    cd cg-site

Note that when built by cloud.gov Pages, npm run pages is used instead of the build script.

Install dependencies and run app

    nvm use
    npm install
    bundle install
    npm start

Open your web browser to localhost:4000 to view your site.

Testing

    npm test

Link checking

This project uses lychee and the accompanying GitHub action to verify that all the links in this documentation are valid.

Default configuration for lychee can be found in lychee.toml.

Default URL patterns that are ignored by lychee can be found in .lycheeignore.

Running locally

First, install lychee:

brew install lychee

To run lychee locally, use the link-checker npm script:

# can use any globbing pattern or filepath
GITHUB_TOKEN=<your-github-token> npm run link-checker -- ./_site/**/*.html

You can also use multiple patterns/filepaths:

GITHUB_TOKEN=<your-github-token> npm run link-checker -- ./*.md ./_site/**/*.html

Including a GITHUB_TOKEN environment variable will reduce the number of 429 responses returned by GitHub, since by default GitHub throttles requests without a token.

When you run this script, results from the lychee link scan will be generated in lychee-out.md so that you can review and address any errors.

Technologies you should be familiarize yourself with

  • Jekyll - The primary site engine that builds your code and content.
  • Front Matter - The top of each page/post includes keywords within -- tags. This is meta data that helps Jekyll build the site, but you can also use it to pass custom variables.
  • U.S. Web Design System v 2.0

Contributing

See CONTRIBUTING for additional information.

Public domain

This project is in the worldwide public domain. As stated in CONTRIBUTING:

This project is in the public domain within the United States, and copyright and related rights in the work worldwide are waived through the CC0 1.0 Universal public domain dedication.

All contributions to this project will be released under the CC0 dedication. By submitting a pull request, you are agreeing to comply with this waiver of copyright interest.

See CONTRIBUTING for additional information.

cg-site's People

Contributors

afeld avatar apburnes avatar arshaider avatar bengerman13 avatar ccostino avatar cnelson avatar cweibel avatar dlapiduz avatar drewbo avatar eddietejeda avatar ephraim-g avatar femmebot avatar fureigh avatar gboone avatar jcscottiii avatar jmcarp avatar jontours avatar karareinsel avatar linuxbozo avatar markdboyd avatar mheadd avatar mogul avatar pburkholder avatar rememberlenny avatar rogeruiz avatar sharms avatar siennathesane avatar soutenniza avatar thisisdano avatar wjwoodson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cg-site's Issues

document how to set up new orgs

Would be great to have this automated (or single-click/command), but in the meantime, let's create documentation about how to create new sandbox and "production" orgs.

Acceptance criteria

  • As a cloud.gov admin, I know how to create new organizations in cloud.gov

consider hosting the CF docs ourselves

The Cloud Foundry documentation is structured in an interesting way: each "module" is hosted as a separate repository, and then brought together via Bookbinder. The other interesting thing is that the docs are templatized, so that a Cloud Foundry host like Pivotal Web Services can have their own nearly-identical docs (via their own Bookbinder repo) with

  • The appropriate config values, e.g. the UAA host
  • Their own sections of documentation pulled into the same place

Pros

  • We still get to leverage the canonical documentation, just not at the canonical domain.

  • This avoids the the issue of "go to this page, but use uaa.cloud.gov where it says target".

  • Users don't have to jump back and forth between sites as much.

  • We can simply exclude the parts of the docs that aren't relevant to our users

    cloud foundry docs

Cons

  • It might be confusing to users whether they can still use the canonical docs
  • The docs (might) become less Google-able

Thoughts?

/cc @jameshupp @msecret

Include rates in the marketplace

According to rates.md:

You can see the rate for each type of service instance offered by running cf marketplace.

As far as I can tell, cf marketplace doesn't display rates for any available services--it only indicates which services are free and which are paid. Ideally cf marketplace would show prices, but until it does, let's keep the docs accurate. Maybe this line could read "you will eventually be able to see rates using cf marketplace".

Or maybe I'm just misinterpreting the output of cf marketplace--let me know if I am!

@mogul

Wercker not attaching the commit status

The builds seem to be triggered, but the commit status isn't updated for some reason.

screen shot 2015-12-28 at 1 36 20 am

The documentation is here, but doesn't seem to include any information about how to (re)enable the feature.

Idea for a quickstart tutorial

I did a little experimenting yesterday with CloudFoundry, Rails and ElasticSearch. It took a little hunting and some help from @ozzyjohnson to get started, but it is actually quite easy. I thought it might be nice to add a little tutorial to the docs for getting started with Rails (using what is free and doesn't require a billing code).

Should something like this go into Deploying Rails or is there a better spot for it?

It would need a little text explanation for the steps, but here's my outline:

cf target -o sandbox
rails new myapp -O
or
rails new myapp --skip-activerecord

cd myapp
ln -s .gitignore .cfignore

edit Gemfile, add for better logging:
gem 'rails_12factor'

bundle
cf push myapp

http://myapp.cf.18f.us

cf logs       

then to add elasticsearch

cf create-service elasticsearch15 free eservice

add to Gemfile:

gem 'cf-app-utils'
gem 'elasticsearch'

bundle

I don't know if it needs a complete example, but this code snippet would have been useful for me:

require 'elasticsearch'
require 'cf-app-utils'
eservice = CF::App::Credentials.find_all_by_service_tag('eservice')
service_uri = eservice['uri']

client = Elasticsearch::Client.new host: service_uri, log: true

How do you psql into a DB once it has been created?

I followed the database instructions to create a database, but now I need to psql into the DB to run SQL commands. I have not been able to. It keeps timing out. I tried both the AWS RDS and the CF Service.

After some digging around, I learned that you can see your CF DB info by running cf env <APP_NAME>. I then tried to psql into my Postgres instance, but kept getting timed out as well. I am currently at home over VPN.

Thanks!

Rename repository

The name isn't super clear...how about cloud-foundry-docs or docs.18f.gov?

Make heading levels consistent

I am noticing that we are using various heading levels across different pages (some using an <h2> for the top-level sections, others using <h4>, etc.) Need to go through each page and ensure they are all using consistent levels.

Help understanding message in logs

I see this occasionally:

2015-09-17T18:15:15.03-0400 [DEA/6]      OUT Removing crash for app with id 09c93d49-9bec-47c2-b285-89290b412cb1
2015-09-17T18:15:15.03-0400 [DEA/6]      OUT Stopping app instance (index 0) with guid 09c93d49-9bec-47c2-b285-89290b412cb1
2015-09-17T18:15:15.03-0400 [DEA/6]      OUT Stopped app instance (index 0) with guid 09c93d49-9bec-47c2-b285-89290b412cb1

But as fair as I can tell, nothing actually happened with the app. What does this mean?

rename again?

Hey - this repo was recently renamed, but it is still hard to find. When I was searching for it within the 18F org on github, I searched "cloud" "cloudfoundry" and "cloudgov" but it didn't come up. Perhaps cloud-gov-docs would be a better and more findable name?

typo on front page

Saw this tweet

This paragraph: Develop, run, and manage web applications without the complexity and cost of building and maintaining infrastructure. Focus precious team effort in improving your service!

on the main page should read:

Develop, run, and manage web applications without the complexity and cost of building and maintaining infrastructure. Focus precious team effort on improving your service!

offer direction for different audiences

@melodykramer asked the question "where should new 18F developers hires be directed to learn about cloud.gov?" I think that deploying is the best first step for technical folks, just to get a feel for it, whereas acquisition folks will be most interested in the pricing, what's included, etc. I'm thinking that having the homepage say "are you interested in X? go to this page" would be a good way to tackle these different paths for different audiences, but am curious what others think.

/cc @jameshupp

How to I get access to orgs?

Working on a Slack bot that I will deploy to Cloud Foundry. From what I've read on the docs, seems like this should be a part of the devops org within CF (since that is where Hubot lives) - is that right? If so, how do I get access to thedevops org?

Clarify quota units

According to https://docs.cloud.gov/apps/quotas/, quotas are allocated in "quota units", each of which provides a fixed number of routes, services, memory, etc. But it's not clear that resources are actually allocated like this--for example, FEC just increased its memory quota by 3GB, which is not a multiple of the 3.75GB quota unit level. As a member of the engineering team and curious reader of the documentation, I don't understand what quota units are, or how or whether they apply to me.

Also, there's a link on this page to https://docs.cloud.gov/apps/quotas/#application-quotas, but the #application-quotas anchor doesn't exist on the page, so the link doesn't do anything.

Patterns for multiple environments / help me debug my Rails setup / rubber duckie session

Problem

As a dev, I am looking for a standard technique for hosting a web application in production and staging environments. There seem to be multiple ways to approach this problem, but this seems like a process that need not (and should not) be reinvented for each app.

I'm currently struggling through this for a Rails app, but I think the solution here could be framework/language-agnostic.

Current Approach (and down the rabbit hole)

Currently (for Micropurchase), we have an app in the production space of our CF org. We have a pretty standard Ruby buildpack, a psql-shared service, and deploys integrated into Travis-CI.

To get a staging site up, I added a staging space to our CF org and deployed using cf push -n micropurchase-staging. Here's where things get murky:

➜  micropurchase git:(master) ✗ cf push -n micropurchase-staging 
[... cf buildpack stuff ...]
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 failing
FAILED
Start unsuccessful

On to the logs!:

2015-12-21T06:48:25.36-0500 [App/0]      ERR PG::InsufficientPrivilege: ERROR:  permission denied to create database

(full logs here)

So this is weird and difficult to understand.

The Next Approach

Rather than specify the -n flag, lets try using a separate buildpack just for staging (manifest-staging.yml):

applications:
- name: micropurchase-staging
  memory: 128M
  instances: 1
  domain: 18f.gov
  hostname: micropurchase-staging
  buildpack: https://github.com/ddollar/heroku-buildpack-multi.git
  services:
    - micropurchase-psql
cf push -f manifest-staging.yml
[... cf buildpack stuff ...]
1 of 1 instances running

App started


OK

App micropurchase-staging was started using this command `bundle exec rails server -p $PORT`

Showing health and status for app micropurchase-staging in org agile-bpa / space staging as [email protected]...
OK

requested state: started
instances: 1/1
usage: 128M x 1 instances
urls: micropurchase-staging.18f.gov
last uploaded: Mon Dec 21 11:57:30 UTC 2015

     state     since                    cpu    memory           disk           details   
#0   running   2015-12-21 06:58:06 AM   0.0%   101.1M of 128M   177.4M of 1G      

Good?! Nope. The logs keep showing this same PG::InsufficientPrivilege: ERROR: permission denied to create database error.

Nevertheless, the site was up at the desired URL (https://micropurchase-staging.18f.gov). I tried logging in using our app's OAuth login, and got GitHub's 404 page (at this url: https://github.com/login/oauth/authorize?client_id&redirect_uri=https%3A%2F%2Fmicropurchase-staging.18f.gov%2Fauth%2Fgithub%2Fcallback&response_type=code&state=ec086f1a41afddf44cff5ee885fe8b130034e74c2fe1f00e).

Incidentally cf restage micropurchase gets me:

0 of 1 instances running, 1 starting
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 failing
FAILED
Start unsuccessful

Along with that same PG error.

Why does cf push seem to work fine but cf restage keeps erroring?

Service Name Confusion:

➜  micropurchase git:(master) ✗ cf target

API endpoint:   https://api.cloud.gov (API version: 2.36.0)   
User:           [email protected]   
Org:            agile-bpa   
Space:          staging   
➜  micropurchase git:(master) ✗ cf services
Getting services in org agile-bpa / space staging as [email protected]...
OK

name                 service   plan          bound apps                                                last operation   
micropurchase-psql   rds       shared-psql   micropurchase-staging, micropurchase-ssh, micropurchase   create succeeded   
➜  micropurchase git:(master) ✗ cf target -s production

API endpoint:   https://api.cloud.gov (API version: 2.36.0)   
User:           [email protected]   
Org:            agile-bpa   
Space:          production   
➜  micropurchase git:(master) ✗ cf services
Getting services in org agile-bpa / space production as [email protected]...
OK

name                 service       plan          bound apps                                                last operation   
iaa-mongo            mongodb-new   free          iaa-mvp                                                   create succeeded   
micropurchase-psql   rds           shared-psql   micropurchase-staging, micropurchase-ssh, micropurchase   create succeeded  

Somehow the same RDS database service is bound to the same three apps (production, staging, and ssh). Maybe this was user (my) error. To correct this, I'll unbind micropurchase-psql from the micropurchase app in the staging space:

➜  micropurchase git:(master) ✗ cf create-service rds shared-psql micropurchase-staging-psql
Creating service micropurchase-staging-psql in org agile-bpa / space staging as [email protected]...
OK
➜  micropurchase git:(master) ✗ cf unbind-service micropurchase micropurchase-psql
Unbinding app micropurchase from service micropurchase-psql in org agile-bpa / space staging as [email protected]...
OK
➜  micropurchase git:(master) ✗ cf bind-service micropurchase micropurchase-staging-psql
Binding service micropurchase-staging-psql to app micropurchase in org agile-bpa / space staging as [email protected]...
OK
TIP: Use 'cf restage' to ensure your env variable changes take effect

Time to restage:

➜  micropurchase git:(master) ✗ cf restage micropurchase
Restaging app micropurchase in org agile-bpa / space staging as [email protected]...
[... cf buildpack stuff ...]
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 down
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 failing
FAILED
Start unsuccessful

And that same PG error in the logs ...

While I'm at it, let's check cf services to see what's going on:

Getting services in org agile-bpa / space staging as [email protected]...
OK

name                         service   plan          bound apps                                 last operation   
micropurchase-psql           rds       shared-psql   micropurchase-staging, micropurchase-ssh   create succeeded   
micropurchase-staging-psql   rds       shared-psql   micropurchase                              create succeeded  

Now everything seems backwards: staging db is bound to plain old micropurchase (but in which space?!) and micrpurchase-psql is bound to micropurchase-staging. Again which, space? (cf target says I'm in staging but this is now getting very confusing.

Back out of the rabbit hole

Apologies if this meandered too much, but this seems to be the way things are going (at least for me) with Cloud Foundry and debugging it. So many of the steps required are procedural and not declarative. Maybe this exists already, but I'd much prefer to describe the desired setup in the manfiest.yml: here's what I need in the staging space and here's what I need in production, and then let a space-bound cf push handle the rest.

Add the US govt website banner

In order to be on-brand and match the header we show on the cloud.gov landing page, the docs.cloud.gov site should show the "An official website of the United States Government 🇺🇸 | This site is currently in alpha. Learn more." message at the top of the header.

image

As a user, I need to specify a version of elasticsearch managed service

open-data-maker uses the elasticsearch managed service. The elasticsearch 2.0 service has a breaking change, and without a code change in open-data-maker it cannot be upgraded to use elasticsearch 2.0. I can understand wanting to offer 2.0 as a version of the managed service. If that is done, we'll want a way to run a pre-2.0 version instead, until such time as the necessary code change can be made.

cc @ultrasaurus

documentation on how we set up a password for kibana proxy in VCAP services

we use user-provided credentials in ED, would be good to document how to do this for other projects

cf env myapp

results in

 "user-provided": [
   {
    "credentials": {
     "password": "xxxxxx",
     "username": "kibana-user"
    },
    "label": "user-provided",
    "name": "elk-credentials",
    "syslog_drain_url": "",
    "tags": []
   },

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.