Skip to content

Commit

Permalink
Add in the concept of stable,unstable and release yml files for travis (
Browse files Browse the repository at this point in the history
hyperledger-archives#2940)

Pick these based on the branch of the build.

Signed-off-by: Matthew B White <[email protected]>
  • Loading branch information
mbwhite authored and jt-nti committed Dec 5, 2017
1 parent c7d65ad commit 13bb3e7
Show file tree
Hide file tree
Showing 15 changed files with 90 additions and 218 deletions.
6 changes: 5 additions & 1 deletion .travis/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ if [ "${DOCS}" != "" ]; then
if [ -z "${TRAVIS_TAG}" ]; then
DOCS="unstable"
else
DOCS="full"
if [ "${TRAVIS_BRANCH}" = "master" ]; then
DOCS="latest"
elif [ "${TRAVIS_BRANCH}" = "v0.16.x" ]; then
DOCS="stable"
fi
fi
./.travis/deploy_docs.sh
exit 0
Expand Down
19 changes: 7 additions & 12 deletions .travis/deploy_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,13 @@ export TODIR="${DIR}/packages/composer-website/out/gh-pages"
# Load the GitHub repository using the gh-pages branch.
git clone -b gh-pages [email protected]:${TRAVIS_REPO_SLUG}.git ${TODIR}

# If this is a full docs build, copy the docs into the GitHub repository as the main website.
if [ "${DOCS}" == "full" ]; then
rm -rf ${TODIR}/*
cp -rf ${DIR}/packages/composer-website/jekylldocs/_site/* ${TODIR}/
fi

# Always copy the docs into the GitHub repository as the unstable website.
mkdir -p ${TODIR}/unstable
rm -rf ${TODIR}/unstable/*
cp -rf ${DIR}/packages/composer-website/jekylldocs/_site/* ${TODIR}/unstable/

# Add all the changes, commit, and push to the GitHub repository.
# Should be able to copy all the docs as needed
mkdir -p ${TODIR}/${DOCS}
rm -rf ${TODIR}/${DOCS}/*
cp -rf ${DIR}/packages/composer-website/jekylldocs/_site/* ${TODIR}/${DOCS}/

echo "<meta http-equiv=\"refresh\" content=\"0; url=stable/index.html\" />" > ${TODIR}/index.html

cd ${TODIR}
git add .
git commit -m "Automatic deployment of website"
Expand Down
12 changes: 9 additions & 3 deletions .travis/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,16 @@ if [ "${DOCS}" != "" ]; then

# Build the documentation.
npm run doc
echo ${TRAVIS_BRANCH}
if [ -n "${TRAVIS_TAG}" ]; then
export JEKYLL_ENV=production
npm run full:prod
npm run linkcheck:prod
export JEKYLL_ENV=production
if [ "${TRAVIS_BRANCH}" = "master" ]; then
npm run full:latest
npm run linkcheck:latest
elif [ "${TRAVIS_BRANCH}" = "v0.16.x" ]; then
npm run full:stable
npm run linkcheck:stable
fi
else
npm run full:unstable
npm run linkcheck:unstable
Expand Down
4 changes: 2 additions & 2 deletions packages/composer-website/jekylldocs/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ url: "https://hyperledger.github.io/composer/"

#For publishing to your own gh-pages branch of the Docs repo this will need to
#be the sitebaseurl - but the build scripts handle this for you.
#
baseurl: "/composer"
# baseurl: "/composer"

highlighter: rouge
markdown: redcarpet
redcarpet:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,14 @@
<ul>
<li><a href="https://github.com/hyperledger/composer">GitHub</a></li>
<li><a href="http://stackoverflow.com/questions/tagged/fabric-composer">Stack Overflow</a></li>
<li><a href="https://goo.gl/forms/7YPMLP2LTN2hjIRk2">Feedback?</a></li>
{% if site.status == "stable" %}
<li><a href="https://hyperledger.github.io/composer/latest">Latest (Unstable) Docs</a></li>
{% elsif site.status == "latest" %}
<li><a href="https://hyperledger.github.io/composer/stable">Stable (Supported) Docs</a></li>
{% else %}
<li><a href="https://hyperledger.github.io/composer/latest">Latest (Unstable) Docs</a></li>
<li><a href="https://hyperledger.github.io/composer/stable">Stable (Supported) Docs</a></li>
{% endif %}
</ul>
</div>
</div>
Expand Down
2 changes: 2 additions & 0 deletions packages/composer-website/jekylldocs/_latest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
baseurl: "/composer/latest"
status: "latest"
2 changes: 2 additions & 0 deletions packages/composer-website/jekylldocs/_stable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
baseurl: "/composer/stable"
status: "stable"
1 change: 1 addition & 0 deletions packages/composer-website/jekylldocs/_unstable.yml
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
baseurl: "/composer/unstable"
status: "unstable"

Large diffs are not rendered by default.

13 changes: 1 addition & 12 deletions packages/composer-website/jekylldocs/assets/css/grid-layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,9 @@ $callout: #FFD640;

.docs-container {
display: grid;
grid-template-columns: 20% 20% 20% 20% 20%;
grid-template-columns: 25% 20% 20% 20% 15%;
grid-template-rows: 20% 20% 20% 20% 20%;

// responsive button
// .toggle {
// display: block ;
// }

// Scrollbar overrides
// ::-webkit-scrollbar {
// display: none;
// }
// -ms-overflow-style: none; // IE 10+

hr {
display: none;
}
Expand Down

Large diffs are not rendered by default.

This file was deleted.

216 changes: 43 additions & 173 deletions packages/composer-website/jekylldocs/assets/css/new-style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ h2 {
font-family: $font-stack;
font-weight: 300;
font-size: 1.35rem;
// letter-spacing: 0.4px;
line-height: 130%;
color: $primary-text;
}
Expand Down Expand Up @@ -862,179 +861,50 @@ li {

}

h2.everybody {
background-color: #e1e1e1;
background-image: url("../img/Artboard [email protected]");
background-repeat: no-repeat;
background-position: left 5px center;
background-size: 32px 32px;
// background-origin: content-box;
border-radius: 5px;
max-width: 100%;
padding: 5px 5px 5px 48px;
text-align: center;
}
// Needs further cleanup

h2.alice {
background-color: #e1f7d5;
background-image: url("../img/[email protected]");
background-repeat: no-repeat;
background-position: left 5px center;
background-size: 32px 32px;
// background-origin: content-box;
border-radius: 5px;
max-width: 100%;
padding: 5px 5px 5px 48px;
text-align: left;
}
h2 {
&.everybody {
background-color: #e1e1e1;
background-image: url("../img/Artboard [email protected]");
background-repeat: no-repeat;
background-position: left 5px center;
background-size: 32px 32px;
border-radius: 5px;
max-width: 100%;
padding: 5px 5px 5px 48px;
text-align: center;
}

h2.bob {
background-color: #c9c9ff;
background-image: url("../img/[email protected]");
background-repeat: no-repeat;
background-position: right 5px center;
background-size: 32px 32px;
// background-origin: content-box;
border-radius: 5px;
max-width: 100%;
padding: 5px 48px 5px 5px;
text-align: right;
}
&.alice {
background-color: #e1f7d5;
background-image: url("../img/[email protected]");
background-repeat: no-repeat;
background-position: left 5px center;
background-size: 32px 32px;
border-radius: 5px;
max-width: 100%;
padding: 5px 5px 5px 48px;
text-align: left;
}

h3.warning {
background-color: #f6d155;
// background-origin: content-box;
border-radius: 5px;
max-width: 100%;
padding: 5px 5px 5px 5px;
text-align: left;
}
&.bob {
background-color: #c9c9ff;
background-image: url("../img/[email protected]");
background-repeat: no-repeat;
background-position: right 5px center;
background-size: 32px 32px;
border-radius: 5px;
max-width: 100%;
padding: 5px 48px 5px 5px;
text-align: right;
}

// Docs styling updates

// nav {
// .container {
// padding-top: 5px;
// }
// }
//
// .context-nav {
// a {
// padding-left: 1rem;
// border: none;
// border-left: 2px solid transparent;
// transition: none;
//
// &:hover {
// color: $first-highlight;
// border-left: 2px solid $second-highlight;
// transition: none;
// }
//
// &:last-child {
// padding-left: 0;
// border: none;
// }
//
// &:active {
// color: $first-highlight;
// }
//
// + strong {
// a {
// padding-top: 1.5rem;
// border-left: none;
// }
// }
// }
// }
//
// .SiteWrapper {
// .content {
// .container {
// .content-chunk {
//
// p {
// margin-top: 1.3rem;
// }
//
// h1 {
// font-weight: 300;
// font-size: 2em;
// }
//
// h2 {
// margin-top: 2rem;
// }
//
// h3 {
// font-family: $font-stack;
// font-weight: 300;
// font-size: 1.2rem;
// line-height: 130%;
// color: $primary-text;
// margin-top: 2rem;
// }
//
// pre {
// background-color: $third-highlight;
// border: 1px solid $keyline-highlight;
// }
//
// code {
// border-radius: 2px;
// padding-right: 5px;
// padding-top: 1px;
// padding-bottom: 1px;
// }
//
// ul {
// list-style: none;
// padding-left: 2em;
// text-indent: -1em;
//
// li:before {
// color: $primary-text;
// content: '- \0000a0';
// font-size: 1rem;
// font-weight: 600;
// }
//
// li {
// padding-bottom: 0.5rem;
// p {
// display: inline;
// }
//
// }
// }
//
// ol {
// border-left: 1px solid $keyline-highlight;
// li {
// margin-top: 1.3rem;
// }
// }
//
// a {
// color: $first-highlight;
// }
// }
// }
// }
// }
//
// // Docs Footer
//
// .docs-footer {
// // position: absolute;
// // bottom: 0;
// background-color: $sixth-highlight;
// }
//
// // 404 page
// .container {
// .404-info {
//
// }
// }
&.warning {
background-color: #f6d155;
border-radius: 5px;
max-width: 100%;
padding: 5px 5px 5px 5px;
text-align: left;
}
}
Loading

0 comments on commit 13bb3e7

Please sign in to comment.