Compare commits

..

5 Commits

Author SHA1 Message Date
Joe Bellus 2a59dbebf8 fixed rule 2022-02-11 16:15:01 -05:00
Joe Bellus c7d1ec2704 Finalized CI 2022-02-11 16:13:07 -05:00
Joe Bellus 078086887e added targz for arm build 2022-02-11 15:36:23 -05:00
Joe Bellus 13eaedcf59 Testing binary upload 2022-02-11 15:14:40 -05:00
Joe Bellus 92749fcfa2 CHanged listning host to 0.0.0.0 2022-02-11 10:31:24 -05:00
3 changed files with 18 additions and 19 deletions

View File

@ -1,20 +1,20 @@
stages:
# - test
- test
- ui
- build
- deploy
- release
# test:
# image: "rust:slim-buster"
# stage: test
# script:
# - mkdir dist
# - touch dist/index.html
# - apt-get update
# - apt-get -y install pkg-config
# - cargo test
test:
image: "rust:slim-buster"
stage: test
script:
- mkdir dist
- touch dist/index.html
- apt-get update
- apt-get -y install pkg-config
- cargo test
build-ui:
stage: ui
@ -24,8 +24,8 @@ build-ui:
- apt-get -y install libssl-dev
- npm install
- npm run build
# rules:
# - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
artifacts:
paths:
- dist/
@ -57,6 +57,8 @@ build-musl-bin:
- build-ui
stage: build
image: 'rust:latest'
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
script:
- rustup target add x86_64-unknown-linux-musl
- apt update && apt install -y musl-tools musl-dev
@ -88,6 +90,7 @@ build-arm-bin:
artifacts:
paths:
- target/armv7-unknown-linux-gnueabihf/release/vade
- vade-linux-arm.tar.gz
build-win-bin:
@ -113,8 +116,8 @@ deploy-dev-docker:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker build -t $CI_REGISTRY/vade/vade-mecum .
- docker push $CI_REGISTRY/vade/vade-mecum
# rules:
# - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
deploy-binaries:
dependencies:
@ -128,11 +131,8 @@ deploy-binaries:
- if: $CI_COMMIT_TAG
script:
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file ./vade-linux-x64.tar.gz "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/bin/$CI_COMMIT_TAG/vade-linux-x64-$CI_COMMIT_TAG.tar.gz"'
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file ./vade-linux-arm.tar.gz "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/bin/$CI_COMMIT_TAG/vade-linux-arm-$CI_COMMIT_TAG.tar.gz"'
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file ./vade-linux-musl.tar.gz "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/bin/$CI_COMMIT_TAG/vade-linux-musl-$CI_COMMIT_TAG.tar.gz"'
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file ./target/release/vade.exe "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/bin/$CI_COMMIT_TAG/vade.exe"'
release:

View File

@ -3,5 +3,4 @@ COPY target/x86_64-unknown-linux-musl/release/vade /app/vade
EXPOSE 8080
WORKDIR app
RUN touch data.db
RUN ls -lh
CMD ["./vade"]

View File

@ -41,7 +41,7 @@ async fn main() {
.service(api::routes())
.service(dist)
})
.bind("127.0.0.1:8080")
.bind("0.0.0.0:8080")
.unwrap()
.run()
.await