Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
book-output
book-release*

### NODE.JS ###
node_modules*
npm-debug.log

### OSX ###
*.DS_Store
._*
Expand All @@ -23,5 +27,8 @@ out
# warn IDEA to ignore all files that won't be compiling due to educational examples
!.idea/compiler.xml

# ignores local travis config folder
.travis

### others ###
.vscode
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
12 changes: 12 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
["@semantic-release/git", {
"assets": ["package.json", "CHANGELOG.md"],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}],
"@semantic-release/github"
]
}
60 changes: 40 additions & 20 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,45 @@
language: ruby
sudo: required

services:
- docker

env:
- COMPOSE_FILE=docker-compose.yml

script:
- ls -lah
- docker-compose run --rm ebook
global:
secure: eXGVND48r4WyUCELydGxJ5NZURQ5iSaMYT6sLyPAdsjoio5NO+/eF17Fw61YqljrSgy+SuYTtHSeVLET4VOVMry2AH2474UD4DDAZ0Fo21s/u/+wQzIW7szO+gzg+PB/22zM67Yx+9ICo+xm10juHwJRyse9s5EFCgL40LtHPWXc5iTbSJtQFbc3YqPMmrvZZEeGYKAEX6uaqeoSi5PJdDrZfMAcienrbXMx9ASW1LlaJXEr3GKQLHxdfeiEsmVpppeYbfVSRcNRGIgFHS397D2eTVBbsTnxx72dqkR6eYC9z0sifai6baTPx34K3Us1lTx9/bR2DKYohNhea7jinYNSuJB2Lyrf3u4qfJPVLlnSgT+fJYPkmmjDuRepRUK6Kvs4M69YA7FdOhSKHpZlKUtIGjRVFe4CTvkoPAJt+lSaifVKWBD6Q18NqgCkCgijIq3Hn8tjtbWHe256fqZYjio4HBHwfifWG5oxK9ZTKxc9Z+wv2mASHhnmjWpHCtFvib8HMtIizqEVOndg58vMFXJNX1sisZxIV8+I7LSgHU7OBfi2A2Ik5Zeuo46Q7/V+2xl/nOOpC6M7Bgbe+c8gFc8PyJA/3w9+m6xUmRuE5F14D4ItXZvK1lR70oBTlFb0fXNQrEejsKAerXRw1ThbmaFZqcw7ppPQrOM+ZvFcQf0=

