Skip to content

Commit

Permalink
Updated github action with Dockerfile changes
Browse files Browse the repository at this point in the history
  • Loading branch information
akshatnema committed Sep 29, 2024
1 parent 5fe96e3 commit 31ba171
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ test/fixtures/minimaltemplate/__transpiled
.vscode

/action/
/github-action/output/

oclif.manifest.json
spec-examples.zip
Expand Down
File renamed without changes.
30 changes: 24 additions & 6 deletions github-action/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,36 @@ FROM node:18-alpine
# Create a non-root user
RUN addgroup -S myuser && adduser -S myuser -G myuser

RUN apk add --no-cache bash>5.1.16 git>2.42.0 chromium
# Install necessary packages

Check notice

Code scanning / SonarCloud

Arguments in long RUN instructions should be sorted Low

Sort these package names alphanumerically. See more on SonarCloud
RUN apk add --no-cache bash git chromium

# Environment variables for Puppeteer for PDF generation by HTML Template
# Environment variables for Puppeteer
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser

# Installing latest released npm package
RUN npm install --ignore-scripts -g @asyncapi/cli
FROM ubuntu:latest

COPY entrypoint.sh /entrypoint.sh
# Copy the asyncapi directory
COPY tmp/asyncapi/ /asyncapi

# Make the bash file executable
# Create a script that runs the desired command
RUN echo "#!/bin/bash\n/asyncapi/bin/run" > /usr/local/bin/asyncapi

# Make the script executable
RUN chmod +x /usr/local/bin/asyncapi

RUN ls -l /usr/local/bin/asyncapi

# Change ownership to non-root user
RUN chown -R myuser:myuser /asyncapi /usr/local/bin/asyncapi || echo "Failed to change ownership"

# Copy the entrypoint script
COPY github-action/entrypoint.sh /entrypoint.sh

# Make the entrypoint script executable
RUN chmod +x /entrypoint.sh

FROM node:18-alpine

# Set the entrypoint
ENTRYPOINT ["/entrypoint.sh"]
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,9 @@
"get-version": "echo $npm_package_version",
"createhook": "oclif generate hook myhook --event=command_not_found",
"createhookinit": "oclif generate hook inithook --event=init",
"action:docker:build": "docker build -f github-action/Dockerfile -t asyncapi/github-action-for-cli:latest action",
"action:docker:build": "docker build -f github-action/Dockerfile -t asyncapi/github-action-for-cli:latest .",
"action:bump:version": "npm --no-git-tag-version --allow-same-version version $VERSION",
"action:test": "make -f github-action/MakeFile test"
"action:test": "cd github-action && make test"
},
"types": "lib/index.d.ts"
}

0 comments on commit 31ba171

Please sign in to comment.