Skip to content

Commit e9753fb

Browse files
Merge pull request #6154 from nymtech/ci/ns-agent-workflow
update ns agent workflow
2 parents 7d20609 + e010e7a commit e9753fb

File tree

3 files changed

+14
-45
lines changed

3 files changed

+14
-45
lines changed

.github/workflows/push-node-status-agent.yaml

Lines changed: 3 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@ name: Build and upload Node Status agent container to harbor.nymte.ch
33
on:
44
workflow_dispatch:
55
inputs:
6-
gateway_probe_git_ref:
7-
type: string
8-
default: nym-vpn-core-v1.4.0
9-
required: true
10-
description: Which gateway probe git ref to build the image with
116
release_image:
127
description: 'Tag image as a release'
138
required: true
@@ -43,16 +38,6 @@ jobs:
4338
VERSION=$(yq -oy '.package.version' ${{ env.WORKING_DIRECTORY }}/Cargo.toml)
4439
echo "result=$VERSION" >> $GITHUB_OUTPUT
4540
46-
- name: cleanup-gateway-probe-ref
47-
id: cleanup_gateway_probe_ref
48-
run: |
49-
GATEWAY_PROBE_GIT_REF=${{ github.event.inputs.gateway_probe_git_ref }}
50-
GIT_REF_SLUG="${GATEWAY_PROBE_GIT_REF//\//-}"
51-
echo "git_ref=${GIT_REF_SLUG}" >> $GITHUB_OUTPUT
52-
53-
- name: Set GIT_TAG variable
54-
run: echo "GIT_TAG=${{ env.WORKING_DIRECTORY }}-${{ steps.get_version.outputs.result }}-${{ steps.cleanup_gateway_probe_ref.outputs.git_ref }}" >> $GITHUB_ENV
55-
5641
- name: Initialize RELEASE_TAG
5742
run: echo "RELEASE_TAG=" >> $GITHUB_ENV
5843

@@ -61,24 +46,12 @@ jobs:
6146
run: echo "RELEASE_TAG=golden-" >> $GITHUB_ENV
6247

6348
- name: Set IMAGE_NAME_AND_TAGS variable
64-
run: echo "IMAGE_NAME_AND_TAGS=${{ env.CONTAINER_NAME }}:${{ env.RELEASE_TAG }}${{ steps.get_version.outputs.result }}-${{ steps.cleanup_gateway_probe_ref.outputs.git_ref }}" >> $GITHUB_ENV
49+
run: echo "IMAGE_NAME_AND_TAGS=${{ env.CONTAINER_NAME }}:${{ env.RELEASE_TAG }}${{ steps.get_version.outputs.result }}" >> $GITHUB_ENV
6550

6651
- name: New env vars
67-
run: echo "RELEASE_TAG='$RELEASE_TAG' GIT_TAG='$GIT_TAG' IMAGE_NAME_AND_TAGS='$IMAGE_NAME_AND_TAGS'"
68-
69-
# - name: Remove existing tag if exists
70-
# run: |
71-
# if git rev-parse $${{ env.GIT_TAG }} >/dev/null 2>&1; then
72-
# git push --delete origin $${{ env.GIT_TAG }}
73-
# git tag -d $${{ env.GIT_TAG }}
74-
# fi
75-
76-
# - name: Create tag
77-
# run: |
78-
# git tag -a $${{ env.GIT_TAG }} -m "Version ${{ steps.get_version.outputs.result }}-${{ steps.cleanup_gateway_probe_ref.outputs.git_ref }}"
79-
# git push origin $${{ env.GIT_TAG }}
52+
run: echo "RELEASE_TAG='$RELEASE_TAG' IMAGE_NAME_AND_TAGS='$IMAGE_NAME_AND_TAGS'"
8053

8154
- name: BuildAndPushImageOnHarbor
8255
run: |
83-
docker build --build-arg GIT_REF=${{ github.event.inputs.gateway_probe_git_ref }} -f ${{ env.WORKING_DIRECTORY }}/Dockerfile . -t harbor.nymte.ch/nym/${{ env.IMAGE_NAME_AND_TAGS }}
56+
docker build -f ${{ env.WORKING_DIRECTORY }}/Dockerfile . -t harbor.nymte.ch/nym/${{ env.IMAGE_NAME_AND_TAGS }}
8457
docker push harbor.nymte.ch/nym/${{ env.CONTAINER_NAME }} --all-tags

Cargo.lock

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

nym-node-status-api/nym-node-status-agent/Dockerfile

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
11
# this will only work with VPN, otherwise remove the harbor part
22
FROM harbor.nymte.ch/dockerhub/rust:latest AS builder
33

4-
ARG GIT_REF=main
5-
64
RUN apt update && apt install -yy libdbus-1-dev pkg-config libclang-dev
75

86
# Install go
97
RUN wget https://go.dev/dl/go1.22.5.linux-amd64.tar.gz -O go.tar.gz
108
RUN tar -xzvf go.tar.gz -C /usr/local
11-
12-
RUN git clone https://github.com/nymtech/nym-vpn-client /usr/src/nym-vpn-client
13-
RUN cd /usr/src/nym-vpn-client && git checkout $GIT_REF
149
ENV PATH=/go/bin:/usr/local/go/bin:$PATH
15-
WORKDIR /usr/src/nym-vpn-client/nym-vpn-core
16-
RUN cargo build --release --package nym-gateway-probe
1710

1811
COPY ./ /usr/src/nym
12+
WORKDIR /usr/src/nym
13+
RUN cargo build --release --package nym-gateway-probe
14+
1915
WORKDIR /usr/src/nym/nym-node-status-api/nym-node-status-agent
2016
RUN cargo build --release
2117

@@ -35,7 +31,7 @@ RUN apt-get update && apt-get install -y ca-certificates
3531
WORKDIR /nym
3632

3733
COPY --from=builder /usr/src/nym/target/release/nym-node-status-agent ./
38-
COPY --from=builder /usr/src/nym-vpn-client/nym-vpn-core/target/release/nym-gateway-probe ./
34+
COPY --from=builder /usr/src/nym/target/release/nym-gateway-probe ./
3935
COPY --from=builder /usr/src/nym/nym-node-status-api/nym-node-status-agent/entrypoint.sh ./
4036
RUN chmod +x /nym/entrypoint.sh
4137

0 commit comments

Comments
 (0)