2
0
mirror of https://github.com/offen/website.git synced 2024-11-22 01:00:26 +01:00

add homepage to global setup

This commit is contained in:
Frederik Ring 2019-07-25 16:14:37 +02:00
parent 020ef4d134
commit 8ee84cf61a
5 changed files with 66 additions and 67 deletions

View File

@ -327,7 +327,6 @@ jobs:
paths:
- ~/offen/packages/node_modules
key: offen-packages-{{ checksum "package.json" }}
- restore_cache:
key: offen-auditorium-{{ checksum "auditorium/package.json" }}
- run:
@ -363,6 +362,56 @@ jobs:
$(npm bin)/sls deploy --config vault/serverless.yml
$(npm bin)/sls client deploy --config vault/serverless.yml --no-confirm
deploy_homepage:
docker:
- image: circleci/python:3.6
working_directory: ~/offen/homepage
environment:
- SOURCE_BRANCH: master
- TARGET_BRANCH: gh-pages
steps:
- checkout:
path: ~/offen
- restore_cache:
key: offen-homepage-{{ checksum "requirements.txt" }}
- run:
name: Install dependencies
command: |
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
- save_cache:
paths:
- ~/offen/homepage/venv
key: offen-homepage-{{ checksum "requirements.txt" }}
- run:
name: Deploy
command: |
source venv/bin/activate
git config --global user.email $GH_EMAIL
git config --global user.name $GH_NAME
git clone $CIRCLE_REPOSITORY_URL out
cd out
git checkout $TARGET_BRANCH || git checkout --orphan $TARGET_BRANCH
git rm -rf .
cd ..
make publish
cp -a output/. out/.
mkdir -p out/.circleci && cp -a .circleci/. out/.circleci/.
cp CNAME out/CNAME
cd out
git add -A
git commit -m "Automated deployment to GitHub Pages: ${CIRCLE_SHA1}" --allow-empty
git push origin $TARGET_BRANCH
workflows:
version: 2
test_build_deploy:
@ -381,3 +430,5 @@ workflows:
<<: *deploy_preconditions
- deploy_python:
<<: *deploy_preconditions
- deploy_homepage:
<<: *deploy_preconditions

View File

@ -13,6 +13,7 @@ setup:
@docker-compose run server go mod download
@docker-compose run kms go mod download
@docker-compose run accounts pip install --user -r requirements.txt -r requirements-dev.txt
@docker-compose run homepage pip install --user -r requirements.txt
@echo "Successfully built containers and installed dependencies."
@echo "If this is your initial setup, you can run 'make bootstrap' next"
@echo "to create the needed local keys and seed the database."

View File

@ -126,6 +126,18 @@ services:
SERVER_HOST: http://server:8080
SESSION_SECRET: vndJRFJTiyjfgtTF
homepage:
build:
context: '.'
dockerfile: Dockerfile.python
working_dir: /offen/homepage
volumes:
- .:/offen
- homepagedeps:/root/.local
command: make devserver
ports:
- 8000:8000
volumes:
kmsdeps:
serverdeps:
@ -133,3 +145,4 @@ volumes:
auditoriumdeps:
vaultdeps:
accountdeps:
homepagedeps:

View File

@ -1,45 +0,0 @@
version: 2
jobs:
build:
branches:
ignore:
- gh-pages
docker:
- image: circleci/python:3.6
working_directory: ~/repo
environment:
- SOURCE_BRANCH: master
- TARGET_BRANCH: gh-pages
steps:
- checkout
- deploy:
name: Deploy
command: |
if [ $CIRCLE_BRANCH == $SOURCE_BRANCH ]; then
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
git config --global user.email $GH_EMAIL
git config --global user.name $GH_NAME
git clone $CIRCLE_REPOSITORY_URL out
cd out
git checkout $TARGET_BRANCH || git checkout --orphan $TARGET_BRANCH
git rm -rf .
cd ..
make publish
cp -a output/. out/.
mkdir -p out/.circleci && cp -a .circleci/. out/.circleci/.
cp CNAME out/CNAME
cd out
git add -A
git commit -m "Automated deployment to GitHub Pages: ${CIRCLE_SHA1}" --allow-empty
git push origin $TARGET_BRANCH
fi

View File

@ -1,21 +0,0 @@
MIT License
Copyright (c) 2019 offen
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.