Skip to content

Commit

Permalink
Merge pull request #7 from PedroTroller/feat/first-release
Browse files Browse the repository at this point in the history
feat: first release
  • Loading branch information
PedroTroller authored Nov 3, 2020
2 parents 89945fa + 8e99620 commit f0dc698
Show file tree
Hide file tree
Showing 11 changed files with 5,632 additions and 58 deletions.
89 changes: 70 additions & 19 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,80 @@
---
version: 2
version: 2.1

executor: machine

orbs:
docker: circleci/[email protected]
node: circleci/[email protected]

jobs:
fonctionnal:
docker:
- image: docker/compose:1.22.0
environment:
COMPOSE_FILE: docker-compose.yml
tests:
machine:
docker_layer_caching: false
steps:
- checkout
- docker/install-docker
- docker/install-docker-compose
- run: |
docker-compose pull dev
docker-compose build dev
docker-compose up --detach dev
- run: |
docker-compose exec dev composer install
docker-compose exec dev vendor/bin/behat
release-test:
machine:
docker_layer_caching: false
steps:
- run: |
echo 'export NVM_DIR="/opt/circleci/.nvm"' >> $BASH_ENV
echo ' [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> $BASH_ENV
- checkout
- setup-docker-engine
- type: shell
name: Build and run docker container
command: |
docker-compose pull
docker-compose build
docker-compose up -d
- type: shell
name: Run tests
command: |
docker-compose exec http-markup composer install
docker-compose exec http-markup vendor/bin/behat
- docker/install-docker
- docker/install-docker-compose
- docker/check
- run: |
docker-compose pull prod
docker-compose build prod
docker-compose up --detach prod
- run: |
nvm install 15.0.1
npm install
node_modules/.bin/semantic-release --dry-run
release:
machine:
docker_layer_caching: false
steps:
- run: |
echo 'export NVM_DIR="/opt/circleci/.nvm"' >> $BASH_ENV
echo ' [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> $BASH_ENV
- checkout
- docker/install-docker
- docker/install-docker-compose
- docker/check
- run: |
docker-compose pull prod
docker-compose build prod
docker-compose up --detach prod
- run: |
nvm install 15.0.1
npm install
node_modules/.bin/semantic-release
workflows:
version: 2
workflow:
jobs:
- fonctionnal
- tests
- release-test
- release:
requires:
- tests
- release-test
filters:
branches:
only:
- main
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
vendor
Dockerfile
.*
29 changes: 29 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
version: 2

updates:
- package-ecosystem: bundler
directory: '/'
schedule:
interval: "daily"
commit-message:
prefix: fix
- package-ecosystem: composer
directory: '/'
schedule:
interval: "daily"
commit-message:
prefix: fix
prefix-development: test
- package-ecosystem: docker
directory: '/'
schedule:
interval: "daily"
commit-message:
prefix: fix
- package-ecosystem: npm
directory: '/'
schedule:
interval: "daily"
commit-message:
prefix: build
15 changes: 15 additions & 0 deletions .github/semantic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
titleAndCommits: true

types:
- build
- ci
- docs
- feat
- fix
- perf
- refactor
- style
- test

allowMergeCommits: true
12 changes: 12 additions & 0 deletions .releaserc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
branches:
- main
plugins:
-
- '@semantic-release/commit-analyzer'
- preset: conventionnalcommit
- '@semantic-release/release-notes-generator'
- '@semantic-release/github'
-
- semantic-release-docker
- name: pedrotroller/http-markup
55 changes: 28 additions & 27 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
FROM composer:1.7 as composer

FROM php:7.2-apache

RUN apt-get update && \
apt-get install -y --no-install-recommends \
git \
libghc-gnuidn-dev \
perl \
python \
python-pip \
ruby-dev \
unzip \
locales \
zlib1g-dev \
&& rm -rf /var/lib/apt/lists/*
FROM composer:2.0.2 as composer

########################################

FROM php:7.2.0-apache AS prod

RUN apt-get update \
&& apt-get install -y --no-install-recommends \
git \
libghc-gnuidn-dev \
perl \
python \
python-pip \
ruby-dev \
unzip \
locales \
zlib1g-dev \
&& rm -rf /var/lib/apt/lists/*

RUN echo en_US.UTF-8 UTF-8 > /etc/locale.gen && \
locale-gen && \
Expand All @@ -23,23 +25,22 @@ ENV LANG=en_US.UTF-8

RUN pip install docutils==0.14

RUN gem install --no-document github-markup -v 2.0.1 && \
gem install --no-document RedCloth && \
gem install --no-document asciidoctor && \
gem install --no-document commonmarker && \
gem install --no-document creole && \
gem install --no-document org-ruby && \
gem install --no-document rdoc -v 3.6.1 && \
gem install --no-document redcarpet && \
gem install --no-document wikicloth
RUN gem install bundler

COPY --from=composer /usr/bin/composer /usr/bin/composer
RUN composer global require hirak/prestissimo

WORKDIR /var/www/html

COPY composer.* /var/www/html/

RUN composer install --no-scripts --no-dev

COPY Gemfile* /var/www/html/
RUN bundler install

COPY . /var/www/html

########################################

FROM prod AS dev

RUN composer install --no-scripts --no-dev
11 changes: 11 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
source 'https://rubygems.org'

gem "github-markup", "=2.0.1"
gem "RedCloth", "=4.3.2"
gem "asciidoctor", "=2.0.10"
gem "commonmarker", "=0.21.0"
gem "creole", "=0.5.0"
gem "org-ruby", "=0.9.12"
gem "rdoc", "=3.6.1"
gem "redcarpet", "=3.5.0"
gem "wikicloth", "=0.8.3"
9 changes: 0 additions & 9 deletions docker-compose.override.yml

This file was deleted.

15 changes: 12 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
---
version: '2'
version: '3.8'

services:
http-markup:
build: .
prod:
build:
context: .
target: prod
image: pedrotroller/http-markup

dev:
build:
context: .
target: dev
volumes:
- '.:/var/www/html/'
Loading

0 comments on commit f0dc698

Please sign in to comment.