GithubHelp home page GithubHelp logo

mozilla-github-standards / 42a1af17504f9d367929b7adda85f7dff62df362be1197bb144542c2b310422f Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mozilla-services/gomoz

0.0 0.0 0.0 370 KB

Source files for go.mozilla.org

HTML 100.00%

42a1af17504f9d367929b7adda85f7dff62df362be1197bb144542c2b310422f's Introduction

go.mozilla.org

This repository contains the source files of go.mozilla.org.

Add a new project

Create a directory with the name of your project and create an index.html file in the directory that references the git location of the source code.

You can copy an existing index.html from another project and edit it.

The name you use in go.mozilla.org/<project> does not need to be the same as the one you host the code under. For example, https://github.com/mozilla-services/hawk-go uses go.mozilla.org/hawk.

If your project has packages, create a directory structure that matches the packages structure, and give each package its own index.html file.

For example:

userplex/
├── index.html
└── modules
    ├── authorizedkeys
    │   └── index.html
    ├── aws
    │   └── index.html
    ├── datadog
    │   └── index.html
    └── index.html

Note that sub-packages must use the git location of the top-level repository. For example,

<meta name="go-import"
    content="go.mozilla.org/userplex/modules/aws
             git https://github.com/mozilla-services/userplex">

The sub-package go.mozilla.org/userplex/modules/aws uses the top-level git repository https://github.com/mozilla-services/userplex.

Set a custom import path in your packages

This is only needed for packages that are importable. The main package does not need to specify a custom import path since it cannot be imported by other Go programs.

In the source go files of your project, next to the package name, add a line that references the go.mozilla.org import path:

package mymodule // import "go.mozilla.org/myproject/mymodule"

Note that your project must now live under $GOPATH/src/go.mozilla.org/myproject.

Use custom GOPATH in CI

travis-ci

TravisCI has a directive to indicate the import path of your package, just add go_import_path to your .travis.yml.

language: go
go:
  - 1.5
  - 1.6
  - tip
go_import_path: go.mozilla.org/myproject
script:
  - go test go.mozilla.org/myproject

Publish files in S3

As an AWS admin of the prod IAM, use this command:

aws s3 sync . s3://go.mozilla.org \
    --exclude "README.md" --exclude ".git/*" \
    --content-type "text/html" --acl public-read

Then invalidate the cloudfront cache

$ aws cloudfront create-invalidation --distribution-id ESQYDMA17GDLC --paths '/*'

42a1af17504f9d367929b7adda85f7dff62df362be1197bb144542c2b310422f's People

Contributors

ajvb avatar g-k avatar jvehent avatar mozilla-github-standards avatar oremj avatar

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.