Commit 8727c9ac authored by James Coyle's avatar James Coyle

Added build script for gitlab.

parent e42d37fd
Pipeline #654 canceled with stages
before_script:
- export PATH=$HOME/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/mvn
- sudo mkdir -p //home/gitlab-runner/.m2/
- echo '<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"><servers><server><id>admin</id><username>admin</username><password>Ander2703!</password></server><server><id>jamescoyle</id><username>admin</username><password>Ander2703!</password></server></servers></settings>' >> /home/gitlab-runner/.m2/settings.xml
stages:
- test
- cleanup
- build
- restart
test:
stage: test
script:
- mvn test
tags:
- twitter
cleanup:
stage: cleanup
script:
- sudo mkdir -p /java/
- sudo rm /java/*.jar
only:
- master
tags:
- twitter
environment:
name: production
build-java:
stage: build
script:
- mvn install
- sudo cp $CI_PROJECT_DIR/target/stock3*complete.jar /java/
only:
- master
tags:
- twitter
environment:
name: production
build-initd:
stage: build
script:
- sudo cp $CI_PROJECT_DIR/java.service /etc/systemd/system/java.service
- sudo systemctl daemon-reload
- sudo systemctl enable java.service
only:
- master
tags:
- twitter
environment:
name: production
service-restart:
stage: restart
script:
- sudo service java stop
- sudo service java start
only:
- master
tags:
- twitter
environment:
name: production
\ No newline at end of file
Markdown is supported
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