Merge branch 'semantic-release-docker' into 'master'

chore: Build and deploy to GitLab Container Registry w semantic-release

See merge request mythic-insight/legendary!24
This commit is contained in:
Robert Prehn 2020-12-18 22:34:53 +00:00
commit db47c0faa2
4 changed files with 6961 additions and 3 deletions

View file

@ -1,4 +1,6 @@
image: "elixir:1.10" stages:
- prebuild_and_test
- deploy
cache: cache:
paths: paths:
@ -11,8 +13,27 @@ variables:
DATABASE_URL: "postgres" DATABASE_URL: "postgres"
MIX_ENV: "test" MIX_ENV: "test"
services: services:
- name: postgres:12 - name: postgres:12
tests: prebuild:
stage: prebuild_and_test
image: "docker"
services:
- docker:19.03.12-dind
script:
- docker build --pull -t $CI_REGISTRY_IMAGE .
test:
stage: prebuild_and_test
image: "elixir:1.10"
script: script/cibuild script: script/cibuild
deploy:
stage: deploy
image: "circleci/node:14.5"
script:
- echo $CI_REGISTRY
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- npm install
- npx semantic-release

27
Dockerfile Normal file
View file

@ -0,0 +1,27 @@
FROM elixir:1.8.0-alpine
RUN apk add make gcc libc-dev
ENV CC=gcc
ENV MIX_HOME=/opt/mix
RUN mix local.hex --force \
&& mix local.rebar --force
WORKDIR /root/app
ADD ./ /root/app/
EXPOSE 4000
ARG MIX_ENV=prod
RUN echo ${MIX_ENV}
ENV MIX_ENV=$MIX_ENV
ENV PORT=4000
RUN mix deps.get
RUN mix deps.compile
RUN MAKE=cmake mix compile
RUN mix phx.digest
CMD ["script/server"]

6869
package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

41
package.json Normal file
View file

@ -0,0 +1,41 @@
{
"name": "@mythic-insight/legendary",
"version": "0.0.0-development",
"description": "The Legendary Phoenix Boilerplate.",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "https://gitlab.com/mythic-insight/legendary.git"
},
"author": "",
"license": "MIT",
"bugs": {
"url": "https://gitlab.com/mythic-insight/legendary/issues"
},
"homepage": "https://gitlab.com/mythic-insight/legendary#readme",
"devDependencies": {
"@semantic-release/commit-analyzer": "^6.1.0",
"@semantic-release/git": "^7.0.8",
"semantic-release": "^15.14.0",
"semantic-release-docker": "^2.2.0"
},
"release": {
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/git",
{
"path": "semantic-release-docker",
"registryUrl": "registry.gitlab.com/mythic-insight/legendary"
}
],
"publish": [
{
"path": "semantic-release-docker",
"name": "registry.gitlab.com/mythic-insight/legendary"
}
]
}
}