deploy:
provider: releases
api_key:
secure: ygR+ubsOCcsILpZ9ftQ7hYeYohHS4K4U8l1LSimNoNgvf+6xxu9Pjp/uTbiWWj/J4Jc9uQiITM3h5hRxZKNO+m7kQKprRcEXIaT/vDkQWmWB+4G72hon5fwqdhKW++i5IOOXUUPQrEqpXovccgBiwVdwfvMjtp9WIx2lGDNPHAu9rzWJhQF9qlHq+an61K+Ft65OI00qgr6C7Os/va3YZFsdK+0Y4WasX2pXJgvf5TQvyso74JtgNeA1mfcHGp3/bRivi30TOVMtHLnjTIFEVt1ekxnxeJAWkvONsC9+ZPnqF5+9/QdzRXQ9uVaQSwWB6uZQIu18i10UFP92/CM0KyOXvbr8FikjTCsQcc7RThu33eGNlU5CyPvyjweMLHFobaJqTarAd+R7B0VLY8pmAbpt0rLqYOVJvZ8fLzqIDkos+TuGYapBiKMHnnp2oNEgruIB88sxeaBgfbzx+Q36vVA4u79+BJZEA8C+DJYJ+s+NFvFqRvkxsJmQ3gmRtTKgUgQ7WP40/TFLwv3rBodkMBMygjcCAoOKVvYDuTi165vT8ABztgE8G5Z5lnOhPpezZ2dwLh64Do0BGOqMIsIC6Sx4XX8Pg7xnVXenfE+9AN2mCeZNq2tq0kTRqhclr+2T5IdUm9zB90I2VfK+6tuOPsb4DKhhJRtZsUZLMCIW4NA=
file_glob: true
file: book-release/*
skip_cleanup: true
on:
tags: true
jobs:
include:
- stage: "Semantic Release"
name: "Generate a new release and changelogs"
language: node_js
node_js: lts/*
os:
- linux
install:
- npm install
script: skip
deploy:
provider: script
api_key: "$GITHUB_TOKEN"
node_js: lts/*
skip_cleanup: true
script: npx semantic-release
on:
branch: master

notifications:
email:
- rcmoutinho@cyborgdeveloper.tech
- stage: "GitHub Release"
name: "Send the generated files to the new GitHub release"
services:
- docker
env:
- COMPOSE_FILE=docker-compose.yml
script:
- TRAVIS_TAG=$(git describe --tags `git rev-list --tags --max-count=1`)
- git shortlog -s | cut -f 2- > book/contributors.txt
- docker-compose run --rm ebook $TRAVIS_TAG
deploy:
provider: releases
api_key: "$GITHUB_TOKEN"
file_glob: true
file: book-release/*
skip_cleanup: true
on:
branch: master
2 changes: 1 addition & 1 deletion LICENSE.asc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2018 Rodrigo Moutinho
Copyright (c) 2019 Rinaldo Pitzer e Rodrigo Moutinho

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
11 changes: 11 additions & 0 deletions book/contributors.asc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[preface]
== Contribuidores

Por ser um livro de código aberto, recebemos várias mudanças de conteúdo e erratas ao longo de seu desenvolvimento. Aqui estão todas as pessoas que contribuíram para a versão em português do livro como um projeto de código aberto. Obrigado a todos por ajudarem a tornar este livro melhor para todos.

[source,tabsize=8]
----
include::contributors.txt[]
----

Esse texto é praticamente o mesmo utilizado no *Pro Git 2*. Acesse o texto original https://raw.githubusercontent.com/progit/progit2/master/book/contributors.asc[aqui].
4 changes: 4 additions & 0 deletions book/license.asc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[preface]
== Licença

include::../LICENSE.asc[]
88 changes: 88 additions & 0 deletions changelog.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
module.exports = {
"disableEmoji": false,
"list": [
"test",
"feat",
"fix",
"chore",
"docs",
"refactor",
"style",
"ci",
"perf"
],
"maxMessageLength": 64,
"minMessageLength": 3,
"questions": [
"type",
"scope",
"subject",
"body",
"breaking",
"issues",
"lerna"
],
"scopes": [
"",
"core",
"lang-enh",
"localization",
"lambda",
"streams",
"concurrency",
"file-io",
"collections"
],
"types": {
"chore": {
"description": "Build process or auxiliary tool changes",
"emoji": "🤖",
"value": "chore"
},
"ci": {
"description": "CI related changes",
"emoji": "🎡",
"value": "ci"
},
"docs": {
"description": "Documentation only changes",
"emoji": "📓",
"value": "docs"
},
"feat": {
"description": "A new feature",
"emoji": "🎸",
"value": "feat"
},
"fix": {
"description": "A bug fix",
"emoji": "🐛",
"value": "fix"
},
"perf": {
"description": "A code change that improves performance",
"emoji": "⚡️",
"value": "perf"
},
"refactor": {
"description": "A code change that neither fixes a bug or adds a feature",
"emoji": "💡",
"value": "refactor"
},
"release": {
"description": "Create a release commit",
"emoji": "🏹",
"value": "release"
},
"style": {
"description": "Markup, white-space, formatting, missing semi-colons...",
"emoji": "💄",
"value": "style"
},
"test": {
"description": "Adding missing tests",
"emoji": "💍",
"value": "test"
}
}
};
11 changes: 10 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,14 @@ services:
image: asciidoctor/docker-asciidoctor
volumes:
- .:/documents/
command: scripts/docker-startup.sh
entrypoint: scripts/docker-startup.sh
network_mode: bridge

travis:
build:
context: .
dockerfile: ./docker/travis/Dockerfile
volumes:
- .:/app
- ./.travis:/root/.travis
network_mode: bridge
17 changes: 17 additions & 0 deletions docker/travis/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM ruby:alpine

RUN apk --update add build-base git \
&& gem install travis \
&& apk del build-base \
&& rm -rf /var/cache/apk/* \
&& rm -rf /tmp/* \
&& mkdir app

WORKDIR app
VOLUME ["/app"]

LABEL maintainer="twitter.com/rcmoutinho"
LABEL description="Travis CLI in a docker container"

ENTRYPOINT ["travis"]
CMD ["--help"]
4 changes: 4 additions & 0 deletions java6-to-java8.asc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ Rinaldo Pitzer; Rodrigo Moutinho

ifdef::ebook-format[:leveloffset: -1]

include::book/license.asc[]

include::book/contributors.asc[]

include::ch01-getting-started.asc[]

include::ch02-language-enhancement.asc[]
Expand Down
59 changes: 59 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"author": "Rinaldo Pitzer e Rodrigo Moutinho",
"name": "java6-to-java8",
"description": "Guia para ajudar devs Java atualizarem sua certificação Java 6 para Java 8.",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/duke-certification/java6-to-java8.git"
},
"bugs": {
"url": "https://github.com/duke-certification/java6-to-java8/issues"
},
"homepage": "https://github.com/duke-certification/java6-to-java8",
"keywords": [
"java",
"java6",
"java8",
"certificate",
"developer",
"update",
"guide"
],
"dependencies": {},
"devDependencies": {
"@commitlint/cli": "^8.0.0",
"@commitlint/config-conventional": "^8.0.0",
"@commitlint/prompt": "^8.0.0",
"@semantic-release/changelog": "^3.0.4",
"@semantic-release/commit-analyzer": "^6.2.0",
"@semantic-release/git": "^7.0.16",
"@semantic-release/github": "^5.4.2",
"@semantic-release/release-notes-generator": "^7.2.1",
"commitizen": "^3.1.1",
"git-cz": "^3.0.1",
"husky": "^2.7.0",
"semantic-release": "^15.13.18",
"semantic-release-cli": "^5.1.1"
},
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
},
"scripts": {
"commit": "./node_modules/.bin/git-cz",
"semantic-release": "./node_modules/.bin/semantic-release",
"semantic-release-cli": "./node_modules/.bin/semantic-release-cli"
},
"commitlint": {
"extends": [
"@commitlint/config-conventional"
]
},
"config": {
"commitizen": {
"path": "@commitlint/prompt"
}
}
}
21 changes: 11 additions & 10 deletions scripts/docker-startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
output_folder=book-output
release_folder=book-release

book_name=java6-to-java8.asc
book_name=java6-to-java8
book_name_asc=$book_name.asc
logs=$output_folder/ebook.log

version=0.1.0
version=${1:-development}
revdate=$(date '+%Y-%m-%d')
params="--attribute revnumber=$version --attribute revdate=$revdate -D $release_folder"

Expand All @@ -16,17 +17,17 @@ printf "\n--------------------------------------------------------\n" >> $logs
printf "$(date '+%Y-%m-%d %H:%M:%S') ---------- Exporting book formats...\n" >> $logs

printf "Converting to HTML...\n"
asciidoctor $params $book_name >> $logs
printf " -- HTML output at java6-to-java8.html\n"
asciidoctor $params $book_name_asc >> $logs
printf " -- HTML output at $book_name.html\n"

printf "Converting to EPub...\n"
asciidoctor-epub3 $params $book_name >> $logs
printf " -- Epub output at java6-to-java8.epub\n"
asciidoctor-epub3 $params $book_name_asc >> $logs
printf " -- Epub output at $book_name.epub\n"

printf "Converting to Mobi (kf8)...\n"
asciidoctor-epub3 $params -a ebook-format=kf8 $book_name >> $logs
printf " -- Mobi output at java6-to-java8.mobi\n"
asciidoctor-epub3 $params -a ebook-format=kf8 $book_name_asc >> $logs
printf " -- Mobi output at $book_name.mobi\n"

printf "Converting to PDF... (this one takes a while)\n"
asciidoctor-pdf $params $book_name 2>/dev/null >> $logs
printf " -- PDF output at java6-to-java8.pdf\n"
asciidoctor-pdf $params $book_name_asc 2>/dev/null >> $logs
printf " -- PDF output at $book_name.pdf\n"