From 4a51a4cdd0967e8bc0e73525565a3ee106dc67a5 Mon Sep 17 00:00:00 2001 From: core Date: Sat, 6 Apr 2024 22:12:26 -0400 Subject: [PATCH] client image builds --- .woodpecker/.client.yaml | 18 ++++++++++++++---- ansible/deploy.yml | 28 ---------------------------- ansible/deploy_backplane.yml | 19 ------------------- ansible/environments/beta.yml | 30 ------------------------------ ansible/environments/stable.yml | 30 ------------------------------ ansible/environments/unstable.yml | 30 ------------------------------ ansible/global/backplane.yml | 21 --------------------- docker/Dockerfile.build_env | 4 ++-- starkingdoms-client/Dockerfile | 5 +++++ 9 files changed, 21 insertions(+), 164 deletions(-) delete mode 100644 ansible/deploy.yml delete mode 100644 ansible/deploy_backplane.yml delete mode 100644 ansible/environments/beta.yml delete mode 100644 ansible/environments/stable.yml delete mode 100644 ansible/environments/unstable.yml delete mode 100644 ansible/global/backplane.yml create mode 100644 starkingdoms-client/Dockerfile diff --git a/.woodpecker/.client.yaml b/.woodpecker/.client.yaml index 4266b5362c6dab63505708d6c33def5ef7206280..b3fe3c643218d7ab739412d3c1be4ed60afc09fb 100644 --- a/.woodpecker/.client.yaml +++ b/.woodpecker/.client.yaml @@ -1,17 +1,27 @@ steps: - name: client_fmt - image: node + image: node:21-alpine commands: - cd starkingdoms-client - yarn - yarn prettier . --check + - name: client_build depends_on: - client_fmt - image: node + image: node:21-alpine commands: - cd starkingdoms-client - yarn - yarn build - - cd dist - - tar cJvf client.tar.xz * \ No newline at end of file + + - name: build_image + depends_on: + - client_build + image: node:21-alpine + commands: + - cd starkindoms-client + - docker login registry.gitlab.com -u c0repwn3r -p $GITLAB_TOKEN + - docker build . -t registry.gitlab.com/starkingdoms.tk/starkingdoms.tk/client:$(git describe --always) + - docker push registry.gitlab.com/starkingdoms.tk/starkingdoms.tk/client:$(git describe --always) + secrets: [ gitlab_token ] \ No newline at end of file diff --git a/ansible/deploy.yml b/ansible/deploy.yml deleted file mode 100644 index cb0524661222eb46e9ec0616f9c44d17f78884e2..0000000000000000000000000000000000000000 --- a/ansible/deploy.yml +++ /dev/null @@ -1,28 +0,0 @@ -- name: Deploy game servers - hosts: gameservers - connection: ssh - tasks: - - name: Ensure host connectivity - ansible.builtin.ping: - - name: Stop game server - ansible.builtin.command: - cmd: sv stop starkingdoms - become: true - - name: Download new game server file - ansible.builtin.get_url: - url: "{{ server_binary_url }}" - dest: /opt/starkingdoms/starkingdoms-server - mode: '0777' - - name: Remove old client assets - ansible.builtin.shell: - cmd: rm -rf assets - chdir: /opt/starkingdoms/client/ - - name: Download and unpack client package - ansible.builtin.unarchive: - src: "{{ client_package_url }}" - dest: /opt/starkingdoms/client/ - remote_src: yes - - name: Start game server - ansible.builtin.command: - cmd: sv start starkingdoms - become: true \ No newline at end of file diff --git a/ansible/deploy_backplane.yml b/ansible/deploy_backplane.yml deleted file mode 100644 index 848dfa007b1b939e9c86a34bbe3234bb1fd20ae7..0000000000000000000000000000000000000000 --- a/ansible/deploy_backplane.yml +++ /dev/null @@ -1,19 +0,0 @@ -- name: Deploy backplane - hosts: backplaneservers - connection: ssh - tasks: - - name: Ensure host connectivity - ansible.builtin.ping: - - name: Stop backplane server - ansible.builtin.command: - cmd: sv stop starkingdoms-backplane - become: true - - name: Download new game server file - ansible.builtin.get_url: - url: "{{ backplane_binary_url }}" - dest: /opt/starkingdoms-backplane/starkingdoms-backplane - mode: '0777' - - name: Start backplane server - ansible.builtin.command: - cmd: sv start starkingdoms-backplane - become: true \ No newline at end of file diff --git a/ansible/environments/beta.yml b/ansible/environments/beta.yml deleted file mode 100644 index 427d1c0f00d72174d51fb6acac6c3114f30b787e..0000000000000000000000000000000000000000 --- a/ansible/environments/beta.yml +++ /dev/null @@ -1,30 +0,0 @@ -gameservers: - hosts: - srv01.beta.envs.starkingdoms.io: - ansible_port: 20451 - ansible_password: !vault | - $ANSIBLE_VAULT;1.1;AES256 - 33386562363537373139313435386332323434366136346166393864336538306634373233323666 - 6632646535373462313665663433663533393038353132370a366634323765633031313265313264 - 37616232666538383737306461336131623634623534646161623738333861633662613464396232 - 3665373430376137640a663435616461323732316632343061353336366538383937363830663132 - 61303033353330653065353465663437303030663733646662636539353164396237626435383534 - 3765366461396264393563616638393138633233303537303466 - ansible_become_password: !vault | - $ANSIBLE_VAULT;1.1;AES256 - 33386562363537373139313435386332323434366136346166393864336538306634373233323666 - 6632646535373462313665663433663533393038353132370a366634323765633031313265313264 - 37616232666538383737306461336131623634623534646161623738333861633662613464396232 - 3665373430376137640a663435616461323732316632343061353336366538383937363830663132 - 61303033353330653065353465663437303030663733646662636539353164396237626435383534 - 3765366461396264393563616638393138633233303537303466 - vars: - ansible_user: stk -apiservers: - hosts: - srv02.beta.envs.starkingdoms.io: - ansible_port: 20551 - ansible_password: TODO - ansible_become_password: TODO - vars: - ansible_user: stk \ No newline at end of file diff --git a/ansible/environments/stable.yml b/ansible/environments/stable.yml deleted file mode 100644 index 3d6ea9dda6b931f5a11cce2a780bb04a52a07c5c..0000000000000000000000000000000000000000 --- a/ansible/environments/stable.yml +++ /dev/null @@ -1,30 +0,0 @@ -gameservers: - hosts: - srv01.stable.envs.starkingdoms.io: - ansible_port: 20450 - ansible_password: !vault | - $ANSIBLE_VAULT;1.1;AES256 - 35333334373234333231336333623532656638326438323230656133326362653465613739346636 - 6139383536323339343963663763656439396564323633660a666237666537653639636431303664 - 39663839623466646233313930306234653039393866336165363763363430393539383138643939 - 6438653437373565300a343763373037383265626434316362393866336234633730386664326435 - 32666335356338633339353839623539343234393465343061323730623366653563656135366237 - 6633653335383836636333393064623139646366383831393430 - ansible_become_password: !vault | - $ANSIBLE_VAULT;1.1;AES256 - 35333334373234333231336333623532656638326438323230656133326362653465613739346636 - 6139383536323339343963663763656439396564323633660a666237666537653639636431303664 - 39663839623466646233313930306234653039393866336165363763363430393539383138643939 - 6438653437373565300a343763373037383265626434316362393866336234633730386664326435 - 32666335356338633339353839623539343234393465343061323730623366653563656135366237 - 6633653335383836636333393064623139646366383831393430 - vars: - ansible_user: stk -apiservers: - hosts: - srv02.stable.envs.starkingdoms.io: - ansible_port: 20550 - ansible_password: TODO - ansible_become_password: TODO - vars: - ansible_user: stk \ No newline at end of file diff --git a/ansible/environments/unstable.yml b/ansible/environments/unstable.yml deleted file mode 100644 index b7152ae5e89ddab31b0943dba927ed2ee91050cf..0000000000000000000000000000000000000000 --- a/ansible/environments/unstable.yml +++ /dev/null @@ -1,30 +0,0 @@ -gameservers: - hosts: - srv01.unstable.envs.starkingdoms.io: - ansible_port: 20452 - ansible_password: !vault | - $ANSIBLE_VAULT;1.1;AES256 - 30633533383938356363613936373132616565383938343732346462633263383237356364656139 - 6564373961356564623930363538616539326562343733390a616564636332373666386531313033 - 65623837366639393462333830616562366136343630393833393966663062343438326333393565 - 3961663664623962310a663265313036663835636638636561303363373962303139396235633631 - 32646362336332356630633138613765616563653164316134306463316466326266623863343631 - 3134616435636662666637623638383736343064626564616135 - ansible_become_password: !vault | - $ANSIBLE_VAULT;1.1;AES256 - 30633533383938356363613936373132616565383938343732346462633263383237356364656139 - 6564373961356564623930363538616539326562343733390a616564636332373666386531313033 - 65623837366639393462333830616562366136343630393833393966663062343438326333393565 - 3961663664623962310a663265313036663835636638636561303363373962303139396235633631 - 32646362336332356630633138613765616563653164316134306463316466326266623863343631 - 3134616435636662666637623638383736343064626564616135 - vars: - ansible_user: stk -apiservers: - hosts: - srv02.unstable.envs.starkingdoms.io: - ansible_port: 20552 - ansible_password: TODO - ansible_become_password: TODO - vars: - ansible_user: stk \ No newline at end of file diff --git a/ansible/global/backplane.yml b/ansible/global/backplane.yml deleted file mode 100644 index 3d450af48ffb83fb7f2c1d34cadcc0650669c84d..0000000000000000000000000000000000000000 --- a/ansible/global/backplane.yml +++ /dev/null @@ -1,21 +0,0 @@ -backplaneservers: - hosts: - backplane.starkingdoms.io: - ansible_password: !vault | - $ANSIBLE_VAULT;1.1;AES256 - 33613063633464623864346239346332383035366462393733643765376464363330326464353761 - 3138363931396161326338313836303931643066316231650a383134383431316265623763613739 - 39336332346130343133613831343533306435396337383663363561623831653230663036343463 - 3531386332663837340a363737386338623765326330383738643031623734616538653236623131 - 36323438343633323838333961616266643263343334366334346631656363383033383364366262 - 6636386161313530646564363131346266393061386563303132 - ansible_become_password: !vault | - $ANSIBLE_VAULT;1.1;AES256 - 33613063633464623864346239346332383035366462393733643765376464363330326464353761 - 3138363931396161326338313836303931643066316231650a383134383431316265623763613739 - 39336332346130343133613831343533306435396337383663363561623831653230663036343463 - 3531386332663837340a363737386338623765326330383738643031623734616538653236623131 - 36323438343633323838333961616266643263343334366334346631656363383033383364366262 - 6636386161313530646564363131346266393061386563303132 - vars: - ansible_user: team \ No newline at end of file diff --git a/docker/Dockerfile.build_env b/docker/Dockerfile.build_env index 06b4b1145ab0c08ffad2b59d1af43c06d3f48e3e..797ee9f80df87e89929b83099bf3b534d3ce7a14 100644 --- a/docker/Dockerfile.build_env +++ b/docker/Dockerfile.build_env @@ -1,4 +1,4 @@ -FROM rust +FROM rust:alpine # Note that we add wget here RUN apt-get update && apt-get install --yes libpq-dev wget @@ -9,4 +9,4 @@ RUN wget https://github.com/mozilla/sccache/releases/download/v0.7.4/sccache-v0. && mv sccache-v0.7.4-x86_64-unknown-linux-musl/sccache /usr/local/bin/sccache \ && chmod +x /usr/local/bin/sccache -RUN rustup component add rustfmt && rustup component add clippy +RUN rustup self update && rustup update && rustup component add rustfmt && rustup component add clippy diff --git a/starkingdoms-client/Dockerfile b/starkingdoms-client/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..207cedeb73deefa131699e192ee4b3fe4a62bc40 --- /dev/null +++ b/starkingdoms-client/Dockerfile @@ -0,0 +1,5 @@ +FROM node:21-alpine + +COPY dist . + +RUN cd dist && node .