From dc0bd016619684d1a38a53f22844a93ec63f45bf Mon Sep 17 00:00:00 2001 From: philipp Date: Sun, 30 Jul 2023 15:57:37 +0200 Subject: [PATCH 01/22] first draft of ci deploy --- .gitlab-ci.yml | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d98e2fd..9c26584 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,10 +1,38 @@ -stages: - - build +image: rust:latest -rust-latest: +variables: + CARGO_TARGET: x86_64-unknown-linux-musl + +before_script: + - rustup target add $CARGO_TARGET + - apt-get update -qq && apt-get install -y -qq sshpass + +build: stage: build + script: + - cargo build --release --target $CARGO_TARGET + artifacts: + paths: + - target/$CARGO_TARGET/release/rot + expire_in: 1 week + +test: + stage: test image: rust:latest script: - apt update && apt install -y sqlite3 && ./test_db.sh - cargo build --verbose - cargo test --verbose + +deploy: + stage: deploy + before_script: + - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )' + - eval $(ssh-agent -s) + - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - + - mkdir -p ~/.ssh + - chmod 700 ~/.ssh + script: + - scp target/$CARGO_TARGET/release/rot $SSH_USER@$SSH_HOST:/home/k004373/rowing-staging + only: + - staging From b27953dc410e5e14fb3a0101276aca0d3e537d49 Mon Sep 17 00:00:00 2001 From: philipp Date: Sun, 30 Jul 2023 15:59:51 +0200 Subject: [PATCH 02/22] fix --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9c26584..fb85355 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,7 +5,7 @@ variables: before_script: - rustup target add $CARGO_TARGET - - apt-get update -qq && apt-get install -y -qq sshpass + - apt-get update -qq && apt-get install -y -qq sshpass musl build: stage: build From 6831ac00b711ed7573d36231466da838636ae0ef Mon Sep 17 00:00:00 2001 From: philipp Date: Sun, 30 Jul 2023 16:02:02 +0200 Subject: [PATCH 03/22] push --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fb85355..edb4340 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,7 +5,7 @@ variables: before_script: - rustup target add $CARGO_TARGET - - apt-get update -qq && apt-get install -y -qq sshpass musl + - apt-get update -qq && apt-get install -y -qq sshpass musl musl-tools build: stage: build From 4d53bdb724db91789fd61b92fe5c4fcfb999e7d8 Mon Sep 17 00:00:00 2001 From: philipp Date: Sun, 30 Jul 2023 16:10:56 +0200 Subject: [PATCH 04/22] push --- .gitlab-ci.yml | 3 +-- rotstaging.service | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 rotstaging.service diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index edb4340..2f72f81 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,6 +6,7 @@ variables: before_script: - rustup target add $CARGO_TARGET - apt-get update -qq && apt-get install -y -qq sshpass musl musl-tools + - apt update && apt install -y sqlite3 && ./test_db.sh build: stage: build @@ -20,8 +21,6 @@ test: stage: test image: rust:latest script: - - apt update && apt install -y sqlite3 && ./test_db.sh - - cargo build --verbose - cargo test --verbose deploy: diff --git a/rotstaging.service b/rotstaging.service new file mode 100644 index 0000000..8091a14 --- /dev/null +++ b/rotstaging.service @@ -0,0 +1,16 @@ +[Unit] +Description=Rot Staging + +[Service] +User=root +Group=root +WorkingDirectory=/home/k004373/rowing-staging +Environment="ROCKET_ENV=prod" +Environment="ROCKET_ADDRESS=127.0.0.1" +Environment="ROCKET_PORT=7999" +Environment="ROCKET_LOG=info" +ExecStart=./rot + +[Install] +WantedBy=multi-user.target + From ae0ef8e18f22e1fd490f1526dc62ed6795a70ae5 Mon Sep 17 00:00:00 2001 From: philipp Date: Sun, 30 Jul 2023 16:27:54 +0200 Subject: [PATCH 05/22] push --- .gitlab-ci.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2f72f81..6e28ef7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -28,10 +28,17 @@ deploy: before_script: - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )' - eval $(ssh-agent -s) + - echo "$SSH_PRIVATE_KEY" - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - - mkdir -p ~/.ssh - chmod 700 ~/.ssh script: - scp target/$CARGO_TARGET/release/rot $SSH_USER@$SSH_HOST:/home/k004373/rowing-staging + - ssh $SSH_USER@$SSH_HOST 'rm /home/k004373/rowing-staging/db.sqlite && cp /home/k004373/rowing/db.sqlite /home/k004373/rowing-staging/db.sqlite' + - scp -r static $SSH_USER@$SSH_HOST:/home/k004373/rowing-staging/ + - scp -r templates $SSH_USER@$SSH_HOST:/home/k004373/rowing-staging/ + - scp -r svelte $SSH_USER@$SSH_HOST:/home/k004373/rowing-staging/ + - ssh $SSH_USER@$SSH_HOST '/bin/systemctl restart rotstaging' + only: - staging From 36f800d65cfc7993e65c9ebbe4c777e6a8c47922 Mon Sep 17 00:00:00 2001 From: philipp Date: Sun, 30 Jul 2023 16:31:38 +0200 Subject: [PATCH 06/22] push --- .gitlab-ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6e28ef7..b536abe 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -28,8 +28,7 @@ deploy: before_script: - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )' - eval $(ssh-agent -s) - - echo "$SSH_PRIVATE_KEY" - - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - + - echo "$SSH_PRIVATE_KEY" | ssh-add - - mkdir -p ~/.ssh - chmod 700 ~/.ssh script: From cfba5bc856d5fce226247fd099a0a6ee7212be61 Mon Sep 17 00:00:00 2001 From: philipp Date: Sun, 30 Jul 2023 16:46:57 +0200 Subject: [PATCH 07/22] push --- .gitlab-ci.yml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b536abe..aeb74c2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -23,7 +23,7 @@ test: script: - cargo test --verbose -deploy: +deploy-staging: stage: deploy before_script: - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )' @@ -31,6 +31,7 @@ deploy: - echo "$SSH_PRIVATE_KEY" | ssh-add - - mkdir -p ~/.ssh - chmod 700 ~/.ssh + - ssh-keyscan -H $SSH_HOST > ~/.ssh/known_hosts script: - scp target/$CARGO_TARGET/release/rot $SSH_USER@$SSH_HOST:/home/k004373/rowing-staging - ssh $SSH_USER@$SSH_HOST 'rm /home/k004373/rowing-staging/db.sqlite && cp /home/k004373/rowing/db.sqlite /home/k004373/rowing-staging/db.sqlite' @@ -41,3 +42,21 @@ deploy: only: - staging + +deploy-main: + stage: deploy + before_script: + - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )' + - eval $(ssh-agent -s) + - echo "$SSH_PRIVATE_KEY" | ssh-add - + - mkdir -p ~/.ssh + - chmod 700 ~/.ssh + script: + - scp target/$CARGO_TARGET/release/rot $SSH_USER@$SSH_HOST:/home/k004373/rowing + - scp -r static $SSH_USER@$SSH_HOST:/home/k004373/rowing/ + - scp -r templates $SSH_USER@$SSH_HOST:/home/k004373/rowing/ + - scp -r svelte $SSH_USER@$SSH_HOST:/home/k004373/rowing/ + - ssh $SSH_USER@$SSH_HOST '/bin/systemctl restart rot' + + only: + - main From 002cd3e6eb32d8425c77fe98db5a0b5bebeeabff Mon Sep 17 00:00:00 2001 From: philipp Date: Sun, 30 Jul 2023 17:14:56 +0200 Subject: [PATCH 08/22] push --- .gitlab-ci.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index aeb74c2..898cc3a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -34,12 +34,11 @@ deploy-staging: - ssh-keyscan -H $SSH_HOST > ~/.ssh/known_hosts script: - scp target/$CARGO_TARGET/release/rot $SSH_USER@$SSH_HOST:/home/k004373/rowing-staging - - ssh $SSH_USER@$SSH_HOST 'rm /home/k004373/rowing-staging/db.sqlite && cp /home/k004373/rowing/db.sqlite /home/k004373/rowing-staging/db.sqlite' + - ssh $SSH_USER@$SSH_HOST 'rm /home/k004373/rowing-staging/db.sqlite && cp /home/k004373/rowing/db.sqlite /home/k004373/rowing-staging/db.sqlite && mkdir /home/k004373/rowing-staging/svelte/build' - scp -r static $SSH_USER@$SSH_HOST:/home/k004373/rowing-staging/ - scp -r templates $SSH_USER@$SSH_HOST:/home/k004373/rowing-staging/ - scp -r svelte $SSH_USER@$SSH_HOST:/home/k004373/rowing-staging/ - - ssh $SSH_USER@$SSH_HOST '/bin/systemctl restart rotstaging' - + - ssh $SSH_USER@$SSH_HOST 'sudo systemctl restart rotstaging' only: - staging @@ -51,12 +50,12 @@ deploy-main: - echo "$SSH_PRIVATE_KEY" | ssh-add - - mkdir -p ~/.ssh - chmod 700 ~/.ssh + - ssh-keyscan -H $SSH_HOST > ~/.ssh/known_hosts script: - scp target/$CARGO_TARGET/release/rot $SSH_USER@$SSH_HOST:/home/k004373/rowing - scp -r static $SSH_USER@$SSH_HOST:/home/k004373/rowing/ - scp -r templates $SSH_USER@$SSH_HOST:/home/k004373/rowing/ - scp -r svelte $SSH_USER@$SSH_HOST:/home/k004373/rowing/ - - ssh $SSH_USER@$SSH_HOST '/bin/systemctl restart rot' - + - ssh $SSH_USER@$SSH_HOST 'sudo systemctl restart rot' only: - main From 6bc94c14821aa6f26e8adcfbaf39d7c2ac0d226f Mon Sep 17 00:00:00 2001 From: philipp Date: Sun, 30 Jul 2023 17:27:32 +0200 Subject: [PATCH 09/22] push --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 898cc3a..589e6b9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -33,6 +33,7 @@ deploy-staging: - chmod 700 ~/.ssh - ssh-keyscan -H $SSH_HOST > ~/.ssh/known_hosts script: + - ssh $SSH_USER@$SSH_HOST 'sudo systemctl stop rotstaging' - scp target/$CARGO_TARGET/release/rot $SSH_USER@$SSH_HOST:/home/k004373/rowing-staging - ssh $SSH_USER@$SSH_HOST 'rm /home/k004373/rowing-staging/db.sqlite && cp /home/k004373/rowing/db.sqlite /home/k004373/rowing-staging/db.sqlite && mkdir /home/k004373/rowing-staging/svelte/build' - scp -r static $SSH_USER@$SSH_HOST:/home/k004373/rowing-staging/ @@ -52,6 +53,7 @@ deploy-main: - chmod 700 ~/.ssh - ssh-keyscan -H $SSH_HOST > ~/.ssh/known_hosts script: + - ssh $SSH_USER@$SSH_HOST 'sudo systemctl stop rot' - scp target/$CARGO_TARGET/release/rot $SSH_USER@$SSH_HOST:/home/k004373/rowing - scp -r static $SSH_USER@$SSH_HOST:/home/k004373/rowing/ - scp -r templates $SSH_USER@$SSH_HOST:/home/k004373/rowing/ From d334e575b41de6daff978682ca58041b5b9f462c Mon Sep 17 00:00:00 2001 From: philipp Date: Sun, 30 Jul 2023 17:28:50 +0200 Subject: [PATCH 10/22] push --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 589e6b9..1407b77 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -39,7 +39,7 @@ deploy-staging: - scp -r static $SSH_USER@$SSH_HOST:/home/k004373/rowing-staging/ - scp -r templates $SSH_USER@$SSH_HOST:/home/k004373/rowing-staging/ - scp -r svelte $SSH_USER@$SSH_HOST:/home/k004373/rowing-staging/ - - ssh $SSH_USER@$SSH_HOST 'sudo systemctl restart rotstaging' + - ssh $SSH_USER@$SSH_HOST 'sudo systemctl start rotstaging' only: - staging @@ -58,6 +58,6 @@ deploy-main: - scp -r static $SSH_USER@$SSH_HOST:/home/k004373/rowing/ - scp -r templates $SSH_USER@$SSH_HOST:/home/k004373/rowing/ - scp -r svelte $SSH_USER@$SSH_HOST:/home/k004373/rowing/ - - ssh $SSH_USER@$SSH_HOST 'sudo systemctl restart rot' + - ssh $SSH_USER@$SSH_HOST 'sudo systemctl start rot' only: - main From f2026d8d8438758fb2864c55a90a18d2e279fde5 Mon Sep 17 00:00:00 2001 From: philipp Date: Sun, 30 Jul 2023 17:30:11 +0200 Subject: [PATCH 11/22] push --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1407b77..ba43527 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -55,6 +55,7 @@ deploy-main: script: - ssh $SSH_USER@$SSH_HOST 'sudo systemctl stop rot' - scp target/$CARGO_TARGET/release/rot $SSH_USER@$SSH_HOST:/home/k004373/rowing + - ssh $SSH_USER@$SSH_HOST 'mkdir /home/k004373/rowing-staging/svelte/build' - scp -r static $SSH_USER@$SSH_HOST:/home/k004373/rowing/ - scp -r templates $SSH_USER@$SSH_HOST:/home/k004373/rowing/ - scp -r svelte $SSH_USER@$SSH_HOST:/home/k004373/rowing/ From f40d409c3d2c4b82bd657511dba45ca9c0a5ec04 Mon Sep 17 00:00:00 2001 From: philipp Date: Sun, 30 Jul 2023 17:30:40 +0200 Subject: [PATCH 12/22] push --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ba43527..da70875 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -55,10 +55,10 @@ deploy-main: script: - ssh $SSH_USER@$SSH_HOST 'sudo systemctl stop rot' - scp target/$CARGO_TARGET/release/rot $SSH_USER@$SSH_HOST:/home/k004373/rowing - - ssh $SSH_USER@$SSH_HOST 'mkdir /home/k004373/rowing-staging/svelte/build' - scp -r static $SSH_USER@$SSH_HOST:/home/k004373/rowing/ - scp -r templates $SSH_USER@$SSH_HOST:/home/k004373/rowing/ - scp -r svelte $SSH_USER@$SSH_HOST:/home/k004373/rowing/ + - ssh $SSH_USER@$SSH_HOST 'mkdir /home/k004373/rowing-staging/svelte/build' - ssh $SSH_USER@$SSH_HOST 'sudo systemctl start rot' only: - main From ee2ae2e35d51c2941cf0e209763bd0ecb9a9d481 Mon Sep 17 00:00:00 2001 From: philipp Date: Sun, 30 Jul 2023 17:41:34 +0200 Subject: [PATCH 13/22] push --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index da70875..9ee8d8b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -35,7 +35,7 @@ deploy-staging: script: - ssh $SSH_USER@$SSH_HOST 'sudo systemctl stop rotstaging' - scp target/$CARGO_TARGET/release/rot $SSH_USER@$SSH_HOST:/home/k004373/rowing-staging - - ssh $SSH_USER@$SSH_HOST 'rm /home/k004373/rowing-staging/db.sqlite && cp /home/k004373/rowing/db.sqlite /home/k004373/rowing-staging/db.sqlite && mkdir /home/k004373/rowing-staging/svelte/build' + - ssh $SSH_USER@$SSH_HOST 'rm /home/k004373/rowing-staging/db.sqlite && cp /home/k004373/rowing/db.sqlite /home/k004373/rowing-staging/db.sqlite && mkdir -p /home/k004373/rowing-staging/svelte/build' - scp -r static $SSH_USER@$SSH_HOST:/home/k004373/rowing-staging/ - scp -r templates $SSH_USER@$SSH_HOST:/home/k004373/rowing-staging/ - scp -r svelte $SSH_USER@$SSH_HOST:/home/k004373/rowing-staging/ From 88dd0470a2ebb2ed5aebb170cd966cdd9ee58826 Mon Sep 17 00:00:00 2001 From: philipp Date: Sun, 30 Jul 2023 17:42:01 +0200 Subject: [PATCH 14/22] push --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9ee8d8b..60c28fd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -58,7 +58,7 @@ deploy-main: - scp -r static $SSH_USER@$SSH_HOST:/home/k004373/rowing/ - scp -r templates $SSH_USER@$SSH_HOST:/home/k004373/rowing/ - scp -r svelte $SSH_USER@$SSH_HOST:/home/k004373/rowing/ - - ssh $SSH_USER@$SSH_HOST 'mkdir /home/k004373/rowing-staging/svelte/build' + - ssh $SSH_USER@$SSH_HOST 'mkdir -p /home/k004373/rowing-staging/svelte/build' - ssh $SSH_USER@$SSH_HOST 'sudo systemctl start rot' only: - main From c63a2b20327df532c9c939f29b43df390d0dc8b2 Mon Sep 17 00:00:00 2001 From: philipp Date: Sun, 30 Jul 2023 17:56:32 +0200 Subject: [PATCH 15/22] push --- .gitlab-ci.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 60c28fd..22e503e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,8 +5,7 @@ variables: before_script: - rustup target add $CARGO_TARGET - - apt-get update -qq && apt-get install -y -qq sshpass musl musl-tools - - apt update && apt install -y sqlite3 && ./test_db.sh + - apt-get update -qq && apt-get install -y -qq sshpass musl musl-tools sqlite3 && ./test_db.sh build: stage: build @@ -33,12 +32,13 @@ deploy-staging: - chmod 700 ~/.ssh - ssh-keyscan -H $SSH_HOST > ~/.ssh/known_hosts script: - - ssh $SSH_USER@$SSH_HOST 'sudo systemctl stop rotstaging' - - scp target/$CARGO_TARGET/release/rot $SSH_USER@$SSH_HOST:/home/k004373/rowing-staging - - ssh $SSH_USER@$SSH_HOST 'rm /home/k004373/rowing-staging/db.sqlite && cp /home/k004373/rowing/db.sqlite /home/k004373/rowing-staging/db.sqlite && mkdir -p /home/k004373/rowing-staging/svelte/build' + - scp target/$CARGO_TARGET/release/rot $SSH_USER@$SSH_HOST:/home/k004373/rowing-staging/rot-updating - scp -r static $SSH_USER@$SSH_HOST:/home/k004373/rowing-staging/ - scp -r templates $SSH_USER@$SSH_HOST:/home/k004373/rowing-staging/ - scp -r svelte $SSH_USER@$SSH_HOST:/home/k004373/rowing-staging/ + - ssh $SSH_USER@$SSH_HOST 'sudo systemctl stop rotstaging' + - ssh $SSH_USER@$SSH_HOST 'rm /home/k004373/rowing-staging/db.sqlite && cp /home/k004373/rowing/db.sqlite /home/k004373/rowing-staging/db.sqlite && mkdir -p /home/k004373/rowing-staging/svelte/build' + - mv /home/k004373/rowing-staging/rot-updating /home/k004373/rowing-staging/rot - ssh $SSH_USER@$SSH_HOST 'sudo systemctl start rotstaging' only: - staging @@ -53,12 +53,13 @@ deploy-main: - chmod 700 ~/.ssh - ssh-keyscan -H $SSH_HOST > ~/.ssh/known_hosts script: - - ssh $SSH_USER@$SSH_HOST 'sudo systemctl stop rot' - - scp target/$CARGO_TARGET/release/rot $SSH_USER@$SSH_HOST:/home/k004373/rowing + - scp target/$CARGO_TARGET/release/rot $SSH_USER@$SSH_HOST:/home/k004373/rowing/rot-updating - scp -r static $SSH_USER@$SSH_HOST:/home/k004373/rowing/ - scp -r templates $SSH_USER@$SSH_HOST:/home/k004373/rowing/ - scp -r svelte $SSH_USER@$SSH_HOST:/home/k004373/rowing/ - - ssh $SSH_USER@$SSH_HOST 'mkdir -p /home/k004373/rowing-staging/svelte/build' + - ssh $SSH_USER@$SSH_HOST 'mkdir -p /home/k004373/rowing/svelte/build' + - ssh $SSH_USER@$SSH_HOST 'sudo systemctl stop rotstaging' + - mv /home/k004373/rowing/rot-updating /home/k004373/rowing/rot - ssh $SSH_USER@$SSH_HOST 'sudo systemctl start rot' only: - main From 838352fcfc9d4b11b87b023baf8b5e90656aaa00 Mon Sep 17 00:00:00 2001 From: philipp Date: Sun, 30 Jul 2023 18:24:10 +0200 Subject: [PATCH 16/22] strip binary --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 22e503e..a328078 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,6 +11,7 @@ build: stage: build script: - cargo build --release --target $CARGO_TARGET + - strip target/$CARGO_TARGET/release/rot artifacts: paths: - target/$CARGO_TARGET/release/rot From e70104289155c55f80e87719d1edcaba43c8a814 Mon Sep 17 00:00:00 2001 From: philipp Date: Sun, 30 Jul 2023 18:28:01 +0200 Subject: [PATCH 17/22] build js --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a328078..d86868f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,6 +11,7 @@ build: stage: build script: - cargo build --release --target $CARGO_TARGET + - cd frontend && npm run build - strip target/$CARGO_TARGET/release/rot artifacts: paths: From 2beff31a7118f5d58956f02ab0bdaf87dedb122f Mon Sep 17 00:00:00 2001 From: philipp Date: Sun, 30 Jul 2023 18:30:56 +0200 Subject: [PATCH 18/22] push --- .gitlab-ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d86868f..5f11d5c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -40,7 +40,7 @@ deploy-staging: - scp -r svelte $SSH_USER@$SSH_HOST:/home/k004373/rowing-staging/ - ssh $SSH_USER@$SSH_HOST 'sudo systemctl stop rotstaging' - ssh $SSH_USER@$SSH_HOST 'rm /home/k004373/rowing-staging/db.sqlite && cp /home/k004373/rowing/db.sqlite /home/k004373/rowing-staging/db.sqlite && mkdir -p /home/k004373/rowing-staging/svelte/build' - - mv /home/k004373/rowing-staging/rot-updating /home/k004373/rowing-staging/rot + - ssh $SSH_USER@$SSH_HOST 'mv /home/k004373/rowing-staging/rot-updating /home/k004373/rowing-staging/rot' - ssh $SSH_USER@$SSH_HOST 'sudo systemctl start rotstaging' only: - staging @@ -60,8 +60,8 @@ deploy-main: - scp -r templates $SSH_USER@$SSH_HOST:/home/k004373/rowing/ - scp -r svelte $SSH_USER@$SSH_HOST:/home/k004373/rowing/ - ssh $SSH_USER@$SSH_HOST 'mkdir -p /home/k004373/rowing/svelte/build' - - ssh $SSH_USER@$SSH_HOST 'sudo systemctl stop rotstaging' - - mv /home/k004373/rowing/rot-updating /home/k004373/rowing/rot + - ssh $SSH_USER@$SSH_HOST 'sudo systemctl stop rot' + - ssh $SSH_USER@$SSH_HOST 'mv /home/k004373/rowing/rot-updating /home/k004373/rowing/rot' - ssh $SSH_USER@$SSH_HOST 'sudo systemctl start rot' only: - main From d1dd5372bd15e48e7f83524bf9e0b13207209439 Mon Sep 17 00:00:00 2001 From: philipp Date: Sun, 30 Jul 2023 19:20:04 +0200 Subject: [PATCH 19/22] push --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5f11d5c..464d0ec 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,13 +5,13 @@ variables: before_script: - rustup target add $CARGO_TARGET - - apt-get update -qq && apt-get install -y -qq sshpass musl musl-tools sqlite3 && ./test_db.sh + - apt-get update -qq && apt-get install -y -qq sshpass musl musl-tools sqlite3 npm && ./test_db.sh build: stage: build script: - cargo build --release --target $CARGO_TARGET - - cd frontend && npm run build + - cd frontend && npm install && npm run build - strip target/$CARGO_TARGET/release/rot artifacts: paths: From 6029d7b9b61fc011a2f926de92e8e4060ef84a8e Mon Sep 17 00:00:00 2001 From: philipp Date: Sun, 30 Jul 2023 19:35:10 +0200 Subject: [PATCH 20/22] use new nodejs --- .gitlab-ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 464d0ec..3b15acb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,7 +5,8 @@ variables: before_script: - rustup target add $CARGO_TARGET - - apt-get update -qq && apt-get install -y -qq sshpass musl musl-tools sqlite3 npm && ./test_db.sh + - apt-get update -qq && apt-get install -y -qq sshpass musl musl-tools sqlite3 curl gnupg && curl -sL https://deb.nodesource.com/setup_14.x | bash - && apt-get install -y nodejs + - ./test_db.sh build: stage: build From cf897df36faac44f06a8855c774e785f5db9119e Mon Sep 17 00:00:00 2001 From: philipp Date: Sun, 30 Jul 2023 19:37:08 +0200 Subject: [PATCH 21/22] push --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3b15acb..cc5dc8d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,7 +5,7 @@ variables: before_script: - rustup target add $CARGO_TARGET - - apt-get update -qq && apt-get install -y -qq sshpass musl musl-tools sqlite3 curl gnupg && curl -sL https://deb.nodesource.com/setup_14.x | bash - && apt-get install -y nodejs + - apt-get update -qq && apt-get install -y -qq sshpass musl musl-tools sqlite3 curl gnupg && curl -sL https://deb.nodesource.com/setup_16.x | bash - && apt-get install -y nodejs - ./test_db.sh build: From a3ca996f782d5c42017d11cf8559969659a8e9e2 Mon Sep 17 00:00:00 2001 From: philipp Date: Sun, 30 Jul 2023 19:56:53 +0200 Subject: [PATCH 22/22] push --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index cc5dc8d..8486d7b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -13,7 +13,7 @@ build: script: - cargo build --release --target $CARGO_TARGET - cd frontend && npm install && npm run build - - strip target/$CARGO_TARGET/release/rot + # - strip target/$CARGO_TARGET/release/rot artifacts: paths: - target/$CARGO_TARGET/release/rot