Skip to content

Commit

Permalink
push
Browse files Browse the repository at this point in the history
  • Loading branch information
milesstoetzner committed Oct 4, 2023
1 parent 5a1d85b commit a74784a
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 24 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,23 @@ jobs:
run: gh release create build-${GITHUB_SHA} -t "Build ${GITHUB_SHA}" -n "This is the build of the commit ${GITHUB_SHA}" ./dist/*
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

###################################################
#
# Docker
#
###################################################

- name: (DOCKER) Log in to the Container registry
uses: docker/[email protected]
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: (DOCKER) Build and push Docker image
uses: docker/[email protected]
with:
context: .
push: true
tags: ${{ github.repository }}:${{ github.sha }}
25 changes: 16 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
FROM node:18.15.0-bullseye as build
WORKDIR /app
COPY . .
RUN yarn --immutable
RUN yarn test
RUN yarn build
RUN yarn pkg --config .pkgrc.linux-x64.json build/cli/index.js
# Build stage
#FROM node:18.15.0-bullseye as build
#WORKDIR /app
#COPY . .
#RUN yarn --immutable
#RUN yarn test
#RUN yarn build
#RUN yarn pkg --config .pkgrc.linux-x64.json build/cli/index.js


# Run stage
FROM ubuntu:22.04 as run

# Labels
LABEL org.opencontainers.image.source=https://github.com/OpenTOSCA/opentosca-vintner
LABEL org.opencontainers.image.description="OpenTOSCA Vintner"
LABEL org.opencontainers.image.licenses=Apache-2.0

# Working directory
WORKDIR /vintner

Expand All @@ -35,7 +42,6 @@ RUN ./scripts/install-ansible.sh

# Install Terraform
RUN ./scripts/install-terraform.sh
# TODO: authenticate in docker-entrypoint?

# Install GCP CLI
RUN ./scripts/install-gcloud.sh
Expand All @@ -47,7 +53,8 @@ RUN ./scripts/install-unfurl.sh
RUN ./scripts/install-xopera.sh

# Install vintner
COPY --from=build /app/dist/vintner /bin/vintner
#COPY --from=build /app/dist/vintner /bin/vintner
COPY /app/dist/vintner-linux-x64 /bin/vintner
ENV OPENTOSCA_VINTNER_HOME_DIR=/vintner/data
RUN vintner setup init

Expand Down
61 changes: 46 additions & 15 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,49 @@
#!/bin/sh
set -e

echo "The container is kept to be busy so that it can run detached in the background."
echo ""
echo "Vintner can be used in the following way:"
echo " docker exec -it vintner vintner --version"
echo ""
echo "If you make use of Terraform, then you need to log into your account the following way:"
echo " docker exec -it vintner terraform login"
echo ""
echo "If you are running on linux, then you can set an alias to natively use \"vintner\", e.g., \"vintner --version\""
echo " alias vintner=\"docker exec -it vintner vintner\""
echo ""
echo "For more information, please consider our documentation:"
echo " https://vintner.opentosca.org"

tail -f /dev/null
MODE=${1:-cli}

###################################################
#
# CLI
#
###################################################

if [ "$MODE" = "cli" ]; then
echo "The container is kept busy so that it can run detached in the background.
Vintner can be used in the following way:
docker exec -it vintner vintner --version
If you make use of Terraform, then you need to log into your account the following way:
docker exec -it vintner terraform login
If you are running on linux, then you can set an alias to natively use \"vintner\", e.g., \"vintner --version\"
alias vintner=\"docker exec -it vintner vintner\"
For more information, please consider our documentation:
https://vintner.opentosca.org"

tail -f /dev/null
fi


###################################################
#
# Server
#
###################################################

if [ "$MODE" = "server" ]; then
/bin/vintner server start
fi


###################################################
#
# Abort
#
###################################################

echo mode \""$MODE"\" is unknown
exit 1

0 comments on commit a74784a

Please sign in to comment.