Skip to content

Commit

Permalink
Fixed DockerFiles
Browse files Browse the repository at this point in the history
  • Loading branch information
UO282476 authored and UO282476 committed May 2, 2023
1 parent b1dfb99 commit d40c592
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 19 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/lomap_en1a.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,40 +56,40 @@ jobs:
docker-push-webapp:
name: Push webapp Docker Image to GitHub Packages
runs-on: ubuntu-latest
needs: [unit-test-webapp, unit-test-restapi]
#needs: [unit-test-webapp, unit-test-restapi]
#needs: [e2e-tests]
steps:
- uses: actions/checkout@v3
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@v5
# env:
# HOST_NAME: ${{ secrets.HOST_NAME }}
# API_URI: https://${{ secrets.HOST_NAME }}:5443
env:
HOST_DOMAIN: ${{ secrets.HOST_NAME }}
API_URI: https://${{ secrets.HOST_NAME }}:5443
with:
name: arquisoft/lomap_en1a/webapp
username: ${{ github.actor }}
password: ${{ secrets.DOCKER_PUSH_TOKEN }}
registry: ghcr.io
workdir: webapp
#buildargs: HOST_NAME, API_URI
buildargs: HOST_DOMAIN, API_URI
docker-push-restapi:
name: Push restapi Docker Image to GitHub Packages
runs-on: ubuntu-latest
needs: [unit-test-webapp, unit-test-restapi]
#needs: [unit-test-webapp, unit-test-restapi]
#needs: [e2e-tests]
steps:
- uses: actions/checkout@v3
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@v5
# env:
# HOST_NAME: ${{ secrets.HOST_NAME }}
env:
HOST_DOMAIN: ${{ secrets.HOST_NAME }}
with:
name: arquisoft/lomap_en1a/restapi
username: ${{ github.actor }}
password: ${{ secrets.DOCKER_PUSH_TOKEN }}
registry: ghcr.io
workdir: restapi
#buildargs: HOST_NAME
buildargs: HOST_DOMAIN
deploy:
name: Deploy over SSH
runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions restapi/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ WORKDIR /app
#Install the dependencies
RUN npm install

ARG HOST_NAME="lomapen1a.cloudns.ph"
ENV host=$HOST_NAME
ARG HOST_DOMAIN="localhost"
ENV host=$HOST_DOMAIN

CMD [ "npm", "start" ]
6 changes: 3 additions & 3 deletions webapp/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ WORKDIR /app
#Install the dependencies
RUN npm install

ARG API_URI="https://lomapen1a.cloudns.ph:5443/api"
ARG API_URI="https://localhost:5443/api"
ENV REACT_APP_API_URI=$API_URI

ARG host="lomapen1a.cloudns.ph"
ENV host=$host
ARG HOST_DOMAIN="localhost"
ENV host=$HOST_DOMAIN

#Create an optimized version of the webapp
RUN npm run build
Expand Down
10 changes: 8 additions & 2 deletions webapp/e2e/steps/friendsmanagement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,20 @@ defineFeature(feature, test => {
beforeAll(async () => {
browser = process.env.GITHUB_ACTIONS
? await puppeteer.launch()
: await puppeteer.launch({ headless: true, slowMo: 50 });
: await puppeteer.launch({ headless: false, slowMo: 150 });
page = await browser.newPage();

await page
.goto("http://localhost:80", {
.goto("https://localhost:80", {
waitUntil: "networkidle0",
})
.catch(() => { });

await page.waitForSelector('#details-button')
await page.click('#details-button')

await page.waitForSelector('#proceed-link')
await page.click('#proceed-link')
});

test('The user wants to see the friends management tab', ({ given, when, then }) => {
Expand Down
2 changes: 1 addition & 1 deletion webapp/e2e/steps/login.steps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ defineFeature(feature, test => {
page = await browser.newPage();

await page
.goto("http://localhost:80", {
.goto("https://localhost:80", {
waitUntil: "networkidle0",
})
.catch(() => { });
Expand Down
2 changes: 1 addition & 1 deletion webapp/e2e/steps/profile.steps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ defineFeature(feature, test => {
page = await browser.newPage();

await page
.goto("http://localhost:80", {
.goto("https://localhost:80", {
waitUntil: "networkidle0",
})
.catch(() => { });
Expand Down
2 changes: 1 addition & 1 deletion webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"start": "node server.js",
"build": "react-scripts build",
"test": "react-scripts test --transformIgnorePatterns \"node_modules/(?!ol)/\" --coverage",
"test:e2e": "start-server-and-test 'npm --prefix ../restapi run prod' http://localhost:5080/api prod 80 \"cd e2e && jest\"",
"test:e2e": "start-server-and-test 'npm --prefix ../restapi run prod' prod \"cd e2e && jest\"",
"eject": "react-scripts eject",
"prod": "node server.js"
},
Expand Down

0 comments on commit d40c592

Please sign in to comment.