Commit 9b3e4104 authored by mrodzis's avatar mrodzis 🐸
Browse files

Merge branch 'feature/#203-ci-remove-entry-point-at-merge' into 'develop'

Feature/#203 ci remove entry point at merge

Closes #203

See merge request subugoe/emo/Qviewer!135
parents bc33c2b2 45ad0096
Pipeline #190356 passed with stages
in 2 minutes and 20 seconds
#!/bin/bash
# This script has originally been a template at .gitlab-ci.yml.
# In order to use it within a Bash conditional we moved it to this script file.
bash .ci-scripts/set_entrypoint_ci.sh
npm install
npm run build
npm run tweak:build
\ No newline at end of file
#!/bin/bash
FILE="src/index.template.html"
if grep -q '"entrypoint": ""' "$FILE"; then
echo "No entry point update required."
echo "CONTINUE_BUILD=true" >> build.env
else
echo "Entry point has to be removed."
mkdir -p /tmp/this && cd /tmp/this || exit
git clone git@gitlab.gwdg.de:subugoe/emo/QViewer.git
cd QViewer || exit
sed -i 's/"entrypoint": ".*"/"entrypoint": ""/' src/index.template.html
git add src/index.template.html && git commit -m "ci: remove entry point" && git push
echo "CONTINUE_BUILD=false" >> build.env
fi
\ No newline at end of file
......@@ -3,16 +3,33 @@ cache:
- node_modules/
stages:
- clean
- build
- deploy
- preserve-pages
# Templates
.build: &build
- bash .ci-scripts/set_entrypoint_ci.sh
- npm install
- npm run build
- npm run tweak:build
.git: &git
- eval $(ssh-agent -s)
- echo "$DEPLOY_KEY" | tr -d '\r' | ssh-add - > /dev/null
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- ssh-keyscan gitlab.gwdg.de >> ~/.ssh/known_hosts
- git config --global user.email "tido@gitlab.gwdg.de"
- git config --global user.name "Gitlab CI"
clean_up:
image: docker.gitlab.gwdg.de/mrodzis/docker-images/debian
stage: clean
only:
- main
- develop
script:
- *git
- bash .ci-scripts/remove_entrypoint.sh
artifacts:
reports:
dotenv: build.env
build_test:
image: docker.gitlab.gwdg.de/subugoe/emo/qviewer/node:latest
......@@ -21,7 +38,7 @@ build_test:
- develop
stage: build
script:
- *build
- bash .ci-scripts/build.sh
artifacts:
paths:
- dist/
......@@ -33,7 +50,7 @@ build_main_and_develop:
- develop
stage: build
script:
- *build
- if [[ $CONTINUE_BUILD == "true" ]]; then bash .ci-scripts/build.sh; fi
artifacts:
paths:
- dist/
......@@ -83,21 +100,6 @@ pushback:
paths:
- updated-artifact.zip
.production:
image: node:latest
only:
- main
stage: deploy
script:
- npm install
- npm run build
- npm run tweak:build
- mkdir tido && mv dist/* tido/
artifacts:
expire_in: 5 yrs
paths:
- tido
# when a git flow release is made, a tag will be pushed starting this job. it
# will keep the resulting artifact from the job declared in `JOB_NUMBER_TO_PRESERVE`
# and it will set up a Gitlab release at the repo. therefore the merge message starting
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment