-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from mitre/updateDocumentation
updateDocumentation
- Loading branch information
Showing
18 changed files
with
233 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,8 @@ | ||
# git | ||
.git | ||
.gitignore | ||
CHANGELOG.md | ||
# VS Code | ||
.vscode/ | ||
|
||
# ci | ||
.gitlab-ci.yml | ||
# doc | ||
doc/ | ||
|
||
# code | ||
spec | ||
.env | ||
spec/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Push emasser CLI to Docker Hub on every merge to master and tag as latest | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
|
||
|
||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Checkout the emasser Repository | ||
uses: actions/checkout@v2 | ||
- name: Build and push | ||
id: docker_build | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
file: Dockerfile | ||
push: true | ||
tags: mitre/emasser:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Push emasser to Docker Hub on every release | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Run string replace | ||
uses: frabert/replace-string-action@master | ||
id: format-tag | ||
with: | ||
pattern: 'v' | ||
string: "${{ github.event.release.tag_name }}" | ||
replace-with: '' | ||
flags: 'g' | ||
- name: Checkout the emasser Repository | ||
uses: actions/checkout@v2 | ||
- name: Build and push | ||
id: docker_build | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
file: Dockerfile | ||
push: true | ||
tags: mitre/emasser:release-latest,mitre/emasser:${{ steps.format-tag.outputs.replaced }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,8 +11,9 @@ | |
|
||
**/*.un~ | ||
|
||
emassing/test/test_example.zip | ||
.DS_Store | ||
.byebug_history | ||
.env | ||
key.pem | ||
client.pem | ||
*.gem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,42 @@ | ||
FROM ruby:2.5 | ||
# Buld from ruby 2.7.5 image | ||
FROM ruby:2.7.5 as build | ||
|
||
LABEL name="emasser" \ | ||
vendor="MITRE" \ | ||
version="${EMASSER_VERSION}" \ | ||
release="1" \ | ||
url="https://github.com/mitre/emasser" \ | ||
description="Emasser is a command-line interface (CLI) that aims to automate routine business use-cases and provide utility surrounding the Enterprise Mission Assurance Support Service (eMASS) by leveraging its representational state transfer (REST) application programming interface (API)." \ | ||
docs="https://mitre.github.io/emasser/" \ | ||
run="docker run -d --name ${NAME} ${IMAGE} <args>" | ||
|
||
# Set the base directory that will be used from now on | ||
WORKDIR /emasser | ||
|
||
COPY . . | ||
# Copy - source (.) destination (.) | ||
|
||
# Install dependency | ||
RUN gem install bundler -v '2.3.5' | ||
RUN apt update && apt install -y build-essential | ||
COPY . . | ||
RUN bundle install | ||
WORKDIR /emasser/emass_client/ruby_client | ||
RUN gem build emass_client.gemspec | ||
WORKDIR /emasser | ||
RUN gem build emasser.gemspec | ||
RUN mkdir gems | ||
RUN mv emass_client/ruby_client/emass_client*.gem gems/emass_client.gem | ||
RUN mv emasser*.gem gems/emasser.gem | ||
|
||
FROM ruby:2-alpine | ||
# RUN sed -i 's/https/http/g' /etc/apk/repositories | ||
COPY --from=build /emasser/gems /emass-gems | ||
|
||
RUN apk add build-base libcurl && gem install /emass-gems/emass_client.gem && gem install /emass-gems/emasser.gem | ||
|
||
VOLUME [ "/data" ] | ||
WORKDIR /data | ||
|
||
ENTRYPOINT ["emasser"] | ||
|
||
ENTRYPOINT ["bundle", "exec", "exe/emasser"] | ||
CMD ["-h"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.