Files
ger-market-java/.gitlab-ci.yml
2023-11-27 16:10:15 +08:00

58 lines
1.6 KiB
YAML

stages:
# 构建
- build
- webhook
build:
image: maven:3.6.3-openjdk-8
stage: build
only:
- main
- develop
before_script:
- 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
https://maven.apache.org/xsd/settings-1.0.0.xsd">
<localRepository>'$PWD'.m2</localRepository>
<servers>
<server>
<id>nexus</id>
<username>nexus_public</username>
<password>9SZ4KXFvGt9N7kRU</password>
</server>
</servers>
</settings>' > $HOME/.m2/settings.xml
artifacts:
name: stock-market.war
expire_in: 1 day
paths:
- ./target/stock-market.war
script:
- echo ">>>>>>Start Building<<<<<<"
- pwd
- java -version
- mvn -v
- mvn clean install -Dmaven.test.skip=true
- ls
#- apt-get install -y curl
#- curl --max-time 20 http://43.128.20.12:11113/api/webhook/justpull?project=api\&setenv_file=alpha.sh\&publish_env=alpha
- echo ">>>>>>Finish Building<<<<<<"
webhook:
stage: webhook
#tags:
# - gz
only:
- main
- develop
script:
- echo ">>>>>>Start Deploy<<<<<<"
- ls
- apt-get update
- apt-get install -y curl
- curl --max-time 30 http://43.139.146.165:11113/api/webhook/justpull?project=market\&setenv_file=alpha.sh\&publish_env=alpha\&shell=deploy-alpha.sh
- echo ">>>>>>Start Deploy Finish<<<<<<"