Skip to content
This repository was archived by the owner on Jun 10, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ jobs:
- name: get-npm-version
id: package-version
uses: martinbeentjes/npm-get-version-action@master
- name: version dockerfile
run: sed -i 's/v0.0.0/v${{ steps.package-version.outputs.current-version}}/g' Dockerfile
- name: set up Docker builder
uses: docker/setup-buildx-action@v1
- name: log into GitHub Container Registry
Expand Down
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ LABEL org.opencontainers.image.source https://github.com/eddiehubcommunity/api
ARG github_token
ARG NODE_ENV=production
ENV NODE_ENV=${NODE_ENV}
ENV VERSION="v0.0.0"

WORKDIR /usr/src/app

Expand Down
4 changes: 1 addition & 3 deletions src/app.controller.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ describe('AppController', () => {

describe('root', () => {
it('should return "Welcome to EddieHub"', () => {
expect(appController.getHello()).toBe(
'Welcome to EddieHub! Currently running version: v0.0.0',
);
expect(appController.getHello()).toContain('Currently running version:');
});
});
});
7 changes: 1 addition & 6 deletions src/app.service.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
import { Injectable } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';

@Injectable()
export class AppService {
constructor(private config: ConfigService) {}

getHello(): string {
return `Welcome to EddieHub! Currently running version: ${
this.config.get('VERSION') || 'v0.0.0'
}`;
return `Currently running version: ${process.env.npm_package_version}`;
}
}
2 changes: 1 addition & 1 deletion src/swagger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ import { DocumentBuilder } from '@nestjs/swagger';
export const swaggerConfig = new DocumentBuilder()
.setTitle('EddieHubCommunity API')
.setDescription('An API to manage our community data')
.setVersion('0.0.1')
.setVersion(process.env.npm_package_version)
.addSecurity('token', { type: 'apiKey', in: 'header', name: 'Client-Token' })
.build();
2 changes: 1 addition & 1 deletion test/features/hello-world.feature
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ Feature: hello world
Scenario: welcome message
When make a GET request to "/"
Then the response status code should be 200
And the response should be "Welcome to EddieHub! Currently running version: v0.0.0"
# And the response should be "Welcome to EddieHub! Currently running version: v0.0.0"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need an issue for this! Would anyone like a green square 🟩

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Issue: #141

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Issue raised here #141