Skip to content

Commit

Permalink
Merge pull request #118 from JarvusInnovations/develop
Browse files Browse the repository at this point in the history
Release: hologit v0.35.0
  • Loading branch information
themightychris authored Jan 13, 2021
2 parents d0b6f23 + 8b1443f commit 7eda77a
Show file tree
Hide file tree
Showing 13 changed files with 140 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish-actions-develop.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Public Actions to develop stream
name: Publish Actions to develop stream

on:
push:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-actions-v1.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Public Actions to v1 stream
name: Publish Actions to v1 stream

on:
push:
branches: [master]
tags: [ 'v*' ]


jobs:
Expand Down
86 changes: 86 additions & 0 deletions .github/workflows/publish-habitat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: Publish Habitat package and studio

on:
push:
tags: [ 'v*' ]

env:
HAB_LICENSE: accept-no-persist


jobs:
publish-habitat:
runs-on: ubuntu-latest
steps:
- name: 'Initialize Chef Habitat environment'
uses: JarvusInnovations/habitat-action@action/v1
with:
deps: |
core/hab-plan-build
- uses: actions/checkout@v2
- name: Place tag in environment
run: |
echo "SOURCE_TAG=${GITHUB_REF:10}" >> $GITHUB_ENV
echo "REPO_NAME=${GITHUB_REPOSITORY,,}" >> $GITHUB_ENV
- name: Import origin key
run: |
hab origin key import <<END_OF_KEY
${{ secrets.HAB_ORIGIN_KEY }}
END_OF_KEY
hab origin key import <<END_OF_KEY
${{ secrets.HAB_ORIGIN_KEY_PUB }}
END_OF_KEY
- name: Setting package.json version
run: npm version --no-git-tag-version "${SOURCE_TAG#v}"

- name: Build jarvus/hologit
run: |
hab pkg exec core/hab-plan-build hab-plan-build .
source results/last_build.env
echo "HOLOGIT_PACKAGE=jarvus/hologit/${pkg_version}/${pkg_release}" >> $GITHUB_ENV
- name: Upload jarvus/hologit
env:
HAB_AUTH_TOKEN: '${{ secrets.HAB_AUTH_TOKEN }}'
run: |
source results/last_build.env
hab pkg upload "results/${pkg_artifact}" -c stable
- name: Build jarvus/hologit-studio
run: |
hab pkg exec core/hab-plan-build hab-plan-build studio
source results/last_build.env
echo "HOLOGIT_STUDIO_PACKAGE=jarvus/hologit-studio/${pkg_version}/${pkg_release}" >> $GITHUB_ENV
- name: Upload jarvus/hologit-studio
env:
HAB_AUTH_TOKEN: '${{ secrets.HAB_AUTH_TOKEN }}'
run: |
source results/last_build.env
hab pkg upload "results/${pkg_artifact}" -c stable
- name: Pull previous jarvus/hologit-studio:latest
run: docker pull jarvus/hologit-studio:latest || true

- name: Build new jarvus/hologit-studio:latest
run: |
docker build \
--build-arg "HOLOGIT_STUDIO_PACKAGE=${HOLOGIT_STUDIO_PACKAGE}" \
--cache-from "jarvus/hologit-studio:latest" \
--tag "jarvus/hologit-studio:latest" \
--tag "jarvus/hologit-studio:${SOURCE_TAG#v}" \
./studio
- name: Log into DockerHub
run: |
mkdir -p ~/.docker
echo "${{ secrets.DOCKER_CONFIG_BASE64 }}" | base64 -d > ~/.docker/config.json
- name: Push new jarvus/hologit-studio:latest
run: docker push jarvus/hologit-studio:latest
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
name: Docs Site
name: Publish Website

on:
push:
branches: [ develop ]


jobs:
docs-projection:
publish-website:
runs-on: ubuntu-latest
steps:
- name: 'Projecting docs-site holobranch onto gh-pages'
Expand Down
4 changes: 2 additions & 2 deletions .studiorc
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ echo "--> Installing project development dependencies..."
hab pkg install \
jarvus/mkdocs-studio \
jarvus/studio-toolkit \
jarvus/node12 \
jarvus/node14 \
core/git

hab pkg binlink jarvus/node12 core/git
hab pkg binlink jarvus/node14 core/git
hab pkg binlink core/coreutils env --dest /usr/bin


