diff --git a/.deploy.sh b/.deploy.sh deleted file mode 100755 index 793decb2c7548f267e55611298187056c447ab27..0000000000000000000000000000000000000000 --- a/.deploy.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -set -e - -printf "\n\n\n\n-------\n\n" - -echo $(date --rfc-3339=seconds) - -SOURCE="${BASH_SOURCE[0]}" -while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink - DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" - SOURCE="$(readlink "$SOURCE")" - [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located -done -DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" - -cd $DIR - -git fetch origin -git reset --hard origin/master - -bower install - -curl --request POST 'https://push.dbogatov.org/api/push/deploy' --data "project=Inara-CV" diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000000000000000000000000000000000000..fc7284b150d45a7d89bc410b0aae84cae32bdcf2 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,11 @@ +Dockerfile +.gitlab-ci.yml +.editorconfig +README.md +.git +bower.json +.bowerrc +.gitignore +build.sh +package.json +node_modules/ diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000000000000000000000000000000000000..1a59ed3f5756463975caf34318bcbbba2a9ac092 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,14 @@ +# http://editorconfig.org +root = true + +[*] +indent_style = tab +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = false +insert_final_newline = true + +[*.yml] +indent_style = space +indent_size = 2 diff --git a/.gitignore b/.gitignore index 6dbf63199de150d3ab460c5456c3a85ff9ef423d..f803d44c9570d2aaeab9f0097c9baa72cdddd873 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ bower/ +node_modules/ diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 776915c65ffa09a06a1570a3c64789d9b93e2e69..e26d521d18740272821d93a7e5df9a10e5fca786 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,57 @@ -production: - type: deploy +stages: +- build +- test +- release + +build: + image: mhart/alpine-node + stage: build + script: + - ./build.sh + artifacts: + expire_in: 30 min + paths: + - index.html + - js/ + - css/ + - img/ + - bower/ + tags: + - Docker + +tidy: + image: dbogatov/docker-containers:jekyll-latest + stage: test + dependencies: + - build + before_script: + - http-server -p 8080 > /dev/null & + - sleep 5 script: - - curl --request POST 'https://deploy.dbogatov.org/deploy' --data "token=$TOKEN" --data "project=Inara-CV" - only: - - master \ No newline at end of file + - curl -Ls http://localhost:8080/index.html | tidy -e + tags: + - Docker + +blc: + image: dbogatov/docker-containers:jekyll-latest + stage: test + dependencies: + - build + before_script: + - http-server -p 8080 > /dev/null & + - sleep 5 + script: + - blc --filter-level 3 --input http://localhost:8080/index.html -rog --exclude "*linkedin.*" + tags: + - Docker + +dockerify: + stage: release + dependencies: + - build + script: + - docker build -t registry.dbogatov.org/dbogatov/inara-cv . + - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN registry.dbogatov.org + - docker push registry.dbogatov.org/dbogatov/inara-cv + tags: + - Shell diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..90a4ce53fc758cbdccf97d9f43414a4264cda0cd --- /dev/null +++ b/Dockerfile @@ -0,0 +1,16 @@ +FROM dbogatov/docker-containers:nginx-latest + +MAINTAINER Dmytro Bogatov dmytro@dbogatov.org + +WORKDIR /srv + +# Copy the source +COPY . . + +# Copy the NGINX config +COPY nginx.conf /etc/nginx/conf.d/default.conf + +# Remove NGINX config from source +RUN rm nginx.conf + +CMD ["nginx", "-g", "daemon off;"] diff --git a/build.sh b/build.sh new file mode 100755 index 0000000000000000000000000000000000000000..307f5afa8d6b24119b74bf51a3baca30c3dc02ed --- /dev/null +++ b/build.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +set -e + +echo "Installing node modules... Requires NPM" +npm install --loglevel=error > /dev/null + +echo "Installing Bower libraries... Requires Bower (installed by NPM)" +$(npm bin)/bower install > /dev/null + +echo "Build completed!" diff --git a/favicon.ico b/favicon.ico deleted file mode 100644 index ef65eb31cc85223d5999fc3bbad7fb1af5c00dbd..0000000000000000000000000000000000000000 Binary files a/favicon.ico and /dev/null differ diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000000000000000000000000000000000000..15169d9c0d77f050bc02d5792e066a323e774ffb --- /dev/null +++ b/nginx.conf @@ -0,0 +1,14 @@ +server { + listen 80; + server_name _; + + root /srv/; + + location = / { + index index.html; + } + + location / { + try_files $uri.html $uri =404; + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000000000000000000000000000000000000..83cafd9ba101fa30aa98982303fce3884bb9fefb --- /dev/null +++ b/package.json @@ -0,0 +1,7 @@ +{ + "name": "Inara-CV", + "version": "1.0.0", + "devDependencies": { + "bower": "^1.8.0" + } +}