Skip to content

Commit

Permalink
Updated Github doc to v2, noted other docs as being v1 (#90)
Browse files Browse the repository at this point in the history
  • Loading branch information
fabio-looker committed May 3, 2022
1 parent 64674b2 commit cad0465
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 27 deletions.
5 changes: 4 additions & 1 deletion README.md
Expand Up @@ -85,8 +85,11 @@ lams
```

- **[Github Action](https://looker-open-source.github.io/look-at-me-sideways/github-action)** - This option is very quick to get started if you're using Github, and offers a compromise between convenience of setup and per-commit run performance.
- **[Dockerized Jenkins Server](https://github.com/looker-open-source/look-at-me-sideways/blob/master/docker/README.md)** - We have provided a Docker image with an end-to-end configuration including a Jenkins server, LAMS, and Github protected branches & status checks configuration.

The following examples were prepared for v1 of LAMS, though updating them for v2 should be straightforward. Please review [v2 release notes](https://looker-open-source.github.io/look-at-me-sideways/release-notes/v2) for details. In particular, look for error messages on the console's standard output rather than a file output to be committed back to the repo.

- **[GitLab CI](https://looker-open-source.github.io/look-at-me-sideways/gitlab-ci)** - A community-contributed configuration for GitLab, which offers similarly low overhead as our dockerized Jenkins configuration
- **[Dockerized Jenkins Server](https://github.com/looker-open-source/look-at-me-sideways/blob/master/docker/README.md)** - We have provided a Docker image with an end-to-end configuration including a Jenkins server, LAMS, and Github protected branches & status checks configuration.
- **[CircleCI](https://github.com/renewdotcom/renew-looker-template/blob/master/.circleci)** - A community-contributed configuration for CircleCI (external link)

## Configuration
Expand Down
16 changes: 8 additions & 8 deletions __tests__/docs-version-consistency.test.js
Expand Up @@ -5,25 +5,25 @@ const fs = require('fs');
const packageJson = require('../package.json');
const [major, minor, patch] = packageJson.version.split('.');
const packageVersion = {major, minor, patch};
const filePaths = [
'../README.md',
'../docs/github-action.md',
'../docs/gitlab-ci.md',
const fileConfigs = [
{file: '../README.md'},
{file: '../docs/github-action.md'},
{file: '../docs/gitlab-ci.md', major: '1'}, // Expecation of `major:"1"` should be removed once the doc is updated to v2
// '../docker/Dockerfile' // This doc does not yet use NPM. It should first be updated to use NPM.
];


describe('Docs version consistency', () => {
filePaths.forEach((filePath)=>{
it(filePath.replace('../', ''), async () => {
const file = await read(filePath);
fileConfigs.forEach((fileConfig)=>{
it(fileConfig.file.replace('../', ''), async () => {
const file = await read(fileConfig.file);
const commands = file.match(/npm\s*(-g)?\s*i(nstall)?\s*(-g)?\s*@looker\/look-at-me-sideways(@([0-9.]+))?/g) || [];
expect(commands).not.toHaveLength(0);
for (let command of commands) {
const [match, tag, version] = command.match(/look-at-me-sideways(@([0-9.]+))/) || []; // eslint-disable-line no-unused-vars
const [major, minor, patch] = (version||'').split('.');
const fileVersion = {major, minor, patch};
expect(fileVersion.major).toBe(packageVersion.major);
expect(fileVersion.major).toBe(fileConfig.major || packageVersion.major);
}
});
});
Expand Down
2 changes: 2 additions & 0 deletions docker/README.md
@@ -1,5 +1,7 @@
# LAMS Docker Image

**Note:** This configuration is out of date and may not work with LAMS v2. Please review [v2 release notes](https://looker-open-source.github.io/release-notes/v2) for details. In particular, look for error messages on the console's standard output rather than a file output to be committed back to the repo.

This is a fully functional Jenkins Server with a pre-configured job that is triggered by a webhook from a specified LookML Git repo, lints the branch invoking the job, commits the lint results back into the branch and sets a status to the commits.

<a name=docker_run></a>
Expand Down
18 changes: 1 addition & 17 deletions docs/github-action.md
Expand Up @@ -33,22 +33,6 @@ jobs:
run: npm install -g @looker/look-at-me-sideways@2
- name: Run LAMS
# See [PRIVACY.md](https://github.com/looker-open-source/look-at-me-sideways/blob/master/PRIVACY.md)
run: lams --reporting=... || echo "ERROR=true" >> $GITHUB_ENV
- name: Commit changes (e.g., issues.md)
run: |
git add .
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git commit -m "LAMS feedback" -a
- name: Push changes
uses: ad-m/github-push-action@02b0b75d447f0098d40d0d65a3e6cdf2119e6f60
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{github.ref}}
- name: Set status
run: |
if [ "$ERROR" ]; then
exit 1
fi
run: lams --reporting=... --report-license-key=... --report-user=...
```
<!-- {% endraw %}) -->
4 changes: 3 additions & 1 deletion docs/gitlab-ci.md
Expand Up @@ -3,6 +3,8 @@ favicon: img/logo.png
---
# Running LAMS via GitLab CI

**Note:** This example was prepared for v1 of LAMS, though updating it for v2 should be straightforward. Please review [v2 release notes](https://looker-open-source.github.io/release-notes/v2) for details. In particular, look for error messages on the console's standard output rather than a file output to be committed back to the repo.

This example shows how to run LAMS with GitLab CI and was contributed by [PieterjanCriel](https://github.com/PieterjanCriel). Thanks!

## Instructions
Expand All @@ -18,7 +20,7 @@ RUN apk --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/testin
apk --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing/ add \
nodejs nodejs-npm

RUN npm i -g @looker/look-at-me-sideways@2 --unsafe-perm
RUN npm i -g @looker/look-at-me-sideways@1 --unsafe-perm

CMD ["/bin/sh"]
```
Expand Down

0 comments on commit cad0465

Please sign in to comment.