Expand Down
2 changes: 1 addition & 1 deletion github-actions/projector/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ outputs:
commit:
description: 'Commit hash for last projection (if commit-to is configured)'
runs:
using: 'node12'
using: 'node14'
main: 'index.js'
post: 'post.js'
8 changes: 2 additions & 6 deletions lib/Studio.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,13 +198,9 @@ class Studio {

const { uid, gid, username } = os.userInfo();

if (username) {
if (uid && gid && username) {
logger.info(`configuring container to use user: ${username}`);
await containerExec(container, '/bin/mkdir', '/home');
await containerExec(container, '/bin/adduser', '-u', `${uid}`, '-D', username);
await containerExec(container, '/bin/chown', '-R', username, '/hab/cache');
await containerExec(container, '/bin/find', '/hab/pkgs', '-maxdepth', '3', '-type', 'd', '-exec', 'chown', `-R`, username, '{}', ';');
await containerExec(container, '/bin/hab', 'pkg', 'install', '--binlink', '--force', 'core/tar');
await containerExec(container, 'adduser', '-u', `${uid}`, '-G', 'developer', '-D', username);
container.defaultUser = `${uid}:${gid}`;
}

Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hologit",
"version": "0.34.5",
"version": "0.0.1",
"description": "Hologit automates the projection of layered composite file trees based on flat, declarative plans",
"repository": "https://github.com/EmergencePlatform/hologit",
"main": "lib/index.js",
Expand Down
6 changes: 3 additions & 3 deletions plan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ pkg_build_deps=(

pkg_deps=(
core/git
jarvus/node12 # newer than core/node12
core/hab/0.79.0 # last version before new license
jarvus/node14 # newer than core/node12
core/hab/0.79.1 # last version before new license
)

pkg_bin_dirs=(bin)
Expand Down Expand Up @@ -39,7 +39,7 @@ do_build() {
npm install

build_line "Fixing interpreter"
sed -e "s#\#\!/usr/bin/env node#\#\!$(pkg_path_for node12)/bin/node#" --in-place "node-bin/cli.js"
sed -e "s#\#\!/usr/bin/env node#\#\!$(pkg_path_for node14)/bin/node#" --in-place "node-bin/cli.js"

popd > /dev/null
}
Expand Down
3 changes: 3 additions & 0 deletions studio/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.dockerignore
Dockerfile
results/
31 changes: 31 additions & 0 deletions studio/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# common base for both stages
FROM habitat/default-studio-x86_64-linux:0.79.1 as base

ARG HAB_LICENSE=no-accept
ENV HAB_LICENSE=$HAB_LICENSE
ENV HAB_ORIGIN=jarvus

ENTRYPOINT ["hab", "sup", "run"]
CMD ["jarvus/hologit-studio"]

RUN hab pkg install \
core/hab-sup/0.79.1 \
core/hab-launcher/10180 \
core/tar \
core/gcc \
&& hab pkg exec core/coreutils rm -rf /hab/cache/{artifacts,src}/

RUN hab pkg binlink core/busybox-static \
&& hab pkg binlink --dest /usr/bin core/busybox-static env \
&& hab pkg binlink --force core/tar

RUN mkdir -m 1777 -p /tmp \
&& mkdir -m 0750 -p /root \
&& mkdir -m 0755 -p /usr/bin /home \
&& addgroup developer \
&& chgrp -R developer /hab \
&& chmod -R g+w /hab

ARG HOLOGIT_STUDIO_PACKAGE=jarvus/hologit-studio
RUN hab pkg install $HOLOGIT_STUDIO_PACKAGE \
&& hab pkg exec core/coreutils rm -rf /hab/cache/{artifacts,src}/
8 changes: 4 additions & 4 deletions studio/plan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ pkg_license=("MIT")
pkg_maintainer="Chris Alfano <chris@jarv.us>"

pkg_build_deps=(
core/hab
core/hab/0.79.1
)
pkg_deps=(
core/coreutils
jarvus/hologit
core/busybox-static
${HOLOGIT_PACKAGE:-jarvus/hologit}
)

pkg_exports=(
Expand All @@ -22,7 +22,7 @@ pkg_svc_run="git-holo studio --socket ${pkg_svc_var_path}/studio.sock"


pkg_version() {
hab pkg path jarvus/hologit | cut -d/ -f6
hab pkg path ${HOLOGIT_PACKAGE:-jarvus/hologit} | cut -d/ -f6
}

# implement build workflow
Expand Down

0 comments on commit 7eda77a

Please sign in to comment.