Skip to content

Commit

Permalink
Merge branch 'develop' into 'master'
Browse files Browse the repository at this point in the history
Release 1.2

See merge request mishamyrt/myrt.co!9
  • Loading branch information
mishamyrt committed Sep 15, 2019
2 parents 94f5b4d + 68d5d36 commit a54d2c4
Show file tree
Hide file tree
Showing 37 changed files with 1,578 additions and 428 deletions.
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ image: node:lts-alpine

variables:
DOCKER_DRIVER: overlay
IMAGE_VERSION: $CI_PIPELINE_ID
DOMAIN: "myrt.co"
BUILD_VERSION: $CI_PIPELINE_ID

cache:
key: $CI_COMMIT_REF_NAME
Expand Down
19 changes: 15 additions & 4 deletions .gitlab/ci/deploy.gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
deploy to myrt.co:
only:
- master
.deploy:
image: pwinik/ansible
stage: deploy
cache: {}
Expand All @@ -24,4 +22,17 @@ deploy to myrt.co:
-e REGISTRY_PASSWORD="\"$CI_JOB_TOKEN\""
-e REGISTRY_URL="\"$CI_REGISTRY\""
-e IMAGE_NAME="\"$CI_REGISTRY_IMAGE\""
-e IMAGE_VERSION="\"$IMAGE_VERSION\""
-e IMAGE_VERSION="\"$BUILD_VERSION\""
continuous deploy to myrt.co:
only:
- master
extends: .deploy

manual deploy to myrt.co:
only:
- tags
when: "manual"
variables:
BUILD_VERSION: $CI_COMMIT_REF_NAME
extends: .deploy
23 changes: 19 additions & 4 deletions .gitlab/ci/dockerize.gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,27 @@
build docker image:
.build image:
image: docker:latest
cache: {}
only:
- master
stage: dockerize
tags:
- docker
services: ["docker:dind"]
before_script:
- echo -n $CI_JOB_TOKEN | docker login -u gitlab-ci-token --password-stdin $CI_REGISTRY
script:
- docker build -t $CI_REGISTRY_IMAGE -f docker/Dockerfile .
- docker build -t $CI_REGISTRY_IMAGE:$BUILD_VERSION -f docker/Dockerfile .
- docker push $CI_REGISTRY_IMAGE

build docker image:
extends: .build image
only:
- master

build backup docker image:
extends: .build image
variables:
BUILD_VERSION: $CI_COMMIT_REF_NAME
only:
- tags



1 change: 1 addition & 0 deletions .gitlab/ci/qa.gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ codestyle check:
- npm run lint

size check:
image: buildkite/puppeteer
stage: quality assurance
before_script:
- npm ci
Expand Down
22 changes: 0 additions & 22 deletions .gitlab/issue_templates/merge_request_templates.md

This file was deleted.

20 changes: 20 additions & 0 deletions .gitlab/merge_request_templates/release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
### Added

- Cool CI feature.
- New page.

### Changed

- Better colours

### Fixed

- Bug with links

### Removed

- Some crap

/assign @mishamyrt
/merge
/title Release 1.0
56 changes: 40 additions & 16 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,51 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
The format is based on [Keep a Changelog][],
and this project adheres to [Semantic Versioning][].

## [1.1] — 2019-09-15
## [1.2][] — 2019-09-15

### Added

- English pages.
- Pug linting.
- 16×16 favicon.
- Nginx language redirect.
- Build tagged commits.
- Service worker.
- Web Manifest.
- Font swap logic.
- Dynamic `theme-color`.

### Changed

- CSS transormed to SCSS.

## [1.1][] — 2019-09-15

## [1.0] - 2019-09-14
### Added
- Basic desktop and mobile layout.
- Build system.
- CI/CD.
- Only russian language.
- Added basic lints.
- Forced code style.
- Hooks.

[1.1]: https://gitlab.com/mishamyrt/myrt.co/tree/v1.0
- English pages.
- Pug linting.
- 16×16 favicon.
- Nginx language redirect.

## [1.0][] - 2019-09-14

### Added

- Basic desktop and mobile layout.
- Build system.
- CI/CD.
- Only russian language.
- Added basic lints.
- Forced code style.
- Hooks.

[keep a changelog]: https://keepachangelog.com/en/1.0.0/

[semantic versioning]: https://semver.org/spec/v2.0.0.html

[1.0]: https://gitlab.com/mishamyrt/myrt.co/tree/v1.1

[1.1]: https://gitlab.com/mishamyrt/myrt.co/tree/v1.0

[1.2]: https://gitlab.com/mishamyrt/myrt.co/tree/v1.2
17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ To run the site locally, you should have Node.JS older than version 10 installed

### Installing

1. Clone repo
2. `npm install`
3. ...
4. Profit
1. Clone repo
2. `npm install`
3. ...
4. Profit

### Serve

Expand All @@ -29,19 +29,18 @@ Deploy logic is implemented on ansible playbook.

## Built With

* [Parcel](https://parceljs.org/) — Incredible bundler
* [Pug](https://pugjs.org/) — Template engine
* [Docker](https://www.docker.com/) — Container engine
- [Parcel](https://parceljs.org/) — Incredible bundler
- [Pug](https://pugjs.org/) — Template engine
- [Docker](https://www.docker.com/) — Container engine

## Versioning

I use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://gitlab.com/mishamyrt/myrt.co/-/tags).

## Authors

* **Mikhael Khrustik***Initial work*
- **Mikhael Khrustik**_Initial work_

## License

This project is licensed under the WTFPL License - see the [LICENSE](LICENSE) file for details

23 changes: 16 additions & 7 deletions build.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ const { promisify } = require('util')
const Bundler = require('parcel-bundler')
const Typograf = require('typograf')

const rimram = promisify(require('rimraf'))
const readDir = promisify(fs.readdir)
const readFile = promisify(fs.readFile)
const writeFile = promisify(fs.writeFile)
Expand Down Expand Up @@ -42,29 +41,39 @@ function improveHtml (filePath) {
})
return $.html()
})
.then((html) => (html = html.replace(/index\.html/g, '')))
.then((html) => (html = html.replace(/\.html/g, '')))
.then((html) => writeFile(filePath, html))
}

function getHtmlFiles () {
return Promise.all([
readDir(join(outDir, 'ru')),
readDir(join(outDir, 'en')),
]).then((files) => {
const filePaths = []
files[0].forEach((file) => filePaths.push(join(outDir, 'ru', file)))
files[1].forEach((file) => filePaths.push(join(outDir, 'en', file)))
return filePaths
})
}

bundler.on('bundled', () => {
let files
return unlink(indexPath)
.then(() => readDir(join(outDir, 'ru')))
.then(() => getHtmlFiles())
.then((result) => (files = result))
.then(() => {
const stack = []
for (const file of files) {
if (file.includes('.html')) {
stack.push(
improveHtml(join(outDir, 'ru', file))
)
stack.push(improveHtml(file))
}
}
return Promise.all(stack)
})
.then(() => process.exit(0))
})

rimram(outDir)
.then(() => bundler.bundle())
bundler.bundle()

2 changes: 1 addition & 1 deletion docker/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
- name: "Recreate Docker image"
docker_container:
name: "myrt-co"
image: "{{ IMAGE_NAME }}"
image: "{{ IMAGE_NAME }}:{{ IMAGE_VERSION }}"
recreate: "yes"
restart_policy: "always"
pull: "yes"
Expand Down
Loading

0 comments on commit a54d2c4

Please sign in to comment.